From 6a753e4f9c49f90e8899b365e21faa67fc6af0e5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 26 Mar 2015 19:15:28 -0400 Subject: [PATCH 1/5] crypter: shuffle Makefile so that crypto can be used by the wallet Wallet must come before crypto, otherwise linking fails on some platforms. Includes a tangentially-related general cleanup rather than making the Makefile sloppier. --- src/Makefile.am | 72 +++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 804bc4865..121334eb7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,6 +3,7 @@ DIST_SUBDIRS = secp256k1 univalue AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(SAN_LDFLAGS) $(HARDENED_LDFLAGS) AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) AM_CPPFLAGS = $(HARDENED_CPPFLAGS) +EXTRA_LIBRARIES = if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -20,7 +21,7 @@ $(LIBLEVELDB) $(LIBMEMENV): endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config -BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include BITCOIN_INCLUDES += -I$(srcdir)/snark @@ -28,7 +29,6 @@ BITCOIN_INCLUDES += -I$(srcdir)/snark/libsnark BITCOIN_INCLUDES += -I$(srcdir)/univalue/include LIBBITCOIN_SERVER=libbitcoin_server.a -LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a @@ -38,6 +38,19 @@ LIBSNARK=snark/libsnark.a LIBUNIVALUE=univalue/libunivalue.la LIBZCASH=libzcash.a +if ENABLE_ZMQ +LIBBITCOIN_ZMQ=libbitcoin_zmq.a +endif +if ENABLE_PROTON +LIBBITCOIN_PROTON=libbitcoin_proton.a +endif +if BUILD_BITCOIN_LIBS +LIBZCASH_CONSENSUS=libzcashconsensus.la +endif +if ENABLE_WALLET +LIBBITCOIN_WALLET=libbitcoin_wallet.a +endif + $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) @@ -61,30 +74,18 @@ $(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*) # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: -EXTRA_LIBRARIES = \ - crypto/libbitcoin_crypto.a \ - libbitcoin_util.a \ - libbitcoin_common.a \ - libbitcoin_server.a \ - libbitcoin_cli.a \ - libzcash.a -if ENABLE_WALLET -BITCOIN_INCLUDES += $(BDB_CPPFLAGS) -EXTRA_LIBRARIES += libbitcoin_wallet.a -endif -if ENABLE_ZMQ -EXTRA_LIBRARIES += libbitcoin_zmq.a -endif -if ENABLE_PROTON -EXTRA_LIBRARIES += libbitcoin_proton.a -endif +EXTRA_LIBRARIES += \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_CLI) \ + $(LIBBITCOIN_WALLET) \ + $(LIBBITCOIN_ZMQ) \ + $(LIBBITCOIN_PROTON) \ + $(LIBZCASH) -if BUILD_BITCOIN_LIBS -lib_LTLIBRARIES = libzcashconsensus.la -LIBZCASH_CONSENSUS=libzcashconsensus.la -else -LIBZCASH_CONSENSUS= -endif +lib_LTLIBRARIES = $(LIBZCASH_CONSENSUS) bin_PROGRAMS = noinst_PROGRAMS = @@ -278,8 +279,6 @@ libbitcoin_server_a_SOURCES = \ $(LIBZCASH_H) if ENABLE_ZMQ -LIBBITCOIN_ZMQ=libbitcoin_zmq.a - libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS) libbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_zmq_a_SOURCES = \ @@ -289,8 +288,6 @@ libbitcoin_zmq_a_SOURCES = \ endif if ENABLE_PROTON -LIBBITCOIN_PROTON=libbitcoin_proton.a - libbitcoin_proton_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_proton_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_proton_a_SOURCES = \ @@ -443,6 +440,9 @@ zcashd_LDADD = \ $(LIBBITCOIN_COMMON) \ $(LIBUNIVALUE) \ $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_WALLET) \ + $(LIBBITCOIN_ZMQ) \ + $(LIBBITCOIN_PROTON) \ $(LIBBITCOIN_CRYPTO) \ $(LIBZCASH) \ $(LIBSNARK) \ @@ -450,14 +450,6 @@ zcashd_LDADD = \ $(LIBMEMENV) \ $(LIBSECP256K1) -if ENABLE_ZMQ -zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) -endif - -if ENABLE_WALLET -zcashd_LDADD += libbitcoin_wallet.a -endif - zcashd_LDADD += \ $(BOOST_LIBS) \ $(BDB_LIBS) \ @@ -465,13 +457,11 @@ zcashd_LDADD += \ $(CRYPTO_LIBS) \ $(EVENT_PTHREADS_LIBS) \ $(EVENT_LIBS) \ + $(ZMQ_LIBS) \ + $(PROTON_LIBS) \ $(LIBBITCOIN_CRYPTO) \ $(LIBZCASH_LIBS) -if ENABLE_PROTON -zcashd_LDADD += $(LIBBITCOIN_PROTON) $(PROTON_LIBS) -endif - # bitcoin-cli binary # zcash_cli_SOURCES = bitcoin-cli.cpp zcash_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) From 4922d1c19a642b9d3fde8ece67f5d7cb53dcf61d Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 7 Jul 2017 16:03:24 +0200 Subject: [PATCH 2/5] Fix test_bitcoin circular dependency issue --- src/Makefile.test.include | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 95a52e3d4..91526ceb6 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -111,12 +111,13 @@ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS) -test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) -test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +test_test_bitcoin_LDADD = if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif +test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ + $(LIBLEVELDB) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) +test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) test_test_bitcoin_LDADD += $(LIBZCASH_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(LIBZCASH) $(LIBSNARK) $(LIBZCASH_LIBS) test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static From 0ecdd0f30ae5fc642ed1afbc66965a8ea3e8db63 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 1 Aug 2018 15:01:16 +0100 Subject: [PATCH 3/5] chainparams: Add BIP 44 coin type (as registered in SLIP 44) --- src/chainparams.cpp | 3 +++ src/chainparams.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a058baa39..b42c75b12 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -82,6 +82,7 @@ public: CMainParams() { strNetworkID = "main"; strCurrencyUnits = "ZEC"; + bip44CoinType = 133; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md consensus.fCoinbaseMustBeProtected = true; consensus.nSubsidySlowStartInterval = 20000; consensus.nSubsidyHalvingInterval = 840000; @@ -258,6 +259,7 @@ public: CTestNetParams() { strNetworkID = "test"; strCurrencyUnits = "TAZ"; + bip44CoinType = 1; consensus.fCoinbaseMustBeProtected = true; consensus.nSubsidySlowStartInterval = 20000; consensus.nSubsidyHalvingInterval = 840000; @@ -377,6 +379,7 @@ public: CRegTestParams() { strNetworkID = "regtest"; strCurrencyUnits = "REG"; + bip44CoinType = 1; consensus.fCoinbaseMustBeProtected = false; consensus.nSubsidySlowStartInterval = 0; consensus.nSubsidyHalvingInterval = 150; diff --git a/src/chainparams.h b/src/chainparams.h index 1e19b0e8a..f24466e9a 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -81,6 +81,7 @@ public: unsigned int EquihashN() const { return nEquihashN; } unsigned int EquihashK() const { return nEquihashK; } std::string CurrencyUnits() const { return strCurrencyUnits; } + uint32_t BIP44CoinType() const { return bip44CoinType; } /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } /** In the future use NetworkIDString() for RPC fields */ @@ -114,6 +115,7 @@ protected: std::string bech32HRPs[MAX_BECH32_TYPES]; std::string strNetworkID; std::string strCurrencyUnits; + uint32_t bip44CoinType; CBlock genesis; std::vector vFixedSeeds; bool fMiningRequiresPeers = false; From e1887238237768ed3e68a3464b25c9da0141e7b8 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 3 Aug 2018 15:57:45 +0100 Subject: [PATCH 4/5] Upgrade Rust to 1.28.0 stable --- depends/packages/rust.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk index 07665cef6..9340a6a8d 100644 --- a/depends/packages/rust.mk +++ b/depends/packages/rust.mk @@ -1,12 +1,12 @@ package=rust -$(package)_version=1.26.0 +$(package)_version=1.28.0 $(package)_download_path=https://static.rust-lang.org/dist $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_linux=13691d7782577fc9f110924b26603ade1990de0b691a3ce2dc324b4a72a64a68 +$(package)_sha256_hash_linux=2a1390340db1d24a9498036884e6b2748e9b4b057fc5219694e298bdaa37b810 $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -$(package)_sha256_hash_darwin=38708803c3096b8f101d1919ee2d7e723b0adf1bc1bb986b060973b57d8c7c28 +$(package)_sha256_hash_darwin=5d7a70ed4701fe9410041c1eea025c95cad97e5b3d8acc46426f9ac4f9f02393 $(package)_file_name_mingw32=rust-mingw-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz -$(package)_sha256_hash_mingw32=156f99baf34a7a52867879cde17b762481c49aa280ca1b8fee3c4c5b7b43a408 +$(package)_sha256_hash_mingw32=17effb289f53af43c36be48635364db7eed68c5a411410216eb75a57c39219e3 define $(package)_stage_cmds From d0372cff5ecbfb405e6561b6836a31d1814d36d0 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 4 Aug 2018 17:45:21 +0100 Subject: [PATCH 5/5] Adjust Makefile so that common can be used by the wallet --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 121334eb7..e3a4b60a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -437,10 +437,10 @@ endif zcashd_LDADD = \ $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_WALLET) \ $(LIBBITCOIN_COMMON) \ $(LIBUNIVALUE) \ $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_WALLET) \ $(LIBBITCOIN_ZMQ) \ $(LIBBITCOIN_PROTON) \ $(LIBBITCOIN_CRYPTO) \