Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint-1.18 #1629

Open
wants to merge 320 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
4a33b6b
Fix
Jayashsatolia403 Sep 11, 2024
c1c10ab
Fix
Jayashsatolia403 Sep 11, 2024
a30e879
add delete dir and get refs
Hitenjain14 Sep 11, 2024
e791180
fix process change for delete dir
Hitenjain14 Sep 11, 2024
3bd80b5
Fix wasm
Jayashsatolia403 Sep 11, 2024
94431da
Fix wasm
Jayashsatolia403 Sep 11, 2024
a459f76
fix delete dir
Hitenjain14 Sep 12, 2024
4c690e4
add timming log
Hitenjain14 Sep 12, 2024
c9723ae
Fix
Jayashsatolia403 Sep 12, 2024
4785265
Fix
Jayashsatolia403 Sep 12, 2024
042f96b
Fix
Jayashsatolia403 Sep 13, 2024
aa521ff
Fix
Jayashsatolia403 Sep 13, 2024
e71c555
Fix
Jayashsatolia403 Sep 13, 2024
f1e3427
fix setting root
Hitenjain14 Sep 14, 2024
23757f0
send ref path request to all
Hitenjain14 Sep 14, 2024
2d0ff4f
Fix
Jayashsatolia403 Sep 14, 2024
c21417a
add merge logs
Hitenjain14 Sep 15, 2024
68afe5d
fix collapse for short node
Hitenjain14 Sep 15, 2024
f4a0c22
check refs in delete
Hitenjain14 Sep 15, 2024
c5abb8f
add changesv2
Hitenjain14 Sep 15, 2024
85cb823
Fix
Jayashsatolia403 Sep 15, 2024
41d28b9
add eg for signature
Hitenjain14 Sep 15, 2024
ed19f05
Fix
Jayashsatolia403 Sep 15, 2024
f45e976
set limit to 4
Hitenjain14 Sep 15, 2024
d6b8675
Fix
Jayashsatolia403 Sep 15, 2024
b8ef8b7
Fix
Jayashsatolia403 Sep 15, 2024
c2c16df
remove group
Hitenjain14 Sep 15, 2024
d27b0cf
Fix
Jayashsatolia403 Sep 15, 2024
8655961
Fix
Jayashsatolia403 Sep 15, 2024
b96e59e
Fix
Jayashsatolia403 Sep 15, 2024
03ae614
Fix
Jayashsatolia403 Sep 15, 2024
a38a014
fix path
Hitenjain14 Sep 16, 2024
e93ee65
feature: provided required changes for other kms components
YarikRevich Sep 17, 2024
09a82f1
fix: fixed bugs
YarikRevich Sep 17, 2024
5e19f7a
Fix sc rest api call
Jayashsatolia403 Sep 17, 2024
5203586
remove hash signature map
Hitenjain14 Sep 18, 2024
88cd690
remove sign timing
Hitenjain14 Sep 18, 2024
3cdf57b
check timestamp
Hitenjain14 Sep 18, 2024
13671a7
add check for lwm
Hitenjain14 Sep 18, 2024
ae5837a
Multi wallet
Jayashsatolia403 Sep 18, 2024
77d333f
Added multiwallet in http.go
Jayashsatolia403 Sep 18, 2024
bd57812
Fix
Jayashsatolia403 Sep 19, 2024
6e54cf7
implement rename move and copy for v2
Hitenjain14 Sep 19, 2024
ec62905
Fix unit tests
Jayashsatolia403 Sep 19, 2024
101e3b2
Fix
Jayashsatolia403 Sep 19, 2024
fa5e1ce
Fix
Jayashsatolia403 Sep 19, 2024
d82518f
Fix/refactor zboxcore burn zcn (#1622)
yash10019coder Sep 21, 2024
4768e9c
Fix get mint nonce
Jayashsatolia403 Sep 21, 2024
664c4ab
Merge remote-tracking branch 'origin/fix/refactor-zboxcore' into fix/…
Jayashsatolia403 Sep 21, 2024
bf0ab98
Fix
Jayashsatolia403 Sep 21, 2024
0a7da38
add repair for v2
Hitenjain14 Sep 21, 2024
527afc1
check for cancel
Hitenjain14 Sep 21, 2024
6557b5e
Fix
Jayashsatolia403 Sep 21, 2024
aaac517
Debug
Jayashsatolia403 Sep 22, 2024
6f32838
Merge remote-tracking branch 'origin/fix/refactor-zboxcore' into fix/…
Jayashsatolia403 Sep 22, 2024
c649c27
Fix
Jayashsatolia403 Sep 22, 2024
bab6ab9
Fix sdk builds
Jayashsatolia403 Sep 22, 2024
0145dea
Remove readpool and add blobber_operations.go
Jayashsatolia403 Sep 22, 2024
4a1fa0f
Merge remote-tracking branch 'origin/sprint-1.18' into fix/refactor-z…
Jayashsatolia403 Sep 22, 2024
502c0e6
Remove readpool
Jayashsatolia403 Sep 22, 2024
69b386f
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Sep 22, 2024
bdbd749
Fix
Jayashsatolia403 Sep 22, 2024
9c29300
fix copy and move
Hitenjain14 Sep 23, 2024
af418a7
Fix mobilesdk build for refactor zboxcore (#1621)
yash10019coder Sep 23, 2024
b2d955f
Fix/refactor zboxcore lint. (#1627)
yash10019coder Sep 23, 2024
7d71307
fix no changes in connection
Hitenjain14 Sep 24, 2024
0a915db
fix repair
Hitenjain14 Sep 24, 2024
616c4d2
fix eof check
Hitenjain14 Sep 24, 2024
5244fe2
fix repair eof
Hitenjain14 Sep 24, 2024
4edbc83
Empty commit
Jayashsatolia403 Sep 24, 2024
21a49b0
Merge branch 'staging' into sprint-1.18
Jayashsatolia403 Sep 24, 2024
255d39c
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Sep 24, 2024
3fcf005
Fix
Jayashsatolia403 Sep 24, 2024
66cf176
set path hash
Hitenjain14 Sep 25, 2024
743428f
fix update key
Hitenjain14 Sep 25, 2024
dab4276
add prev weight
Hitenjain14 Sep 25, 2024
1c3af84
add debug log for commit size
Hitenjain14 Sep 25, 2024
7034f12
Fix wasm initialisation
Jayashsatolia403 Sep 25, 2024
0277b7b
Fix
Jayashsatolia403 Sep 25, 2024
163d4f7
fix update key weight
Hitenjain14 Sep 26, 2024
671aa1c
fix alloc root
Hitenjain14 Sep 26, 2024
9fac357
fix chain hash
Hitenjain14 Sep 26, 2024
a65b29b
add fix for verifying trie root
Hitenjain14 Sep 26, 2024
cdfa455
fix delete directory
Hitenjain14 Sep 26, 2024
ad353bb
Merge branch 'sprint-1.18' of github.com:0chain/gosdk into feature/km…
YarikRevich Sep 26, 2024
a76d9e5
Merge branch 'staging' of github.com:0chain/gosdk into sprint-1.18
YarikRevich Sep 26, 2024
3a046a7
Merge branch 'sprint-1.18' of github.com:0chain/gosdk into feature/km…
YarikRevich Sep 26, 2024
8afe385
fix mask pos
Hitenjain14 Sep 26, 2024
2480cab
fix: fixed bugs
YarikRevich Sep 27, 2024
91ab7c6
fix create existing dir
Hitenjain14 Sep 27, 2024
70b6929
fix new dir consensus
Hitenjain14 Sep 27, 2024
4ba58f5
Merge pull request #1630 from 0chain/feature/kms-roles
dabasov Sep 27, 2024
f945a84
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Sep 27, 2024
b513b97
Fix
Jayashsatolia403 Sep 27, 2024
4561413
Fix
Jayashsatolia403 Sep 27, 2024
fe4aad2
Fix wasm
Jayashsatolia403 Sep 27, 2024
777f666
Cleanup
Jayashsatolia403 Sep 28, 2024
dc41de7
take base as dest name
Hitenjain14 Sep 28, 2024
5ed4b78
Debug wasm
Jayashsatolia403 Sep 28, 2024
59de519
Debug wasm
Jayashsatolia403 Sep 28, 2024
da57d8a
Debug wasm
Jayashsatolia403 Sep 28, 2024
0434428
Debug wasm
Jayashsatolia403 Sep 28, 2024
b3a20c1
Debug wasm
Jayashsatolia403 Sep 28, 2024
657fd73
Debug wasm
Jayashsatolia403 Sep 28, 2024
4703a00
Debug
Jayashsatolia403 Sep 28, 2024
eaaa727
fix: fixed restriction setup
YarikRevich Sep 29, 2024
e1fd3c2
fix: fixed bugs
YarikRevich Sep 30, 2024
fe5f167
Debug
Jayashsatolia403 Oct 1, 2024
ad6b88d
Fix
Jayashsatolia403 Oct 1, 2024
9464c07
Debug
Jayashsatolia403 Oct 1, 2024
534eab7
Fix
Jayashsatolia403 Oct 1, 2024
83f0a3a
Revert "Fix"
Jayashsatolia403 Oct 1, 2024
856f95f
Debug
Jayashsatolia403 Oct 1, 2024
2d5d496
Debug
Jayashsatolia403 Oct 1, 2024
c5cd4a9
Debug
Jayashsatolia403 Oct 1, 2024
d1955d4
Debug
Jayashsatolia403 Oct 1, 2024
e43f436
Debug
Jayashsatolia403 Oct 1, 2024
4c6a907
Debug
Jayashsatolia403 Oct 1, 2024
f33e0de
Debug
Jayashsatolia403 Oct 1, 2024
83dc7ad
Debug
Jayashsatolia403 Oct 1, 2024
d651a0e
Debug
Jayashsatolia403 Oct 1, 2024
4101873
Debug
Jayashsatolia403 Oct 2, 2024
e81075c
fix: fixed bugs
YarikRevich Oct 2, 2024
adc3744
fix: fixed bugs
YarikRevich Oct 2, 2024
09d949a
Fix
Jayashsatolia403 Oct 2, 2024
c05b9fa
Fix
Jayashsatolia403 Oct 2, 2024
9e28ad5
Remove unnecessary print statements added for debug
Jayashsatolia403 Oct 2, 2024
2706fa6
Update version
Jayashsatolia403 Oct 2, 2024
77ae37b
Debug init sdk
Jayashsatolia403 Oct 2, 2024
4c4ae05
Reverted lru cache changes in http.go and added some debug print stat…
Jayashsatolia403 Oct 2, 2024
1dd2608
Fix sign function
Jayashsatolia403 Oct 2, 2024
859dddf
Remove print statements for system tests runs
Jayashsatolia403 Oct 2, 2024
d2713ad
Debug version go 1.23.2
Jayashsatolia403 Oct 2, 2024
47d4aca
Revert "Remove print statements for system tests runs"
Jayashsatolia403 Oct 2, 2024
0bedc9b
fix: fixed bugs
YarikRevich Oct 3, 2024
338ff55
Update version
Jayashsatolia403 Oct 3, 2024
7f6acb2
Fix default transport
Jayashsatolia403 Oct 3, 2024
747fb4b
Fix default transport
Jayashsatolia403 Oct 3, 2024
3e6ca43
Remove print statements
Jayashsatolia403 Oct 3, 2024
dad2a04
Added retries in http
Jayashsatolia403 Oct 3, 2024
3ba1430
Added retries in http
Jayashsatolia403 Oct 3, 2024
0a23674
Change http request
Jayashsatolia403 Oct 3, 2024
abe57d6
Change http request
Jayashsatolia403 Oct 3, 2024
98bd273
Change http request
Jayashsatolia403 Oct 3, 2024
7b354b7
Change http request
Jayashsatolia403 Oct 3, 2024
cc94d6c
Revert go lang to 1.22
Jayashsatolia403 Oct 4, 2024
08d4415
Added storageVersion
Jayashsatolia403 Oct 4, 2024
ac4a0c7
Merge remote-tracking branch 'origin' into feat/storage-v2
Hitenjain14 Oct 5, 2024
e294a42
Merge branch 'sprint-1.18' of https://github.com/0chain/gosdk into fe…
Hitenjain14 Oct 5, 2024
4d227ca
fix ut
Hitenjain14 Oct 5, 2024
07d6f35
fix lint
Hitenjain14 Oct 5, 2024
e36c5fe
fix list and stats ut
Hitenjain14 Oct 5, 2024
093c155
fix: fixed bugs
YarikRevich Oct 5, 2024
d2be487
fix wasm error
Hitenjain14 Oct 5, 2024
c27dddf
Merge branch 'feat/storage-v2' of https://github.com/0chain/gosdk int…
Hitenjain14 Oct 5, 2024
7864f21
use v2 as default
Hitenjain14 Oct 5, 2024
3de7460
Merge pull request #1632 from 0chain/fix/kms-roles
dabasov Oct 5, 2024
b85d7b7
Fix
Jayashsatolia403 Oct 5, 2024
bb92806
Merge pull request #1634 from 0chain/feat/storage-v2-blockchain
dabasov Oct 5, 2024
3221469
fetch alloc version from sharders
Hitenjain14 Oct 5, 2024
e70f07f
Merge branch 'feat/storage-v2' of https://github.com/0chain/gosdk int…
Hitenjain14 Oct 5, 2024
9a9c91c
Merge branch 'fix/refactor-zboxcore' into feature/multi-wallet
Jayashsatolia403 Oct 5, 2024
2d561b5
Setup auth
Jayashsatolia403 Oct 6, 2024
35127a7
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Oct 6, 2024
98606b3
Fix
Jayashsatolia403 Oct 6, 2024
58af8eb
add retries and update fasthttp
Hitenjain14 Oct 7, 2024
7804f61
Merge remote-tracking branch 'origin' into fix/upload-retries
Hitenjain14 Oct 7, 2024
ebf3c1f
Merge branch 'sprint-1.18' into feat/storage-v2
Hitenjain14 Oct 7, 2024
a09f65d
fix lint
Hitenjain14 Oct 7, 2024
47dcfd2
Merge branch 'feat/storage-v2' of https://github.com/0chain/gosdk int…
Hitenjain14 Oct 7, 2024
464d3ef
Return txn hash in send tokens
Jayashsatolia403 Oct 7, 2024
903957d
fix merge
Hitenjain14 Oct 7, 2024
616a0bd
Update blobber settings DelegateWallet
Jayashsatolia403 Oct 7, 2024
c2a51df
Populate client
Jayashsatolia403 Oct 8, 2024
671bffb
Populate client
Jayashsatolia403 Oct 8, 2024
079a9f3
Populate client
Jayashsatolia403 Oct 8, 2024
be698a5
add write chunk callback
Hitenjain14 Oct 9, 2024
06eb439
Fix get network
Jayashsatolia403 Oct 9, 2024
ed7e91a
Debug blobber failure
Jayashsatolia403 Oct 10, 2024
7f33c6c
Debug blobber failure
Jayashsatolia403 Oct 10, 2024
accf7f1
Revert "Debug blobber failure"
Jayashsatolia403 Oct 10, 2024
07da576
Merge pull request #1615 from 0chain/feat/storage-v2
dabasov Oct 13, 2024
b288d65
Merge storageV2 in "fix/refactor-zboxcore" (#1637)
Jayashsatolia403 Oct 13, 2024
01867b7
Merge remote-tracking branch 'origin/sprint-1.18' into fix/refactor-z…
Jayashsatolia403 Oct 13, 2024
8d9d162
Update version
Jayashsatolia403 Oct 13, 2024
40b069f
Fix
Jayashsatolia403 Oct 13, 2024
cb91e5a
Empty commit to trigger pipeline
Jayashsatolia403 Oct 13, 2024
62138bb
Fix
Jayashsatolia403 Oct 13, 2024
f1ea661
Fix
Jayashsatolia403 Oct 13, 2024
32652db
Debug
Jayashsatolia403 Oct 14, 2024
41d6553
Merge pull request #1636 from 0chain/feat/write-callback
dabasov Oct 14, 2024
4301b56
Merge pull request #1635 from 0chain/fix/upload-retries
dabasov Oct 14, 2024
bceb3f9
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Oct 14, 2024
6fec102
Merge pull request #1638 from 0chain/optimise/get-and-send
dabasov Oct 19, 2024
a88f07f
Fix get refs
Jayashsatolia403 Oct 19, 2024
ee202f9
Merge remote-tracking branch 'origin/fix/refactor-zboxcore' into fix/…
Jayashsatolia403 Oct 19, 2024
84e88a7
Merge branch 'fix/refactor-zboxcore' into feature/multi-wallet
Jayashsatolia403 Oct 19, 2024
24aad2c
Revert "Merge pull request #1638 from 0chain/optimise/get-and-send"
Jayashsatolia403 Oct 19, 2024
cfc93ce
Recover missing commits
Jayashsatolia403 Oct 19, 2024
690bd2f
add log for active blobbers
Hitenjain14 Oct 20, 2024
3595995
add error log for consensus thresh
Hitenjain14 Oct 20, 2024
e56a76b
remove change index
Hitenjain14 Oct 20, 2024
c91ab32
Fix dir worker
Jayashsatolia403 Oct 20, 2024
0054357
Fix
Jayashsatolia403 Oct 20, 2024
de2e7e1
Fix
Jayashsatolia403 Oct 20, 2024
02a4c88
change payload for path hash
Hitenjain14 Oct 21, 2024
3aec710
Merge pull request #1640 from 0chain/fix/blocks-name
dabasov Oct 21, 2024
7d3f4ee
Merge pull request #1639 from 0chain/fix/root-update
dabasov Oct 21, 2024
a6243f2
Keep miners count 3 at least
Jayashsatolia403 Oct 21, 2024
4cc4dd7
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
Jayashsatolia403 Oct 21, 2024
a291ddc
Merge branch 'fix/refactor-zboxcore' into feature/multi-wallet
Jayashsatolia403 Oct 21, 2024
49d82b8
Optimise send and get to miners and sharders
Jayashsatolia403 Oct 21, 2024
0380dcf
Merge branch 'fix/refactor-zboxcore' into optimise/send-and-get
Jayashsatolia403 Oct 21, 2024
388d225
Empty commit
Jayashsatolia403 Oct 21, 2024
3f28663
Merge remote-tracking branch 'origin/optimise/send-and-get' into opti…
Jayashsatolia403 Oct 21, 2024
b020597
Fix
Jayashsatolia403 Oct 21, 2024
a679e66
fix release buffer in upload
Hitenjain14 Oct 22, 2024
9b8ecd3
Merge pull request #1642 from 0chain/fix/buffer-release
dabasov Oct 22, 2024
2a06c04
Fix split key
Jayashsatolia403 Oct 22, 2024
354e002
Empty commit
Jayashsatolia403 Oct 22, 2024
845c4ac
Merge pull request #1619 from 0chain/feature/multi-wallet
dabasov Oct 22, 2024
c83ae85
Merge pull request #1641 from 0chain/optimise/send-and-get
dabasov Oct 22, 2024
500ce47
Merge pull request #1583 from 0chain/fix/refactor-zboxcore
dabasov Oct 22, 2024
653c149
added logging
dabasov Oct 22, 2024
cd8f385
Merge branch 'sprint-1.18' into fix/split-wallet
Jayashsatolia403 Oct 22, 2024
906c087
Fix
Jayashsatolia403 Oct 22, 2024
07a5cd2
Add verify signature functions
Jayashsatolia403 Oct 22, 2024
7af1667
Fix
Jayashsatolia403 Oct 22, 2024
f894a13
Merge pull request #1644 from 0chain/fix/add-verify-signature
dabasov Oct 22, 2024
92e0d41
Merge branch 'sprint-1.18' into fix/split-wallet
Jayashsatolia403 Oct 22, 2024
11dab86
Fix
Jayashsatolia403 Oct 22, 2024
f952c5f
change payload from path to lookuphash
Hitenjain14 Oct 23, 2024
a2d464b
update wasm exec to 1.22
Hitenjain14 Oct 23, 2024
cf8cc42
Merge pull request #1647 from 0chain/fix/path-payload
dabasov Oct 23, 2024
1037167
Merge pull request #1646 from 0chain/debug/0box-build
dabasov Oct 23, 2024
84dbfd5
Merge branch 'sprint-1.18' into fix/split-wallet
Jayashsatolia403 Oct 23, 2024
bcd693c
Fix
Jayashsatolia403 Oct 23, 2024
a2670fb
Fix
Jayashsatolia403 Oct 23, 2024
f99019a
Fix
Jayashsatolia403 Oct 23, 2024
8485a81
Fix
Jayashsatolia403 Oct 23, 2024
ba28e75
Fix
Jayashsatolia403 Oct 23, 2024
75d7434
Fix
Jayashsatolia403 Oct 23, 2024
ea1fc07
Fix
Jayashsatolia403 Oct 23, 2024
65b69f9
Optional verify txn
Jayashsatolia403 Oct 23, 2024
97c7405
Fix
Jayashsatolia403 Oct 23, 2024
c58af31
Log
Jayashsatolia403 Oct 23, 2024
8d5ec2f
Retry
Jayashsatolia403 Oct 23, 2024
d5bab14
Merge pull request #1643 from 0chain/fix/split-wallet
dabasov Oct 23, 2024
4d99ba6
Merge pull request #1648 from 0chain/fix/verifyTxn
dabasov Oct 23, 2024
2eea1d6
updated common
dabasov Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: 1.23

- name: Clean build
run: make clean-mobilesdk
Expand Down Expand Up @@ -96,10 +96,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: 1.23

- name: Install deps
run: |
Expand Down Expand Up @@ -199,10 +199,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: 1.23

- name: Clean build
run: make clean-mobilesdk
Expand Down Expand Up @@ -271,10 +271,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: 1.23

- name: Install deps
run: |
Expand Down Expand Up @@ -335,24 +335,24 @@ jobs:
name: Build-wasm
runs-on: [self-hosted, arc-runner]
steps:
- name: Set up Go 1.x
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.21.5
go-version: 1.23

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev wget

- name: Build
run: docker run --rm -v $PWD:/gosdk -w /gosdk golang:1.21.5 make wasm-build
run: docker run --rm -v $PWD:/gosdk -w /gosdk golang:1.23 make wasm-build

- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: zcn.wasm
path: zcn.wasm
path: zcn.wasm
2 changes: 1 addition & 1 deletion .github/workflows/system_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: 0chain/actions/.github/workflows/manual_system_tests.yml@master
with:
gosdk_branch: ${{ github.ref_name }}
repo_snapshots_branch: ${{ github.event.inputs.repo_snapshots_branch }}
repo_snapshots_branch: fix/refactor-zboxcore
test_file_filter: ${{ github.event.inputs.test_file_filter }}
skip_tests: ${{ github.event.inputs.skip_tests }}
run_smoke_tests: ${{ github.event.inputs.run_smoke_tests }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21.5
go-version: 1.22.0

- uses: actions/checkout@v3

Expand All @@ -51,7 +51,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21.5
go-version: 1.22.0

- name: Install deps
run: |
Expand Down Expand Up @@ -167,10 +167,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v3
- name: Set up Go 1.23
uses: actions/setup-go@v2
with:
go-version: 1.21.5
go-version: 1.23

- uses: actions/setup-node@v2
with:
Expand Down
13 changes: 13 additions & 0 deletions constants/signscheme.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package constants

type SignScheme string

const (
ED25519 SignScheme = "ed25519"
BLS0CHAIN SignScheme = "bls0chain"
)

func (s SignScheme) String() string {
return string(s)
}

3 changes: 2 additions & 1 deletion core/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package block

import (
"fmt"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/transaction"
)

const GET_BLOCK_INFO = `/v1/block/get?`

type Key []byte

type Header struct {
Expand Down
15 changes: 10 additions & 5 deletions core/node/cache.go → core/client/cache.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package node
package client

import (
"github.com/0chain/gosdk/core/logger"
"sync"
)

Expand Down Expand Up @@ -29,14 +30,18 @@ func (nc *NonceCache) GetNextNonce(clientId string) int64 {
nc.guard.Lock()
defer nc.guard.Unlock()
if _, ok := nc.cache[clientId]; !ok {
nonce, _, err := nc.sharders.GetNonceFromSharders(clientId)
if err != nil {
nonce = 0
bal, err := GetBalance(clientId)
if err != nil || bal == nil {
nc.cache[clientId] = 0
} else {
nc.cache[clientId] = bal.Nonce
}
nc.cache[clientId] = nonce
}

nc.cache[clientId] += 1

logger.Log.Info("GetNextNonce", "clientId", clientId, "nonce", nc.cache[clientId])

return nc.cache[clientId]
}

Expand Down
184 changes: 184 additions & 0 deletions core/client/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
package client

import (
"encoding/json"
"fmt"
"github.com/0chain/errors"
"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk/core/util"
"github.com/shopspring/decimal"
"net/http"
"net/url"
"sync"
)

// SCRestAPIHandler is a function type to handle the response from the SC Rest API
//
// `response` - the response from the SC Rest API
// `numSharders` - the number of sharders that responded
// `err` - the error if any
type SCRestAPIHandler func(response map[string][]byte, numSharders int, err error)

func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) ([]byte, error) {
const (
consensusThresh = float32(25.0)
ScRestApiUrl = "v1/screst/"
)

restApiUrl := ScRestApiUrl
if len(restApiUrls) > 0 {
restApiUrl = restApiUrls[0]
}

sharders := nodeClient.Network().Sharders
responses := make(map[int]int)
entityResult := make(map[string][]byte)

var (
retObj []byte
maxCount int
dominant = 200
wg sync.WaitGroup
mu sync.Mutex // Mutex to protect shared resources
)

cfg, err := conf.GetClientConfig()
if err != nil {
return nil, err
}

for _, sharder := range sharders {
wg.Add(1)
go func(sharder string) {
defer wg.Done()

urlString := fmt.Sprintf("%v/%v%v%v", sharder, restApiUrl, scAddress, relativePath)
urlObj, err := url.Parse(urlString)
if err != nil {
fmt.Println(err.Error())
return
}
q := urlObj.Query()
for k, v := range params {
q.Add(k, v)
}
urlObj.RawQuery = q.Encode()

req, err := util.NewHTTPGetRequest(urlObj.String())
if err != nil {
fmt.Println("1Error creating request", err.Error())
return
}

response, err := req.Get()
if err != nil {
fmt.Println("2Error getting response", err.Error())
return
}

mu.Lock() // Lock before updating shared maps
defer mu.Unlock()

if response.StatusCode > http.StatusBadRequest {
nodeClient.sharders.Fail(sharder)
} else {
nodeClient.sharders.Success(sharder)
}

responses[response.StatusCode]++
if responses[response.StatusCode] > maxCount {
maxCount = responses[response.StatusCode]
}

if isCurrentDominantStatus(response.StatusCode, responses, maxCount) {
dominant = response.StatusCode
retObj = []byte(response.Body)
}

entityResult[sharder] = []byte(response.Body)
nodeClient.sharders.Success(sharder)
}(sharder)
}

wg.Wait()

rate := float32(maxCount*100) / float32(cfg.SharderConsensous)
if rate < consensusThresh {
err = errors.New("consensus_failed", "consensus failed on sharders")
}

if dominant != 200 {
var objmap map[string]json.RawMessage
err := json.Unmarshal(retObj, &objmap)
if err != nil {
return nil, errors.New("", string(retObj))
}

var parsed string
err = json.Unmarshal(objmap["error"], &parsed)
if err != nil || parsed == "" {
return nil, errors.New("", string(retObj))
}

return nil, errors.New("", parsed)
}

if rate > consensusThresh {
return retObj, nil
}
return nil, err
}

// isCurrentDominantStatus determines whether the current response status is the dominant status among responses.
//
// The dominant status is where the response status is counted the most.
// On tie-breakers, 200 will be selected if included.
//
// Function assumes runningTotalPerStatus can be accessed safely concurrently.
func isCurrentDominantStatus(respStatus int, currentTotalPerStatus map[int]int, currentMax int) bool {
// mark status as dominant if
// - running total for status is the max and response is 200 or
// - running total for status is the max and count for 200 is lower
return currentTotalPerStatus[respStatus] == currentMax && (respStatus == 200 || currentTotalPerStatus[200] < currentMax)
}

func GetBalance(clientIDs ...string) (*GetBalanceResponse, error) {
const GetBalance = "client/get/balance"
var (
balance GetBalanceResponse
err error
res []byte
)

var clientID string
if len(clientIDs) > 0 {
clientID = clientIDs[0]
} else {
clientID = Id()
}

if res, err = MakeSCRestAPICall("", GetBalance, map[string]string{
"client_id": clientID,
}, "v1/"); err != nil {
return nil, err
}

if err = json.Unmarshal(res, &balance); err != nil {
return nil, err
}

return &balance, nil
}

type GetBalanceResponse struct {
Txn string `json:"txn"`
Round int64 `json:"round"`
Balance int64 `json:"balance"`
Nonce int64 `json:"nonce"`
}

// ToToken converts Balance to ZCN tokens.
func (b GetBalanceResponse) ToToken() (float64, error) {
f, _ := decimal.New(b.Balance, -10).Float64()
return f, nil
}
Loading
Loading