forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 724
[WIP][Build] Add bls-signatures library #2405
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
Closed
Closed
Conversation
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
>>> backports dash@47a162255260019bd4733d4336c235b01019df9f A simple C++ thread pool library https://github.com/vit-vit/CTPL Commit: 437e135dbd94eb65b45533d9ce8ee28b5bd37b6d
to avoid conflicts with pre-processor's constants defined by relic_conf
>>> adapts dash@9c8e4ac76bbe4eb4d7353f16f8c298ad40305da9
The old solution relied on thread-local-storage and was thus not compatible to libc6 2.11 (which is the minimum supported version we use). Also, the old solution turned out to be erroneous. It would have crashed or memory leaked when ownership of CBLSPrivateKey would be handled over to another thread.
Uses the same trick as LockedPoolManager::Instance()
by re-using the null-hash
In some cases it takes too much time to perform full deserialization of BLS signatures in the message handler thread. Better to just read the buffer and do the actual deserialization when the signature is needed for the first time (which is can be in another thread).
>>> extracted from dash@864856688dd9b1488daa6fe500edc37dd5a0a571 - Generalize CBLSLazyWrapper so that it can be used for signatures, pubkeys, and secret keys - Implement == and != operators for CBLSLazyWrapper - Implement cached hash for CBLSLazyWrapper
- undefine ERROR and DOUBLE - check size in SetBuf and GetBuf - check hex format of input string in SetHexStr - remove size from InternalSetBuf/InternalGetBuf
>>> backports dash PR 3867 * bls: Add CBLSImplicit, a wrapper around uint256 This makes `CBLSImplicit` compatible (related to methods called by CBLSWrapper) with the other classes from the bls-signatures library. * bls: Use CBLSImplicit instead of uint256 as base type of CBLSId * bls: Use FromBytes directly instead of indirectly through InternalSetBuf * bls: Use Serialize directly instead of indirectly through InternalGetBuf * bls: Drop all occurrences of InternalSetBuf and InternalGetBuf * bls: Use `CBLSIdImplicit` instead of `uint256` in some more places
>>> extracted from dash@982623860554ad1b558380f1ceffc154baf68a77
>>> from dash@6afa245307be43d300620a90aa118935f9439c5f
+ dash@d6a61e21cb6f5138fffd56151eab5ce4ac41b3b2
>>> backports dash pr 3899
>>> backports dash PR 4013 * bls: Only update cached hash in CBLSWrapper when it's really needed * bls: Reset cached hash in CBLSLazyWrapper instead of re-assigning uint256() to it * bench: Update expected numbers in bls benchmarks * bls: Drop UpdateHash methods Make sure the hash is updated via GetHash() only.
>>>backports dash@304678881a2303cdad408ab66361ffe9f7194255
+ dash@e22956f5e4e2dd42c6deda6d20897b6cd0851006
+ dash@6a73d532b592b4ab165022fe2e3a9f72ede23bc6
+ dash@02a850246e77092b057fc4c2444330b14d788d69
in order to use the current v1.0.0 release of the bls-signatures forked from dash
>>> backports dash@637c34aa427cd41533d815a60650367f27c7eabd
Author
|
Pushed several updates/backports, and integrated library version |
Author
|
Closing this one, as with PIVX-Project/bls-signatures#1 we will be able to include the library as subtree, and build with autotools (so no need to include it as depends package). Wrappers and tests will be added once the new build system is complete. |
1 task
random-zebra
added a commit
that referenced
this pull request
Jul 28, 2021
5b289eb CI: Lint chiabls subtree (Fuzzbawls) c775ab3 Lint: exclude chiabls subtree from whitespace linting (Fuzzbawls) e5d5ef7 CMake: integrate chiabls subtree CMake targets (Fuzzbawls) 50318c6 Build: build chiabls library from git subtree (Fuzzbawls) 4a71f9a Squashed 'src/chiabls/' content from commit 676ea45e80 (Fuzzbawls) Pull request description: This introduces a new upcoming library dependency as a git subtree with support for native autotools (and CMake) builds. #2405 had also introduced this library dependency, but only as part of the `depends` system, which introduced numerous issues, not least of which was essentially breaking any non-depends based builds. After some discussion, it was decided that the git subtree approach (as used with `leveldb`, `crc32`, `univalue`, and `secp256k1`) would be more ideal as it would allow for both depends and non-depends based builds. Achieving this requires us to maintain our own fork of https://github.com/Chia-Network/bls-signatures (ours is at https://github.com/PIVX-Project/bls-signatures) with a native autotools based build system added to it (PIVX-Project/bls-signatures#1) that has been integrated into PIVX Core here. Note: This PR simply introduces the new library and connects it to our autotools and CMake build systems, but does not introduce new code that actually _uses_ the new library. Also Note: This effectively bumps our minimum required version of CMake (for CMake builds only) to `3.14`. ACKs for top commit: random-zebra: utACK 5b289eb and merging... Tree-SHA512: 9a36015395f310031a59a4b0c2159704753db627802b73b26ccb0fa3b85a9f33403c53ff424aadf56da81de546bfcf8e150fb3eac99fa232c29fd98a828aedb9
random-zebra
added a commit
that referenced
this pull request
Sep 17, 2021
… and unit tests 0d126ee [QA] Test encryption/decryption of sk shares in dkg unit test (random-zebra) db69885 [QA] Refactor bls_ies_tests using CBLSIESEncryptedObject (random-zebra) 0453474 Test: Add bls ies basic encryption and decryption test coverage. (furszy) aa51751 [Refactoring] Replace std::random_shuffle with Shuffle (random-zebra) 9f4ac39 [QA] Add unit test for DKG using wrapper/worker (random-zebra) 0253ea7 [QA] Add test for BLS sign/verify message and sethexstr (random-zebra) c4c6efe [Refactor] Initialize BLS allocator in BasicTestingSetup (random-zebra) 104c4b0 Bail out early from secure deallocation (Alexander Block) f5c0870 Add ECDSA benchmarks (Alexander Block) 5b16d89 [BUG] Initialize Random for bench tests (random-zebra) 1c3f2cb [Trivial] Remove unused variables in bls bench test (random-zebra) 9502597 Add BLS and DKG benchmarks (Alexander Block) 7bb9f02 [Trivial] bls_worker: Fix members initialization order in Aggregators (random-zebra) 225c8a8 Add highly parallelized worker/helper for BLS/DKG calculations (Alexander Block) df56dea Add simple helpers/wrappers for BLS+AES based integrated encryption schemes (IES) (Alexander Block) 6f1d0e2 Implement wrappers around Chia BLS libs (random-zebra) a0b04c1 Add pooled_secure_allocator and mt_pooled_secure_allocator (Alexander Block) dbb0305 [Trivial] Rename BCLog::BENCH/RAND to BCLog::BENCHMARK/RANDOM (random-zebra) d9ffaa6 Add helper to rename all threads of a ctpl::thread_pool (Alexander Block) 9f9a3d7 Add ctpl header only library (random-zebra) Pull request description: Based on top of: - [x] #2419 This reworks #2405, adapting the commits to the new build system (which includes the library already at `v1.0.1`, as git subtree). ACKs for top commit: furszy: one step closer, ACK 0d126ee Fuzzbawls: ACK 0d126ee Tree-SHA512: 9a07bf32790326444c7e035bd9b24351715d3906fb6e2b9e51b46950ed1aa82cf2cb72fba1b13611d771c339936433ff4c5a914e1ca2bb03965b83c371c8817f
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.
This adds support, helpers/wrappers, and first benchmark tests for the Chia-Network BLS library (forked at https://github.com/PIVX-Project/bls-signatures).
Current benchmarks measured here:
Note: In WIP as it needs support for non-deterministic builds (only working with depends atm).