Skip to content

Commit

Permalink
Sprint 1.11 (#1303)
Browse files Browse the repository at this point in the history
* feature: added more test cases

* fix: fixed existing test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added more test cases

* feature: added more test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added mocks

* fix: fixed bugs

* fix: fixed mocks

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: made components internal

* Add webstreaming to multiupload (#1190)

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* fix dup upload consensus (#1195)

* Fix multiupload completed callback (#1172)

* remove unnecessary print

* fix delete and createdir

* return major error

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* cleanup

* fix completed callback

* Feat/update methods in WinSDK (#1198)

* delete dir in repair (#1196)

* delete dir in repair

* replace ioutil

* fix unit test

* fix list worker test

* fix rename dir error

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* Add NFT Config contract (#1212)

* Silent the zcnbridge http request when --silent (#1207)

* Change the return type of downloadBlocks to []byte in wasm (#1218)

* change the order of exchanges to get the ZCN prices (#1216)

* Deprecate non multi-operation functions (#1214)

* remove CreateDir, Rename, Copy, Move

* use docker build wasm

* use @v4 version of git action

* Revert "use @v4 version of git action"

This reverts commit fbb93f2.

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

* remove path header, fix ws tag (#1220)

* Feature/ Challenge based on rounds (#1191)

* Fix

* Fix

* Fix

* Fix

* Fix

* Debug

* Debug

* Debug

* Fix

* Heavy logging

* Fix

* More logging

* Changed logging

* Removed logging

* Debug

* Fix

* Fix

* Fix

* expose send in wasm (#1225)

* fix rename dir err (#1226)

* Txnfee send (#1227)

* add txnfee for send function

* return txn verify output

* add rename dir (#1230)

* Async read (#1213)

* basic timings for download

* upload timings

* to seconds

* more timings for upload processing

* display ms properly

* cleanup

* fix merge

* fix merge

* add more timing logs

* fix dur to ms

* add timings to read and build data

* async read

* range over errChan

* fix unit test

* rmv ctx cancel from multi upload

* wait for last chunk

* fix loop

* rmv readChunk timing

* increase buffer size

* rmv timing logs

* cleanup

* updated go to version 1.20

* use -buildvcs=false

---------

Co-authored-by: din-mukhammed <dimash.r53@gmail.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: shahnawaz-creator <msac8225@gmail.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>

* Wasm for `move`, `rename`, `copy` (#1233)

* add demo for move, rename and copy

* remove debug logs

---------

Co-authored-by: Yury <yuderbasov@gmail.com>

* Feat/streaming server in winsdk (#1228)

* fix move when srcPath is same as destPath (#1239)

* fix(upload):fixed invalid ffmpeg command in transcode feature (#1236)

* fix(upload):fixed invalid ffmpeg command in transcode feature

* fix(upload): always delete transcode output file

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(upload): fixed HideWindow issue

* fix(devops): fixed build-windows

* fix(mobilesdk): add logging for MultiUpload

* fix(mobilesdk): fixed file permission issue on transcode

* fixed lint error

---------

Co-authored-by: dabasov <yuderbasov@gmail.com>

* Fix web streaming - wasm (#1237)

* Do not send GET http request with body

* Use downloadBlocks to download in player_file

* Call ListDir to get file meta

* Format

* Download 100 blocks each time by default

* Fix downloadBlocks

Track the downloaded bytes and trunk the padding 0 bytes

* Update downloadBlocks to download blocks concurretly

Use the same download method with downloadFileByBlocks

* Add ActualFileSize in PlayListFile

* Update wasm_exec.js to go 1.21.0

* Update version

* Replace alloc.DownloadBlocks with DownloadBlocksToFileHandler

* Add concurrency control (#1245)

* control file ops concurrency

* cleanup

* add batch size to multi op

* Fix/stream tests (#1247)

* fix(upload): fixed file name issue in webstreaming

* removed unused code

* fix share consensus (#1246)

* List optimization (#1240)

* list optimization

* list optimization

* fix list hash

* add to wg

* fix list test

* check consensus

* fix listDir test

* use once for mock calls

* added sharders keep list (#1231)

* added sharders keep list

* added holder to zboxcore

* removed duplicated sharder call

* fixed lint

* fixed panic

* fixed panic

* fixed panic

* fixed panic

* fixed panic

* added consensus

* added consensus

* added consensus

* refactored

* refactored

* refactored

* chec alloc and prev alloc root (#1250)

* add check for chunkNumber (#1253)

* add check for chunkNumber

* add err log

* fix save progress

* split-key handler implemented in wasm sdk

* chnaging go version for cdn

* bumped version

* minor refactoring

* bumping  wasm_exec.js  version

* Refactoring unnecessary structs

* create new conID (#1256)

* debugging consoles added

* fix statusbar update (#1257)

* lint fixes

* lint ignore

* nolint: unused added

* use httpdo for create connection (#1259)

* Add create dir in repair (#1262)

* fix delete dir err in cb

* add way to create dir in repair

* add desc for transaction data (#1263)

* Feature: provide audit zcnswap and refactor if needed (#1205)

* feature: modifies zcnswap to be consitent with zcnbridge

* fix: fixed bugs

* fix: removed dead code

* feature: extended key store logic

* fix: fixed bugs

* fix: fixed conflicts

* fix: removed dead code

* fix: fixed bugs

* Fix/remove path (#1221)

* feature: added more test cases

* fix: fixed existing test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added more test cases

* feature: added more test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added mocks

* fix: fixed bugs

* fix: fixed mocks

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: made components internal

* Add webstreaming to multiupload (#1190)

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* fix dup upload consensus (#1195)

* Fix multiupload completed callback (#1172)

* remove unnecessary print

* fix delete and createdir

* return major error

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* cleanup

* fix completed callback

* Feat/update methods in WinSDK (#1198)

* delete dir in repair (#1196)

* delete dir in repair

* replace ioutil

* fix unit test

* fix list worker test

* fix rename dir error

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* Add NFT Config contract (#1212)

* Silent the zcnbridge http request when --silent (#1207)

* Change the return type of downloadBlocks to []byte in wasm (#1218)

* change the order of exchanges to get the ZCN prices (#1216)

* Deprecate non multi-operation functions (#1214)

* remove CreateDir, Rename, Copy, Move

* use docker build wasm

* use @v4 version of git action

* Revert "use @v4 version of git action"

This reverts commit fbb93f2.

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

* remove path header, fix ws tag

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Revert "Fix/remove path (#1221)" (#1222)

This reverts commit 464260a.

* remove path header, fix ws tag (#1223)

* remove path header, fix ws tag

* fixed broken build

---------

Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

(cherry picked from commit 1c9f143)

* fix

* updated wasm binary build fix.

* feature: added test case for swap logic

* fix: resolved dependency conflicts

* fix: fixed bugs

* feature: added zcn eth rate fetch logic

* Update blobber.go

* Update authorizers_query.go

* feature: replaced confusing param naming

* fix: updated bridge initialization in wasm bridge integration

* fix: replaced value amount with correct value

* fix: wrong test case values

* feature: switch to the usage of zcn token smart contract

* fix: fixed bridge tests

---------

Co-authored-by: Yaroslav Svitlytskyi <yaroslavsvitlytskyi@Yaroslavs-MacBook-Pro.local>
Co-authored-by: Yury <yuderbasov@gmail.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>
Co-authored-by: shahnawaz-creator <msac8225@gmail.com>

* Feat/exposed cli methods in winsdk (#1248)

* feat(winsdk): added CreateWallet

* feat(winsdk): added RecoverWallet

* feat(winsdk): added logging in CreateWallet and RecoverWallet

* feat(winsdk): split InitSDK into InitZCNSDK and InitWallets

* feat(winsdk): fixed zboxApiClient initialization issue

* feat(winsdk): renamed init sdks

* feat(winsdk): fixed init zboxApiClient issue

* fix(winsdk): fixed RecoverWallet naming

* fix(winsdk): fixed file name issue in GetUploadStatus for transcode feature

* feat(winsdk): added GetFileContentType in winsdk

* feat(winsdk): added ListAllocations

* feat(winsdk): added CreateFreeAllocation

* feat(winsdk): added allocation methods

* fix(winsdk): added logs

* feat(zboxapi): added GetFreeStorage

* feat(zboxapi): also send X-App-ID-Token in header

* fix(winsdk): skip TestGetFreeStorage

* fix(winsdk): added getAllocationWith

* fix(zboxapi): used local signHash instead of sys.SignFunc

* fix(zboxapi): fixed token issue in GetFreeStorage

* fix(list): exported ThumbnailHash and ThumbnailSize in ListResult

* fix(0box): fixed GetFreeStorage/CreateFreeAllocation

* fix(winsdk): renamed jwtToken with token in CreateFreeAllocation

* fix(winsdk): renamed jwtToken with token in CreateFreeAllocation

* feat(winsdk): added GetFreeMarker

* feat(winsdk): added AddSharedInfo/DeleteSharedInfo/GetSharedToMe/GetSharedByMe

* feat(winsdk): added CreateAuthTicket/DeleteAuthTicket

* feat(winsdk): fixed GetSharedToMe/GetSharedByMe

* feat(winsdk): fixed GetSharedToMe/GetSharedByMe

* feat(winsdk): exported CreateAuthTicket/DeleteAuthTicket/CreateSharedInfo/DeleteSharedInfo/GetSharedByMe/GetSharedByPublic/GetSharedToMe

* Fix/fail shardedr on bad code (#1264)

* Fix/remove path (#1221)

* feature: added more test cases

* fix: fixed existing test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added more test cases

* feature: added more test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added mocks

* fix: fixed bugs

* fix: fixed mocks

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: made components internal

* Add webstreaming to multiupload (#1190)

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* fix dup upload consensus (#1195)

* Fix multiupload completed callback (#1172)

* remove unnecessary print

* fix delete and createdir

* return major error

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* cleanup

* fix completed callback

* Feat/update methods in WinSDK (#1198)

* delete dir in repair (#1196)

* delete dir in repair

* replace ioutil

* fix unit test

* fix list worker test

* fix rename dir error

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* Add NFT Config contract (#1212)

* Silent the zcnbridge http request when --silent (#1207)

* Change the return type of downloadBlocks to []byte in wasm (#1218)

* change the order of exchanges to get the ZCN prices (#1216)

* Deprecate non multi-operation functions (#1214)

* remove CreateDir, Rename, Copy, Move

* use docker build wasm

* use @v4 version of git action

* Revert "use @v4 version of git action"

This reverts commit fbb93f2.

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

* remove path header, fix ws tag

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Revert "Fix/remove path (#1221)" (#1222)

This reverts commit 464260a.

* remove path header, fix ws tag (#1223)

* remove path header, fix ws tag

* fixed broken build

---------

Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

(cherry picked from commit 1c9f143)

* updated wasm binary build fix.

* README grammar and formatting tweaks.

* Merge remote-tracking branch 'origin/feature/sharder-keep-list' into feature/sharder-keep-list

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>
Co-authored-by: shahnawaz-creator <msac8225@gmail.com>
Co-authored-by: UncertainBadg3r <139782199+UncertainBadg3r@users.noreply.github.com>

* Fix/roll logs (#1266)

* Added lumberjack logger

* Added lumberjack logger

* fix:download file/thumbnail by authticket in winsdk (#1265)

* feat(winsdk): added GetWalletBalance (#1267)

* enabled gosdk update for sprint branches (#1268)

* Revert "enabled gosdk update for sprint branches (#1268)" (#1269)

This reverts commit 201b8bd.

* fix in progress callback (#1270)

* Cleanup update terms from update allocation (#1274)

* Improve download performance (#1271)

* improve download performance

* add read buffer size

* add hash option

* fix lint test

* set default to true

* log for data

* fix read

* feature: add reset nonce for bridge (#1279)

* Add registerAuthorizer to wasm (#1275)

* Hotfix/parse hostname error (#1241)

* Fix/remove path (#1221)

* feature: added more test cases

* fix: fixed existing test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added more test cases

* feature: added more test cases

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* feature: added mocks

* fix: fixed bugs

* fix: fixed mocks

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: made components internal

* Add webstreaming to multiupload (#1190)

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* fix dup upload consensus (#1195)

* Fix multiupload completed callback (#1172)

* remove unnecessary print

* fix delete and createdir

* return major error

* add webstreaming

* fix typos

* add webstreaming to wasm multiupload

* fix typo

* cleanup

* fix completed callback

* Feat/update methods in WinSDK (#1198)

* delete dir in repair (#1196)

* delete dir in repair

* replace ioutil

* fix unit test

* fix list worker test

* fix rename dir error

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* Add NFT Config contract (#1212)

* Silent the zcnbridge http request when --silent (#1207)

* Change the return type of downloadBlocks to []byte in wasm (#1218)

* change the order of exchanges to get the ZCN prices (#1216)

* Deprecate non multi-operation functions (#1214)

* remove CreateDir, Rename, Copy, Move

* use docker build wasm

* use @v4 version of git action

* Revert "use @v4 version of git action"

This reverts commit fbb93f2.

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

* remove path header, fix ws tag

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Revert "Fix/remove path (#1221)" (#1222)

This reverts commit 464260a.

* remove path header, fix ws tag

* remove path header, fix ws tag (#1223)

* remove path header, fix ws tag

* fixed broken build

---------

Co-authored-by: din-mukhammed <dimash.r53@gmail.com>

* Updated self hosted macos runner (#1219)

* Updated self hosted macos runner

* fixed runner name build-sdks.yml

(cherry picked from commit 1c9f143)

* added logging

* updated wasm binary build fix.

* updated wasm binary build fix.

(cherry picked from commit 2571888)

* README grammar and formatting tweaks.

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: Manohar Reddy <b.manu199@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>
Co-authored-by: shahnawaz-creator <msac8225@gmail.com>
Co-authored-by: UncertainBadg3r <139782199+UncertainBadg3r@users.noreply.github.com>
Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com>

* Adding RegisterAuthorizer method in wasmsdk (#1273)

* Adding RegisterAuthorizer method in wasmsdk

* Fix:wasm test fail

* Adding demo for RegisterAuthorizer handler in wasm

* Js and Go bridge implementation

* RegisterAuthorizer handler changes and adding Async Js bridge

* golangci-lint fixes

* Added error handling in setSplitKey and setAuthURL

* Refactoring wasm exposed handlers

* Setting split key wallet before setting auth url in setAuthURL's demo

* Lint Fixes after resolving conflicts

* upload optimization (#1281)

* add sha256 simd and blake3

* add hash chan

* fix lint and unit test

* fix MHash

* rmv timing log

* fix thumbnail hash

* added logging

* added logging

* hotfix

* hotfix

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* experiment

* Sprint 1.11 revert (#1284)

* Revert "experiment"

This reverts commit 050270f.

* Revert "experiment"

This reverts commit d4821f8.

* Revert "experiment"

This reverts commit 9f65b2e.

* Revert "experiment"

This reverts commit 6313cb8.

* Revert "experiment"

This reverts commit b6be0b5.

* Revert "experiment"

This reverts commit 68d4190.

* Revert "experiment"

This reverts commit 3a23f3f.

* Revert "experiment"

This reverts commit 6b6578b.

* Revert "experiment"

This reverts commit 65a0152.

* Revert "experiment"

This reverts commit 6834b05.

* Revert "experiment"

This reverts commit 8446894.

* Revert "hotfix"

This reverts commit 48cf793.

* Revert "hotfix"

This reverts commit 895c7f0.

* Revert "added logging"

This reverts commit fafce3c.

* Revert "added logging"

This reverts commit 10b6a4a.

* rmv channel hasher (#1285)

* Fix submit txn (#1287)

* Feature: add BNT, USDC and EURC tokens for Swap (#1277)

* feature: add multiple token support for swap

* feature: add correct Bancor API calls

* feature: added approve for swap of bancor token

* fix: removed debug lines

* fix: fixed swap approval

* fix: fixed bug

* fix: fixed bugs

* change hasher (#1288)

* change hasher

* set max proc to 1

* set batch size to 2

* revert hasher lib changes

* increase batch size to 4

* set batch size to 2

* fix build

* update chunk reader

* run gc

* add sleep and decrease batch size

* change blake3

* fix operation slice

* fix batch size

* increase sleep time

* add memory pool

* increase swg for wasm

* reuse chunk reader

* fix read chunk

* rmv unused package

* Remove sleep and GOMAXPROCS=1

* Increase batch size a little

---------

Co-authored-by: peterlimg <peterlimg@protonmail.com>

* Import eth wallet with index (#1292)

* Add import account address index

* Make it optional

* Feat/import-account-idx (#1294)

* Add import account address index

* Make it optional

* Add account index option

* Add account bip32 option (#1295)

* Fix allocation min lock (#1297)

* create PRs to dependent repos when a PR is merged to sprint branches (#1283)

* create PRs to dependent repos when a PR is merged to sprint branches

* add branch name

* move wasm-build to build-sdk.yml

* cleanup sdk-release.yml

* Removed padding from the CryptoJS Encrypt and Decrypt functions functions. (#1300)

Co-authored-by: Manohar Reddy <b.manu199@gmail.com>

* Fix allocation min lock

* change chunkNumber for wasm (#1304)

* change numBlock for wasm

* change numBlocks

* revert sdk changes

* Feature: implement fork per run strategy (#1299)

* feature: added fork creation

* fix: fixed bug

* feature: improved Tenderly fork creation flow

* fix parse error (#1309)

* fix parse error

* fix log

* add swg

* Fix memory usage (#1311)

* fix memory usage

* change hasher to sha2 256

* fix unit test

* increase numBlocks

* fix thumbnail hash

* Fix iso header (#1314)

* add ISO check

* remove filename field from authticket

* fix typo

* log auth token

* cleanup

* Fix zboxcore min submit (#1315)

* Fix zboxcore min submit

* Fix min submit and min confirmation default configs

* Fix unit tests

* Fix unit tests

* Revert "Fix iso header (#1314)" (#1317)

This reverts commit 218d3ed.

* Add upload for empty file (#1316)

* add upload for empty file

* fix hash

* check ref

* fix actual size

* fix empty upload (#1320)

* fix read auth ticket (#1319)

* allocation validation for data parity shards (#1321)

* fix git action to raise PRs to update gosdk (#1313)

* test gosdk update

* test-gosdk-update

* use binary operators instead of terinary

* use github.ref

* use github ref

* add branch name

* use quotes

* prepare for PR

* test work flow dispatch

* test extract branch

* print env

* prepare for PR

* feature: added custom block number during Tenderly fork creation (#1323)

* Fix/retry tx on nonce error (#1322)

* Revert "experiment"

This reverts commit 050270f.

* Revert "experiment"

This reverts commit d4821f8.

* Revert "experiment"

This reverts commit 9f65b2e.

* Revert "experiment"

This reverts commit 6313cb8.

* Revert "experiment"

This reverts commit b6be0b5.

* Revert "experiment"

This reverts commit 68d4190.

* Revert "experiment"

This reverts commit 3a23f3f.

* Revert "experiment"

This reverts commit 6b6578b.

* Revert "experiment"

This reverts commit 65a0152.

* Revert "experiment"

This reverts commit 6834b05.

* Revert "experiment"

This reverts commit 8446894.

* Revert "hotfix"

This reverts commit 48cf793.

* Revert "hotfix"

This reverts commit 895c7f0.

* Revert "added logging"

This reverts commit fafce3c.

* Revert "added logging"

This reverts commit 10b6a4a.

* retry failed transaction in zbox with nonce error

* Fix wm rollback (#1324)

* fix wm rollback

* fix rb check

* version logs

* fix prev version

* cleanup

* Cleanup free storage update allocation (#1325)

* remove batch size (#1327)

* fix retry op callback (#1329)

* Revert "remove batch size (#1327)" (#1328)

This reverts commit 310edbb.

* Add `force` param for getAllocationBlobbers wasm (#1330)

* fix retry callback (#1331)

* Fix fill panic (#1334)

* fix fill shards panic

* add log for fill err

---------

Co-authored-by: YarikRevich <yariksvitlitskiy2@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <53532703+YarikRevich@users.noreply.github.com>
Co-authored-by: Dinmukhammed Kambarov <52813950+din-mukhammed@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Lz <imlangzi@qq.com>
Co-authored-by: Yaroslav Svitlytskyi <yariksvitlitskiy81@gmail.com>
Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com>
Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com>
Co-authored-by: din-mukhammed <dimash.r53@gmail.com>
Co-authored-by: shahnawaz-creator <msac8225@gmail.com>
Co-authored-by: Yury <yuderbasov@gmail.com>
Co-authored-by: Ash-KODES <choudharykumarashutosh1209@gmail.com>
Co-authored-by: Yaroslav Svitlytskyi <yaroslavsvitlytskyi@Yaroslavs-MacBook-Pro.local>
Co-authored-by: UncertainBadg3r <139782199+UncertainBadg3r@users.noreply.github.com>
Co-authored-by: peterlimg <peterlimg@protonmail.com>
Co-authored-by: Tanishq Gupta <52757132+tanishq67@users.noreply.github.com>
Co-authored-by: Jayash Satolia <jayash.satolia.min19@iitbhu.ac.in>
Co-authored-by: GuruHubb <sbasu999@gmail.com>
  • Loading branch information
21 people committed Dec 19, 2023
1 parent eee25f9 commit 1a22937
Show file tree
Hide file tree
Showing 190 changed files with 15,301 additions and 9,827 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/build-sdks.yml
Expand Up @@ -62,10 +62,10 @@ jobs:
echo "::set-output name=RELEASE::false"
echo "::set-output name=TAG::none"
elif [[ ${tag} = v*\.*\.* ]] ; then
echo "> 0Chain: trigger from git event"
# upload output on release
echo "::set-output name=RELEASE::true"
echo "::set-output name=TAG::${tag}"
Expand Down Expand Up @@ -159,17 +159,17 @@ jobs:
run: |
tag=$(echo ${GITHUB_REF#refs/tags/})
echo ${tag}
if [[ "${{github.event_name}}" = "workflow_dispatch" ]]; then
echo "> 0Chain: trigger from workflow_dispatch"
echo "::set-output name=RELEASE::false"
echo "::set-output name=TAG::none"
elif [[ ${tag} = v*\.*\.* ]] ; then
echo "> 0Chain: trigger from git event"
# upload output on release
echo "::set-output name=RELEASE::true"
echo "::set-output name=TAG::${tag}"
Expand Down Expand Up @@ -237,10 +237,10 @@ jobs:
echo "::set-output name=RELEASE::false"
echo "::set-output name=TAG::none"
elif [[ ${tag} = v*\.*\.* ]] ; then
echo "> 0Chain: trigger from git event"
# upload output on release
echo "::set-output name=RELEASE::true"
echo "::set-output name=TAG::${tag}"
Expand All @@ -263,7 +263,6 @@ jobs:
path: |
zcncore-macos.tar.gz
build-windows:
name: Build-windows
runs-on: [self-hosted, arc-runner]
Expand Down Expand Up @@ -306,10 +305,10 @@ jobs:
echo "::set-output name=RELEASE::false"
echo "::set-output name=TAG::none"
elif [[ ${tag} = v*\.*\.* ]] ; then
echo "> 0Chain: trigger from git event"
# upload output on release
echo "::set-output name=RELEASE::true"
echo "::set-output name=TAG::${tag}"
Expand All @@ -331,3 +330,29 @@ jobs:
name: zcn-windows
path: |
zcn-windows.zip
build-wasm:
name: Build-wasm
runs-on: [self-hosted, arc-runner]
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: ^1.20

- name: Checkout
uses: actions/checkout@v2

- 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.20 make wasm-build

- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: zcn.wasm
path: zcn.wasm
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.18
go-version: ^1.20

- name: Checkout repository
uses: actions/checkout@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/system_tests.yml
Expand Up @@ -45,11 +45,10 @@ jobs:
DEV8KC: ${{ secrets.DEV8KC }}
DEV9KC: ${{ secrets.DEV9KC }}
SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }}
TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }}
TENDERLY_SECRET: ${{ secrets.TENDERLY_SECRET }}
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}
GRAPHNODE_SC: ${{ secrets.GRAPHNODE_SC }}
GRAPHNODE_NETWORK: ${{ secrets.GRAPHNODE_NETWORK }}
GRAPHNODE_ETHEREUM_NODE_URL: https://rpc.tenderly.co/fork/${{ secrets.TENDERLY_FORK_ID }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}

98 changes: 95 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -108,6 +108,90 @@ jobs:
echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV
echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV
- name: 'Setup jq'
uses: dcarbone/install-jq-action@v2.1.0
with:
version: '1.7'
force: 'false'

- name: "Create Tenderly fork"
run: |
echo "TENDERLY_CREATION_INFO=$(curl -X POST \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
-d '{"alias":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}${{ github.run_attempt }}", "description":"", "block_number": 18539779, "network_id":"1"}' \
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork)" >> $GITHUB_ENV
- name: "Parse Tenderly fork creation transaction result"
run: |
echo "TENDERLY_FORK_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.simulation_fork.id')" >> $GITHUB_ENV
echo "TENDERLY_ROOT_TRANSACTION_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.root_transaction.id')" >> $GITHUB_ENV
- name: "Retrieve Tenderly fork block number"
run: |
echo "TENDERLY_FORK_BLOCK_NUMBER=$(curl -X GET \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
https://api.tenderly.co/api/v1/network/1/block-number | jq -r '.block_number')" >> $GITHUB_ENV
echo "TENDERLY_FORK_BLOCK_NUMBER=$((${{ env.TENDERLY_FORK_BLOCK_NUMBER }} + 1))" >> GITHUB_ENV
- name: "Transfer Bridge ownership in Tenderly fork"
run: |
echo "TENDERLY_ROOT_TRANSACTION_ID=$(curl -X POST \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
-d '{
"network_id": "1",
"block_number": ${{ env.TENDERLY_FORK_BLOCK_NUMBER }},
"transaction_index": null,
"from": "0xed8f3170db6d1a71c8fa6d8d73cc2c51db95d5a4",
"input": "0xf2fde38b0000000000000000000000008e25cfd9bd6c0ca67a5522cd920b3c66d39d6e97",
"to": "0x7700d773022b19622095118fadf46f7b9448be9b",
"gas": 8000000,
"gas_price": "0",
"value": "0",
"access_list": [],
"generate_access_list": true,
"save": true,
"source": "dashboard",
"block_header": null,
"root": "${{ env.TENDERLY_ROOT_TRANSACTION_ID }}",
"skip_fork_head_update": false,
"alias": "",
"description": "Transfer ownership to 0x8E25cfd9bd6c0ca67a5522cd920b3c66D39d6E97"
}' \
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}/simulate | jq -r '.simulation.id')" >> $GITHUB_ENV
echo "TENDERLY_FORK_BLOCK_NUMBER=$((${{ env.TENDERLY_FORK_BLOCK_NUMBER }} + 1))" >> GITHUB_ENV
- name: "Transfer Authorizers ownership in Tenderly fork"
run: |
curl -X POST \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
-d '{
"network_id": "1",
"block_number": ${{ env.TENDERLY_FORK_BLOCK_NUMBER }},
"transaction_index": null,
"from": "0xed8f3170db6d1a71c8fa6d8d73cc2c51db95d5a4",
"input": "0xf2fde38b0000000000000000000000008e25cfd9bd6c0ca67a5522cd920b3c66d39d6e97",
"to": "0x481dab4407b9880de0a68dc62e6af611c4949e42",
"gas": 8000000,
"gas_price": "0",
"value": "0",
"access_list": [],
"generate_access_list": true,
"save": true,
"source": "dashboard",
"block_header": null,
"root": "${{ env.TENDERLY_ROOT_TRANSACTION_ID }}",
"skip_fork_head_update": false,
"alias": "",
"description": "Transfer ownership to 0x8E25cfd9bd6c0ca67a5522cd920b3c66D39d6E97"
}' \
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}/simulate
- name: "Deploy 0Chain"
uses: 0chain/actions/deploy-0chain@master
with:
Expand All @@ -116,10 +200,10 @@ jobs:
teardown_condition: "TESTS_PASSED"
custom_go_sdk_version: ${{ env.CURRENT_BRANCH_HEAD }}
SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }}
TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }}
TENDERLY_FORK_ID: ${{ env.TENDERLY_FORK_ID }}
graphnode_sc: ${{ secrets.GRAPHNODE_SC }}
graphnode_network: ${{ secrets.GRAPHNODE_NETWORK }}
graphnode_ethereum_node_url: https://rpc.tenderly.co/fork/${{ secrets.TENDERLY_FORK_ID }}
graphnode_ethereum_node_url: https://rpc.tenderly.co/fork/${{ env.TENDERLY_FORK_ID }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}

- name: "Run System tests"
Expand All @@ -135,11 +219,19 @@ jobs:
retry_failures: true
run_frontend_tests: true
run_smoke_tests: ${{ github.ref != 'refs/heads/staging' && github.base_ref != 'staging' && github.ref != 'refs/heads/master' && github.base_ref != 'master' }}
TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }}
TENDERLY_FORK_ID: ${{ env.TENDERLY_FORK_ID }}
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}

- name: "Remove Tenderly fork"
if: always()
run: |
curl -X DELETE \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}
- name: "Set PR status as ${{ job.status }}"
if: ${{ (success() || failure()) && steps.findPr.outputs.number }}
uses: 0chain/actions/set-pr-status@master
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -35,7 +35,7 @@ gosdk-build: gomod-download
go build -x -v -tags bn256 ./...

wasm-build: getrev
CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -o ./zcn.wasm ./wasmsdk
CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -buildvcs=false -o ./zcn.wasm ./wasmsdk

wasm-test: wasm-build
env -i $(shell go env) PATH="$(shell go env GOROOT)/misc/wasm:$(PATH)" CGO_ENABLED=0 GOOS=js GOARCH=wasm go test -v github.com/0chain/gosdk/wasmsdk/jsbridge/...
Expand Down
4 changes: 2 additions & 2 deletions core/conf/config.go
Expand Up @@ -13,9 +13,9 @@ import (

const (
// DefaultMinSubmit default value for min_submit
DefaultMinSubmit = 50
DefaultMinSubmit = 10
// DefaultMinConfirmation default value for min_confirmation
DefaultMinConfirmation = 50
DefaultMinConfirmation = 10
// DefaultMaxTxnQuery default value for max_txn_query
DefaultMaxTxnQuery = 5
// DefaultConfirmationChainLength default value for confirmation_chain_length
Expand Down
4 changes: 2 additions & 2 deletions core/conf/config_test.go
Expand Up @@ -75,7 +75,7 @@ func TestLoadConfig(t *testing.T) {
return mockDefaultReader()
},
run: func(r *require.Assertions, cfg Config) {
r.Equal(50, cfg.MinSubmit)
r.Equal(10, cfg.MinSubmit)
},
},
{
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestLoadConfig(t *testing.T) {
return mockDefaultReader()
},
run: func(r *require.Assertions, cfg Config) {
r.Equal(50, cfg.MinConfirmation)
r.Equal(10, cfg.MinConfirmation)
},
},
{
Expand Down
5 changes: 5 additions & 0 deletions core/conf/vars.go
Expand Up @@ -41,7 +41,12 @@ func GetClientConfig() (*Config, error) {
// InitClientConfig set global client config
func InitClientConfig(c *Config) {
onceCfg.Do(func() {
sharderConsensous := c.SharderConsensous
if sharderConsensous < 1 {
sharderConsensous = DefaultSharderConsensous
}
cfg = c
cfg.SharderConsensous = sharderConsensous
})
}

Expand Down
18 changes: 18 additions & 0 deletions core/encryption/hash.go
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/sha1"
"encoding/hex"

"github.com/minio/sha256-simd"
"golang.org/x/crypto/sha3"
)

Expand Down Expand Up @@ -35,6 +36,23 @@ func RawHash(data interface{}) []byte {
return hash.Sum(buf)
}

func ShaHash(data interface{}) []byte {
var databuf []byte
switch dataImpl := data.(type) {
case []byte:
databuf = dataImpl
case HashBytes:
databuf = dataImpl[:]
case string:
databuf = []byte(dataImpl)
default:
panic("unknown type")
}
hash := sha256.New()
_, _ = hash.Write(databuf)
return hash.Sum(nil)
}

/*FastHash - sha1 hash the given data and return the hash as hex string */
func FastHash(data interface{}) string {
return hex.EncodeToString(RawFastHash(data))
Expand Down
53 changes: 53 additions & 0 deletions core/node/cache.go
@@ -0,0 +1,53 @@
package node

import (
"sync"
)

var Cache *NonceCache
var once sync.Once

type NonceCache struct {
cache map[string]int64
guard sync.Mutex
sharders *NodeHolder
}

func InitCache(sharders *NodeHolder) {
Cache.sharders = sharders
}

func init() {
once.Do(func() {
Cache = &NonceCache{
cache: make(map[string]int64),
}
})
}

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
}
nc.cache[clientId] = nonce
}

nc.cache[clientId] += 1
return nc.cache[clientId]
}

func (nc *NonceCache) Set(clientId string, nonce int64) {
nc.guard.Lock()
defer nc.guard.Unlock()
nc.cache[clientId] = nonce
}

func (nc *NonceCache) Evict(clientId string) {
nc.guard.Lock()
defer nc.guard.Unlock()
delete(nc.cache, clientId)
}

0 comments on commit 1a22937

Please sign in to comment.