Make verify-bls-signatures no_std compatible#137
Merged
ytqaljn merged 3 commits intoCESSProject:sprint7-file-restoralfrom Jun 8, 2023
hkwtf:jc/sprint7-fire-restoral
Merged
Make verify-bls-signatures no_std compatible#137ytqaljn merged 3 commits intoCESSProject:sprint7-file-restoralfrom hkwtf:jc/sprint7-fire-restoral
ytqaljn merged 3 commits intoCESSProject:sprint7-file-restoralfrom
hkwtf:jc/sprint7-fire-restoral
Conversation
Contributor
jimmychu0807
commented
Jun 7, 2023
- Fixed a warning and compile
- Adding verify-bls-signatures in utils
- Replace Rand lib with getrandom to make it no_std compatible
- Adding verify-bls-signatures in utils - Replace Rand lib with getrandom to make it no_std compatible
Contributor
Author
|
@ytqaljn In this PR, I added verify-bls-signatures in |
jimmychu0807
commented
Jun 7, 2023
Comment on lines
+12
to
+20
| # rand = { version = "0.8.5", default-features = false, features = ["getrandom"] } | ||
|
|
||
| # Check references: | ||
| # - https://docs.rs/getrandom/latest/getrandom/index.html | ||
| # - https://rust-random.github.io/book/crates.html | ||
| # - https://github.com/rust-random/getrandom/pull/109 // This one explains why "custom" feature | ||
| # is added, and we will need to call `register_custom_getrandom` in future. | ||
| # - https://docs.rs/getrandom/latest/getrandom/index.html#custom-implementations | ||
| getrandom = { version = "0.2.10", default-features = false, features = ["custom"] } |
Contributor
Author
There was a problem hiding this comment.
This is the key change, using getrandom lib instead of rand lib. Compare it with dfinity original line:
https://github.com/dfinity/verify-bls-signatures/blob/master/Cargo.toml#L12
I added references on the above on using getrandom and caveat of it. We may need to register our own randomize() function in future.
jimmychu0807
commented
Jun 7, 2023
Comment on lines
+186
to
+192
| // let mut rng = rand::thread_rng(); | ||
| loop { | ||
| let mut buf = [0u8; 32]; | ||
| // rng.fill_bytes(&mut buf); | ||
| // note: Handle the `Result` below | ||
| getrandom::getrandom(&mut buf); | ||
| let s: Option<Scalar> = Scalar::from_bytes(&buf).into(); |
Contributor
Author
There was a problem hiding this comment.
Here, instead of using rand, we use getrandom
AstaFrode
pushed a commit
that referenced
this pull request
Jun 9, 2023
* fix: renewal space unfreeze * feat: add some root extrisic * feat: add some root function for test * style: 0.5.4 add new field * style: for distinguish chain * feat: some root function for test * feat: for test * test: migration test * fix: fix random bug * fix: index from 1 start * fix: random seed * fix: random seed * config: string limit 50000 -> 60000 * feat: batch delete files * style: clear warning * merge: frame-upgrade * fix: fix merge bug * refactor: add storage-handler pallet * fix: fix recursing * refactor: file-bank pallet adapt * refactor: adapt storage handle * refactor: rename file-map -> tee-worker * refactor: rename file-map -> tee-worker * fix: bug * refactor: segment-book -> audit * feat: upload_deal * feat: upload_deal * feat: upload_deal * feat: upload_deal * feat: upload deal * feat: tranfser_report * feat: time task deal_reassign_miner * feat: unlock space for miner * feat: calculate time task * feat: delete file * style: add Event * style: fix warning * refactor: idle space and service space change when segment add or delete * feat: some func for test * style: framework optimization * fix: update FragmentCount const * fix: fragment repeat causing BoundedVecError * refactor: tuple to struct for go-substrate-sdk * fix: update lock space, miner and user * feat: add two new package * feat: tee register * feat: add report verify * feat: generate challeng(40%) * tests: ed25519 verify sig * feat: generate challenge * feat: submit prove * feat: challenge clear * feat: miner reward * feat: clear and prove punish * feat: three punish * feat: lock miner * feat: miner exit * feat: filter for lock miner * feat: update increase_collateral for debt * feat: force miner exit * feat: use force exit miner * feat: clear expire file * feat: delete file * fix: transfer file delete file * feat: test rsa verify * style: fix warning * style: peer id types update * feat: unlock offchain * feat: add punish tee worker * fix: challenge select miner when miner number < 10 * fix: fix challengesnapshot bug * fix: miner exit bug * style: add withdraw event * style: update type * test: add some test function * test: add update_peer_id and exit * test: purchase in mib units * feat: random 0.046 chunks and random random number * feat: add new filed * fix: fix bug in reassigning validation tasks * style: delete methods that are no longer in use * feat: add methods for deleting fillers * style: some related modifications made for testing purposes * fix: miner exit prep error * feat: restoral file * fix: fix compile error * fix: fix random select miner * style: add restoral event * refactor: optimize space expiration functionality * test: some for test function * feat: add stake_score in validator election (#125) * feat: add stake_score in election * fix: merge conflics * fix: paritytech/substrate#13804 * test: test for bls * style: merge * test: test bls * feat: restoral order storage * feat: restoral order storage key * test: update data for test * fix: fix space expire bug * fix: fix upload file user hold slice list * fix: fix random select miner * test: for test add some function * Make verify-bls-signatures no_std compatible (#137) * - Fixed a warning and compile - Adding verify-bls-signatures in utils - Replace Rand lib with getrandom to make it no_std compatible * uncomment BLS and using dummy rand * Using getrandom custom * fix: cancel schedule mission * fix: file upload update UserBucketList * style: streamline code * fix: space expired user bucket list kill * Update README.md --------- Co-authored-by: ytqaljn <2716693942@qq.com> Co-authored-by: Shaka Lavigne <shakawwq@gmail.com> Co-authored-by: Jimmy Chu <jimmychu0807@gmail.com> Co-authored-by: Dean Clark <32699199+thirteenggh@users.noreply.github.com>
AstaFrode
added a commit
that referenced
this pull request
Jun 13, 2023
* fix: renewal space unfreeze * feat: add some root extrisic * feat: add some root function for test * style: 0.5.4 add new field * style: for distinguish chain * feat: some root function for test * feat: for test * test: migration test * fix: fix random bug * fix: index from 1 start * fix: random seed * fix: random seed * config: string limit 50000 -> 60000 * feat: batch delete files * style: clear warning * merge: frame-upgrade * fix: fix merge bug * refactor: add storage-handler pallet * fix: fix recursing * refactor: file-bank pallet adapt * refactor: adapt storage handle * refactor: rename file-map -> tee-worker * refactor: rename file-map -> tee-worker * fix: bug * refactor: segment-book -> audit * feat: upload_deal * feat: upload_deal * feat: upload_deal * feat: upload_deal * feat: upload deal * feat: tranfser_report * feat: time task deal_reassign_miner * feat: unlock space for miner * feat: calculate time task * feat: delete file * style: add Event * style: fix warning * refactor: idle space and service space change when segment add or delete * feat: some func for test * style: framework optimization * fix: update FragmentCount const * fix: fragment repeat causing BoundedVecError * refactor: tuple to struct for go-substrate-sdk * fix: update lock space, miner and user * feat: add two new package * feat: tee register * feat: add report verify * feat: generate challeng(40%) * tests: ed25519 verify sig * feat: generate challenge * feat: submit prove * feat: challenge clear * feat: miner reward * feat: clear and prove punish * feat: three punish * feat: lock miner * feat: miner exit * feat: filter for lock miner * feat: update increase_collateral for debt * feat: force miner exit * feat: use force exit miner * feat: clear expire file * feat: delete file * fix: transfer file delete file * feat: test rsa verify * style: fix warning * style: peer id types update * feat: unlock offchain * feat: add punish tee worker * fix: challenge select miner when miner number < 10 * fix: fix challengesnapshot bug * fix: miner exit bug * style: add withdraw event * style: update type * test: add some test function * test: add update_peer_id and exit * test: purchase in mib units * feat: random 0.046 chunks and random random number * feat: add new filed * fix: fix bug in reassigning validation tasks * style: delete methods that are no longer in use * feat: add methods for deleting fillers * style: some related modifications made for testing purposes * fix: miner exit prep error * feat: restoral file * fix: fix compile error * fix: fix random select miner * style: add restoral event * refactor: optimize space expiration functionality * test: some for test function * feat: add stake_score in validator election (#125) * feat: add stake_score in election * fix: merge conflics * fix: paritytech/substrate#13804 * test: test for bls * style: merge * test: test bls * feat: restoral order storage * feat: restoral order storage key * test: update data for test * fix: fix space expire bug * fix: fix upload file user hold slice list * fix: fix random select miner * test: for test add some function * Make verify-bls-signatures no_std compatible (#137) * - Fixed a warning and compile - Adding verify-bls-signatures in utils - Replace Rand lib with getrandom to make it no_std compatible * uncomment BLS and using dummy rand * Using getrandom custom * fix: cancel schedule mission * fix: file upload update UserBucketList * style: streamline code * fix: space expired user bucket list kill --------- Co-authored-by: ytqaljn <2716693942@qq.com> Co-authored-by: Shaka Lavigne <shakawwq@gmail.com> Co-authored-by: Jimmy Chu <jimmychu0807@gmail.com> Co-authored-by: Dean Clark <32699199+thirteenggh@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.