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

Closed
wants to merge 399 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
399 commits
Select commit Hold shift + click to select a range
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
bd88283
increase rollback retries
Hitenjain14 Oct 26, 2024
0b23865
Merge branch 'sprint-1.18' into fix/rollback-retries
Hitenjain14 Oct 26, 2024
875f6c1
log base url
Hitenjain14 Oct 27, 2024
083f0cb
Merge branch 'fix/rollback-retries' of https://github.com/0chain/gosd…
Hitenjain14 Oct 27, 2024
224d652
add session key
Hitenjain14 Oct 27, 2024
6a7dea0
Merge pull request #1652 from 0chain/fix/rollback-retries
dabasov Oct 27, 2024
381ff67
Merge branch 'sprint-1.18' into feat/session-key
Hitenjain14 Oct 28, 2024
c1e6880
same session key for wallet
Hitenjain14 Oct 28, 2024
eccb82c
add pk in create allocation request
Hitenjain14 Oct 28, 2024
0919d0f
Merge pull request #1653 from 0chain/feat/session-key
dabasov Oct 28, 2024
f039417
Added owner signin public key
Jayashsatolia403 Oct 28, 2024
82a3092
Merge branch 'sprint-1.18' into feat/session-key
Jayashsatolia403 Oct 28, 2024
58494d4
Revert "Session key"
Hitenjain14 Oct 28, 2024
a02b652
Merge pull request #1655 from 0chain/revert-1653-feat/session-key
dabasov Oct 28, 2024
8430cbb
Fix send transaction
Jayashsatolia403 Oct 29, 2024
164234c
add signing logs
Hitenjain14 Oct 30, 2024
fb7c3b7
Fix send transaction
Jayashsatolia403 Oct 30, 2024
e6a71c5
Merge branch 'sprint-1.18' into fix/send-txn
Jayashsatolia403 Oct 30, 2024
13680c0
log error
Hitenjain14 Oct 30, 2024
a32db36
log hash and id
Hitenjain14 Oct 30, 2024
46e80a2
use get allocation for update
Hitenjain14 Oct 30, 2024
53a1aa0
Fix
Jayashsatolia403 Oct 30, 2024
884c1aa
Merge remote-tracking branch 'origin/feat/session-key' into feat/sess…
Jayashsatolia403 Oct 30, 2024
6daa7a9
Merge remote-tracking branch 'origin/fix/send-txn' into feat/session-key
Jayashsatolia403 Oct 30, 2024
b57aa39
Fix
Jayashsatolia403 Oct 30, 2024
72f15c4
Fix config max txn query
Jayashsatolia403 Oct 30, 2024
8e193a0
Fix config max txn query
Jayashsatolia403 Oct 30, 2024
3399b4d
Fix config max txn query
Jayashsatolia403 Oct 30, 2024
8fd2d07
reverted changes to transaction execution logic
dabasov Oct 31, 2024
3992e5a
updated gosdk
dabasov Oct 31, 2024
0679081
only set pub signing key when pub key is same
Hitenjain14 Oct 31, 2024
6d2b980
Fix query sleep time
Jayashsatolia403 Nov 1, 2024
009c24e
Fix txn split key
Jayashsatolia403 Nov 1, 2024
8bd60c3
fix: added split key mode check
YarikRevich Nov 1, 2024
4e3ef60
Revert "reverted changes to transaction execution logic"
Jayashsatolia403 Nov 1, 2024
f6160cb
Fix logging
Jayashsatolia403 Nov 1, 2024
7269fb8
Merge pull request #1654 from 0chain/feat/session-key
dabasov Nov 1, 2024
e73e12a
Merge branch 'sprint-1.18' into fix/txn-split-key
Jayashsatolia403 Nov 1, 2024
551d7b2
fix: debug
YarikRevich Nov 2, 2024
c71cfe9
Merge branch 'fix/txn-split-key' of github.com:0chain/gosdk into fix/…
YarikRevich Nov 2, 2024
a8bf594
fix: debug
YarikRevich Nov 2, 2024
466d9c6
fix: debug
YarikRevich Nov 2, 2024
8869736
fix: debug
YarikRevich Nov 2, 2024
8145093
fix: debug
YarikRevich Nov 2, 2024
a7f5bb0
fix: debug
YarikRevich Nov 2, 2024
45d3636
fix: debug
YarikRevich Nov 2, 2024
f3e4ae8
fix: fixed bugs
YarikRevich Nov 2, 2024
891ea4a
fix: fixed bugs
YarikRevich Nov 2, 2024
52c1005
fix: fixed bugs
YarikRevich Nov 2, 2024
5e66d11
Add storage node version update txn
Jayashsatolia403 Nov 2, 2024
0db2aea
fix: fixed bugs
YarikRevich Nov 2, 2024
e0ce67b
fix: debug
YarikRevich Nov 2, 2024
9c92d4d
Added insert killed ID
Jayashsatolia403 Nov 2, 2024
9591233
fix: debug
YarikRevich Nov 3, 2024
d2340e5
fix: debug
YarikRevich Nov 3, 2024
0ae69ed
fix: debug
YarikRevich Nov 3, 2024
1758837
fix: fixed bugs
YarikRevich Nov 3, 2024
577e893
add err check in repair
Hitenjain14 Nov 4, 2024
304a4f8
Merge branch 'sprint-1.18' into fix/txn-split-key
Jayashsatolia403 Nov 4, 2024
271db06
Merge pull request #1662 from 0chain/fix/repairerr-check
dabasov Nov 4, 2024
7e5f365
Merge branch 'sprint-1.18' into fix/txn-split-key
YarikRevich Nov 4, 2024
01de195
Fix make sc rest api calls
Jayashsatolia403 Nov 4, 2024
cbbeeb8
Merge pull request #1659 from 0chain/fix/txn-split-key
dabasov Nov 5, 2024
df6ff8d
set lookuphash if empty
Hitenjain14 Nov 6, 2024
8c3952c
add storage version in list
Hitenjain14 Nov 7, 2024
5217a55
Feature: add method to set wallet mode in WASM (#1666)
YarikRevich Nov 7, 2024
daee72e
Merge branch 'sprint-1.18' into feat/storageversion-list
Hitenjain14 Nov 8, 2024
1140e00
fix: added additional check (#1667)
YarikRevich Nov 9, 2024
39ea5b9
use alloc txn
Hitenjain14 Nov 10, 2024
833564a
Merge pull request #1668 from 0chain/fix/version-rollback
dabasov Nov 10, 2024
0a5c660
set size for root
Hitenjain14 Nov 10, 2024
fbcf0c6
remove v1 sig in upload request
Hitenjain14 Nov 10, 2024
939d524
Merge pull request #1669 from 0chain/feat/root-size
dabasov Nov 10, 2024
4f364de
update common pacakge
Hitenjain14 Nov 12, 2024
c47be59
Merge pull request #1670 from 0chain/update/common
dabasov Nov 12, 2024
7f879ce
Merge pull request #1665 from 0chain/feat/storageversion-list
dabasov Nov 12, 2024
6873e3e
Merge branch 'sprint-1.18' into fix/set-lookuphash
Hitenjain14 Nov 13, 2024
74e9700
Merge pull request #1663 from 0chain/fix/set-lookuphash
dabasov Nov 13, 2024
8cf79f5
Merge branch 'staging' into sprint-1.18
dabasov Nov 13, 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
186 changes: 186 additions & 0 deletions core/client/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
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"
"log"
"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.sharders.Healthy()
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 {
log.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 {
log.Println("Error creating request", err.Error())
return
}

response, err := req.Get()
if err != nil {
nodeClient.sharders.Fail(sharder)
log.Println("Error 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