From 89690de6c26e380c6a23781ba29bf9cd9c53dc38 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Thu, 25 Oct 2018 14:32:35 +0200 Subject: [PATCH] Update Chia bls-signature to latest version Brings in: 1. https://github.com/Chia-Network/bls-signatures/pull/41 2. https://github.com/Chia-Network/bls-signatures/pull/46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs. --- depends/packages/chia_bls.mk | 4 ++-- src/bench/bench_dash.cpp | 1 - src/bls/bls.cpp | 11 ----------- src/bls/bls.h | 2 -- src/init.cpp | 3 --- src/test/test_dash.cpp | 1 - 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/depends/packages/chia_bls.mk b/depends/packages/chia_bls.mk index 03295faf308d..85eb21472e1c 100644 --- a/depends/packages/chia_bls.mk +++ b/depends/packages/chia_bls.mk @@ -1,9 +1,9 @@ package=chia_bls -$(package)_version=ef06290c1d92eea79b46af135bcc823b019612a6 +$(package)_version=v20181101 # It's actually from https://github.com/Chia-Network/bls-signatures, but we have so many patches atm that it's forked $(package)_download_path=https://github.com/codablock/bls-signatures/archive $(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=1e665359fdb946efce943340a324534f72832ecde97c4ebd4ad189f63e029300 +$(package)_sha256_hash=b3ec74a77a7b6795f84b05e051a0824ef8d9e05b04b2993f01040f35689aa87c $(package)_dependencies=gmp #$(package)_patches=...TODO (when we switch back to https://github.com/Chia-Network/bls-signatures) diff --git a/src/bench/bench_dash.cpp b/src/bench/bench_dash.cpp index a1d208502470..82b1cf3b3ebd 100644 --- a/src/bench/bench_dash.cpp +++ b/src/bench/bench_dash.cpp @@ -19,7 +19,6 @@ main(int argc, char** argv) ECC_Start(); ECCVerifyHandle verifyHandle; - BLSInit(); SetupEnvironment(); fPrintToDebugLog = false; // don't want to write to debug.log file diff --git a/src/bls/bls.cpp b/src/bls/bls.cpp index caba36f9758c..02a793551866 100644 --- a/src/bls/bls.cpp +++ b/src/bls/bls.cpp @@ -462,14 +462,3 @@ static void secure_free(void* p) return get_secure_allocator().deallocate(ptr, n); } #endif - -bool BLSInit() -{ - if (!bls::BLS::Init()) { - return false; - } -#ifndef BUILD_BITCOIN_INTERNAL - bls::BLS::SetSecureAllocator(secure_allocate, secure_free); -#endif - return true; -} diff --git a/src/bls/bls.h b/src/bls/bls.h index c50a96ee11ec..f62ab67566a4 100644 --- a/src/bls/bls.h +++ b/src/bls/bls.h @@ -300,6 +300,4 @@ typedef std::shared_ptr BLSPublicKeyVectorPtr; typedef std::shared_ptr BLSSecretKeyVectorPtr; typedef std::shared_ptr BLSSignatureVectorPtr; -bool BLSInit(); - #endif // DASH_CRYPTO_BLS_H diff --git a/src/init.cpp b/src/init.cpp index fe87b9417ed7..3be69dfda8dc 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -846,9 +846,6 @@ bool InitSanityCheck(void) if (!glibc_sanity_test() || !glibcxx_sanity_test()) return false; - if (!BLSInit()) - return false; - return true; } diff --git a/src/test/test_dash.cpp b/src/test/test_dash.cpp index b618cc14bed7..2654382264d7 100644 --- a/src/test/test_dash.cpp +++ b/src/test/test_dash.cpp @@ -43,7 +43,6 @@ extern void noui_connect(); BasicTestingSetup::BasicTestingSetup(const std::string& chainName) { ECC_Start(); - BLSInit(); SetupEnvironment(); SetupNetworking(); InitSignatureCache();