From cfa4590c752b634a52a86a6725798f879e1465e9 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Sun, 9 Jan 2022 23:54:35 +0000 Subject: [PATCH 01/23] Avoid a warning by explicitly calling drop. Signed-off-by: Daira Hopwood (cherry picked from commit 4f7d15508f6d6f27d73f4f439a8be00e307162e0) --- src/rust/src/zip339_ffi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/src/zip339_ffi.rs b/src/rust/src/zip339_ffi.rs index eeafa5bcd..852c10921 100644 --- a/src/rust/src/zip339_ffi.rs +++ b/src/rust/src/zip339_ffi.rs @@ -63,7 +63,7 @@ pub extern "C" fn zip339_free_phrase(phrase: *const c_char) { if !phrase.is_null() { unsafe { // It is correct to cast away const here; the memory is not actually immutable. - CString::from_raw(phrase as *mut c_char); + drop(CString::from_raw(phrase as *mut c_char)); } } } From 619a9a1d4740ebd5f2a5c8d096853cb129e6ef8e Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Mon, 10 Jan 2022 02:39:25 +0000 Subject: [PATCH 02/23] Replace call to drop with zeroization. Signed-off-by: Daira Hopwood (cherry picked from commit 0e073a53ee9da8b832602774a431f9db249af9ce) --- Cargo.lock | 1 + Cargo.toml | 1 + src/rust/src/zip339_ffi.rs | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 72c516709..3398f845f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -815,6 +815,7 @@ dependencies = [ "zcash_note_encryption", "zcash_primitives", "zcash_proofs", + "zeroize", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6d9428b95..ff661db05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ zcash_note_encryption = "0.1" zcash_primitives = "0.5" zcash_proofs = "0.5" ed25519-zebra = "3" +zeroize = "1.4.2" # Metrics hyper = { version = "=0.14.2", default-features = false, features = ["server", "tcp", "http1"] } diff --git a/src/rust/src/zip339_ffi.rs b/src/rust/src/zip339_ffi.rs index 852c10921..32005c2db 100644 --- a/src/rust/src/zip339_ffi.rs +++ b/src/rust/src/zip339_ffi.rs @@ -4,6 +4,7 @@ use std::{ ffi::{CStr, CString}, ptr, slice, }; +use zeroize::Zeroize; use zcash_primitives::zip339; @@ -63,7 +64,9 @@ pub extern "C" fn zip339_free_phrase(phrase: *const c_char) { if !phrase.is_null() { unsafe { // It is correct to cast away const here; the memory is not actually immutable. - drop(CString::from_raw(phrase as *mut c_char)); + CString::from_raw(phrase as *mut c_char) + .into_bytes() + .zeroize(); } } } From 6b0067c1e06cf0c9a5f7efb343ee577fbd4c1cd5 Mon Sep 17 00:00:00 2001 From: Charlie O'Keefe Date: Thu, 23 Sep 2021 14:03:29 -0600 Subject: [PATCH 03/23] Update base image used by Dockerfile from debian 10 to debian 11 I built a docker image with this change and verified that it successfully started zcashd (cherry picked from commit 21d6835efa61c3109c96298ceba23972fbcd078a) --- contrib/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 2c0a127c4..c5fd9513f 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10 +FROM debian:11 RUN apt-get update \ && apt-get install -y gnupg2 apt-transport-https curl From 82b98164a5b860753eba3a7b62daf513bbf73c4b Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 20 Mar 2018 21:04:27 -0700 Subject: [PATCH 04/23] Fix csBestBlock/cvBlockChange waiting in rpc/mining (cherry picked from commit bitcoin/bitcoin@45dd13503918e75a45ce33eb5c934b998790fdc8) (cherry picked from commit 4693f8165ff01a7354f78b219794616b351f582a) --- src/main.cpp | 9 ++++++++- src/main.h | 5 +++++ src/rpc/mining.cpp | 14 +++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a3f1d506e..0a7c44417 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,6 +68,8 @@ CBlockIndex *pindexBestHeader = NULL; static std::atomic nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; +uint256 hashBestBlock; +int heightBestBlock; int nScriptCheckThreads = 0; std::atomic_bool fImporting(false); std::atomic_bool fReindex(false); @@ -3757,7 +3759,12 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) { RenderPoolMetrics("sapling", saplingPool); RenderPoolMetrics("transparent", transparentPool); - cvBlockChange.notify_all(); + { + boost::unique_lock lock(csBestBlock); + hashBestBlock = pindexNew->GetBlockHash(); + heightBestBlock = pindexNew->nHeight; + cvBlockChange.notify_all(); + } } /** diff --git a/src/main.h b/src/main.h index a76fe63e6..f9df0527a 100644 --- a/src/main.h +++ b/src/main.h @@ -160,8 +160,13 @@ extern BlockMap mapBlockIndex; extern std::optional last_block_num_txs; extern std::optional last_block_size; extern const std::string strMessageMagic; + +// These prevent lock-ordering problems in getblocktemplate() RPC extern CWaitableCriticalSection csBestBlock; extern CConditionVariable cvBlockChange; +extern uint256 hashBestBlock; +extern int heightBestBlock; + extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; extern int nScriptCheckThreads; diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c9f6fc73d..03d7fa291 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -607,15 +607,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; } + // Release the main lock while waiting + // Don't call chainActive->Tip() without holding cs_main + LEAVE_CRITICAL_SECTION(cs_main); { checktxtime = boost::get_system_time() + boost::posix_time::seconds(10); boost::unique_lock lock(csBestBlock); - while (chainActive.Tip()->GetBlockHash() == hashWatchedChain && IsRPCRunning()) + while (hashBestBlock == hashWatchedChain && IsRPCRunning()) { - // Release the main lock while waiting - LEAVE_CRITICAL_SECTION(cs_main); - // Before waiting, generate the coinbase for the block following the next // block (since this is cpu-intensive), so that when next block arrives, // we can quickly respond with a template for following block. @@ -629,11 +629,10 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) next_cb_mtx = cached_next_cb_mtx; } bool timedout = !cvBlockChange.timed_wait(lock, checktxtime); - ENTER_CRITICAL_SECTION(cs_main); // Optimization: even if timed out, a new block may have arrived // while waiting for cs_main; if so, don't discard next_cb_mtx. - if (chainActive.Tip()->GetBlockHash() != hashWatchedChain) break; + if (hashBestBlock != hashWatchedChain) break; // Timeout: Check transactions for update if (timedout && mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP) { @@ -643,11 +642,12 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) } checktxtime += boost::posix_time::seconds(10); } - if (chainActive.Tip()->nHeight != nHeight + 1) { + if (heightBestBlock != nHeight + 1) { // Unexpected height (reorg or >1 blocks arrived while waiting) invalidates coinbase tx. next_cb_mtx = nullopt; } } + ENTER_CRITICAL_SECTION(cs_main); if (!IsRPCRunning()) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down"); From f4e92165f041976b853793f7541b5a3919251c3c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 3 Apr 2018 21:53:07 -0700 Subject: [PATCH 05/23] Modernize best block mutex/cv/hash variable naming (cherry picked from commit bitcoin/bitcoin@4a6c0e3dcfdca98270cb96b73db4c3d4446dba50) (cherry picked from commit c079a518c066a0c8e24d844892f8a10c7638b9d1) --- src/init.cpp | 2 +- src/main.cpp | 16 ++++++++-------- src/main.h | 8 ++++---- src/rpc/mining.cpp | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b632d7e2b..e9b79ad47 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -305,7 +305,7 @@ bool static Bind(const CService &addr, unsigned int flags) { void OnRPCStopped() { - cvBlockChange.notify_all(); + g_best_block_cv.notify_all(); LogPrint("rpc", "RPC stopped.\n"); } diff --git a/src/main.cpp b/src/main.cpp index 0a7c44417..244624bb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,10 +66,10 @@ BlockMap mapBlockIndex; CChain chainActive; CBlockIndex *pindexBestHeader = NULL; static std::atomic nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block -CWaitableCriticalSection csBestBlock; -CConditionVariable cvBlockChange; -uint256 hashBestBlock; -int heightBestBlock; +CWaitableCriticalSection g_best_block_mutex; +CConditionVariable g_best_block_cv; +uint256 g_best_block; +int g_best_block_height; int nScriptCheckThreads = 0; std::atomic_bool fImporting(false); std::atomic_bool fReindex(false); @@ -3760,10 +3760,10 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) { RenderPoolMetrics("transparent", transparentPool); { - boost::unique_lock lock(csBestBlock); - hashBestBlock = pindexNew->GetBlockHash(); - heightBestBlock = pindexNew->nHeight; - cvBlockChange.notify_all(); + boost::unique_lock lock(g_best_block_mutex); + g_best_block = pindexNew->GetBlockHash(); + g_best_block_height = pindexNew->nHeight; + g_best_block_cv.notify_all(); } } diff --git a/src/main.h b/src/main.h index f9df0527a..b5c8ba90c 100644 --- a/src/main.h +++ b/src/main.h @@ -162,10 +162,10 @@ extern std::optional last_block_size; extern const std::string strMessageMagic; // These prevent lock-ordering problems in getblocktemplate() RPC -extern CWaitableCriticalSection csBestBlock; -extern CConditionVariable cvBlockChange; -extern uint256 hashBestBlock; -extern int heightBestBlock; +extern CWaitableCriticalSection g_best_block_mutex; +extern CConditionVariable g_best_block_cv; +extern uint256 g_best_block; +extern int g_best_block_height; extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 03d7fa291..ef3621d7b 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -613,8 +613,8 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) { checktxtime = boost::get_system_time() + boost::posix_time::seconds(10); - boost::unique_lock lock(csBestBlock); - while (hashBestBlock == hashWatchedChain && IsRPCRunning()) + boost::unique_lock lock(g_best_block_mutex); + while (g_best_block == hashWatchedChain && IsRPCRunning()) { // Before waiting, generate the coinbase for the block following the next // block (since this is cpu-intensive), so that when next block arrives, @@ -628,11 +628,11 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) Params(), CAmount{0}, minerAddress, cached_next_cb_height); next_cb_mtx = cached_next_cb_mtx; } - bool timedout = !cvBlockChange.timed_wait(lock, checktxtime); + bool timedout = !g_best_block_cv.timed_wait(lock, checktxtime); // Optimization: even if timed out, a new block may have arrived // while waiting for cs_main; if so, don't discard next_cb_mtx. - if (hashBestBlock != hashWatchedChain) break; + if (g_best_block != hashWatchedChain) break; // Timeout: Check transactions for update if (timedout && mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP) { @@ -642,7 +642,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) } checktxtime += boost::posix_time::seconds(10); } - if (heightBestBlock != nHeight + 1) { + if (g_best_block_height != nHeight + 1) { // Unexpected height (reorg or >1 blocks arrived while waiting) invalidates coinbase tx. next_cb_mtx = nullopt; } From 5869659e2eeb254bd371dc66f067dc0f6ff798f0 Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Tue, 1 Mar 2022 17:43:43 -0700 Subject: [PATCH 06/23] document global variables (cherry picked from commit e170c3abd6e4ea448d37b08819ed94b4ed822eba) --- src/main.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.h b/src/main.h index b5c8ba90c..da065f63a 100644 --- a/src/main.h +++ b/src/main.h @@ -161,11 +161,17 @@ extern std::optional last_block_num_txs; extern std::optional last_block_size; extern const std::string strMessageMagic; -// These prevent lock-ordering problems in getblocktemplate() RPC +//! These four variables are used to notify getblocktemplate RPC of new tips. +//! When UpdateTip() establishes a new tip (best block), it must awaken a +//! waiting getblocktemplate RPC (if there is one) immediately. But upon waking +//! up, getblocktemplate cannot call chainActive->Tip() because it does not +//! (and cannot) hold cs_main. So the g_best_block_height and g_best_block variables +//! (protected by g_best_block_mutex) provide the needed height and block +//! hash respectively to getblocktemplate without it requiring cs_main. extern CWaitableCriticalSection g_best_block_mutex; extern CConditionVariable g_best_block_cv; -extern uint256 g_best_block; extern int g_best_block_height; +extern uint256 g_best_block; extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; From ca63d9816986c1681442fc0a56bb306ab544bc02 Mon Sep 17 00:00:00 2001 From: Taylor Hornby Date: Tue, 15 Feb 2022 14:01:54 -0700 Subject: [PATCH 07/23] Untested, not working yet, use libtinfo from the debian packages (cherry picked from commit a2c647d4bf76cb2dcd1d698cdc173bdba6afb67a) --- depends/packages/native_clang.mk | 2 ++ depends/packages/native_libtinfo.mk | 51 +++++++++++++++++++++++++++++ depends/packages/packages.mk | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 depends/packages/native_libtinfo.mk diff --git a/depends/packages/native_clang.mk b/depends/packages/native_clang.mk index ac42cd3e1..06a011f3d 100644 --- a/depends/packages/native_clang.mk +++ b/depends/packages/native_clang.mk @@ -18,6 +18,8 @@ $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64- $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f +$(package)_dependencies=native_libtinfo + # Ensure we have clang native to the builder, not the target host ifneq ($(canonical_host),$(build)) $(package)_exact_download_path=$($(package)_download_path_$(build_os)) diff --git a/depends/packages/native_libtinfo.mk b/depends/packages/native_libtinfo.mk new file mode 100644 index 000000000..9456028a4 --- /dev/null +++ b/depends/packages/native_libtinfo.mk @@ -0,0 +1,51 @@ +package=native_tinfo +#$(package)_major_version=13 +#$(package)_version=13.0.0 +#$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) +$(package)_download_path_linux=http://ftp.debian.org/debian/pool/main/n/ncurses/ +$(package)_download_file_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb +$(package)_file_name_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb +$(package)_sha256_hash_linux=1d249a3193568b5ef785ad8993b9ba6d6fdca0eb359204c2355532b82d25e9f5 +#$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_major_version).0.0 +#$(package)_download_file_darwin=clang+llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz +#$(package)_file_name_darwin=clang-llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz +#$(package)_sha256_hash_darwin=d051234eca1db1f5e4bc08c64937c879c7098900f7a0370f3ceb7544816a8b09 +#$(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) +#$(package)_download_file_freebsd=clang+llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz +#$(package)_file_name_freebsd=clang-llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz +#$(package)_sha256_hash_freebsd=e579747a36ff78aa0a5533fe43bc1ed1f8ed449c9bfec43c358d953ffbbdcf76 +#$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz +#$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz +#$(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f + +## Ensure we have clang native to the builder, not the target host +#ifneq ($(canonical_host),$(build)) +#$(package)_exact_download_path=$($(package)_download_path_$(build_os)) +#$(package)_exact_download_file=$($(package)_download_file_$(build_os)) +#$(package)_exact_file_name=$($(package)_file_name_$(build_os)) +#$(package)_exact_sha256_hash=$($(package)_sha256_hash_$(build_os)) +#endif + +define $(package)_stage_cmds + pwd + ls -l + ls -l + ls -l +endef +#mkdir -p $($(package)_staging_prefix_dir)/bin && \ +#cp bin/clang-$($(package)_major_version) $($(package)_staging_prefix_dir)/bin && \ +#cp bin/lld $($(package)_staging_prefix_dir)/bin && \ +#cp bin/llvm-ar $($(package)_staging_prefix_dir)/bin && \ +#cp bin/llvm-config $($(package)_staging_prefix_dir)/bin && \ +#cp bin/llvm-nm $($(package)_staging_prefix_dir)/bin && \ +#cp bin/llvm-objcopy $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/clang $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/ld.lld $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/ld64.lld $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/lld-link $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/llvm-ranlib $($(package)_staging_prefix_dir)/bin && \ +#cp -P bin/llvm-strip $($(package)_staging_prefix_dir)/bin && \ +#mv include/ $($(package)_staging_prefix_dir) && \ +#mv lib/ $($(package)_staging_prefix_dir) && \ +#mv libexec/ $($(package)_staging_prefix_dir) diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index b7407c861..de9248379 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,6 +1,6 @@ zcash_packages := libsodium utfcpp packages := boost libevent zeromq $(zcash_packages) googletest -native_packages := native_clang native_ccache native_rust +native_packages := native_clang native_libtinfo native_ccache native_rust wallet_packages=bdb From c79ee78a2812588427f3b469c1df7404f154d9dc Mon Sep 17 00:00:00 2001 From: sasha Date: Mon, 21 Feb 2022 19:24:28 -0800 Subject: [PATCH 08/23] on Arch only, use Debian's libtinfo5_6.0 to satisfy clang (cherry picked from commit 2d6dcd47505feb68cf976109467afe253fc4287a) --- depends/packages/native_clang.mk | 2 ++ depends/packages/native_libtinfo.mk | 55 +++++++---------------------- depends/packages/packages.mk | 6 +++- 3 files changed, 20 insertions(+), 43 deletions(-) diff --git a/depends/packages/native_clang.mk b/depends/packages/native_clang.mk index 06a011f3d..d6cd84002 100644 --- a/depends/packages/native_clang.mk +++ b/depends/packages/native_clang.mk @@ -18,7 +18,9 @@ $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64- $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f +ifneq (,$(wildcard /etc/arch-release)) $(package)_dependencies=native_libtinfo +endif # Ensure we have clang native to the builder, not the target host ifneq ($(canonical_host),$(build)) diff --git a/depends/packages/native_libtinfo.mk b/depends/packages/native_libtinfo.mk index 9456028a4..d3c200660 100644 --- a/depends/packages/native_libtinfo.mk +++ b/depends/packages/native_libtinfo.mk @@ -1,51 +1,22 @@ package=native_tinfo -#$(package)_major_version=13 -#$(package)_version=13.0.0 -#$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) +$(package)_version=5.6.0 $(package)_download_path_linux=http://ftp.debian.org/debian/pool/main/n/ncurses/ $(package)_download_file_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb $(package)_file_name_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb $(package)_sha256_hash_linux=1d249a3193568b5ef785ad8993b9ba6d6fdca0eb359204c2355532b82d25e9f5 -#$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_major_version).0.0 -#$(package)_download_file_darwin=clang+llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz -#$(package)_file_name_darwin=clang-llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz -#$(package)_sha256_hash_darwin=d051234eca1db1f5e4bc08c64937c879c7098900f7a0370f3ceb7544816a8b09 -#$(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -#$(package)_download_file_freebsd=clang+llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz -#$(package)_file_name_freebsd=clang-llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz -#$(package)_sha256_hash_freebsd=e579747a36ff78aa0a5533fe43bc1ed1f8ed449c9bfec43c358d953ffbbdcf76 -#$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -#$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -#$(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f -## Ensure we have clang native to the builder, not the target host -#ifneq ($(canonical_host),$(build)) -#$(package)_exact_download_path=$($(package)_download_path_$(build_os)) -#$(package)_exact_download_file=$($(package)_download_file_$(build_os)) -#$(package)_exact_file_name=$($(package)_file_name_$(build_os)) -#$(package)_exact_sha256_hash=$($(package)_sha256_hash_$(build_os)) -#endif +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir -p libtinfo5 && \ + ar x --output libtinfo5 $($(package)_source_dir)/$($(package)_file_name) && \ + cd libtinfo5 && \ + tar xf data.tar.xz +endef define $(package)_stage_cmds - pwd - ls -l - ls -l - ls -l + pwd && \ + mkdir -p $($(package)_staging_prefix_dir)/lib && \ + cp libtinfo5/lib/x86_64-linux-gnu/libtinfo.so.5.9 $($(package)_staging_prefix_dir)/lib/libtinfo.so.5 endef -#mkdir -p $($(package)_staging_prefix_dir)/bin && \ -#cp bin/clang-$($(package)_major_version) $($(package)_staging_prefix_dir)/bin && \ -#cp bin/lld $($(package)_staging_prefix_dir)/bin && \ -#cp bin/llvm-ar $($(package)_staging_prefix_dir)/bin && \ -#cp bin/llvm-config $($(package)_staging_prefix_dir)/bin && \ -#cp bin/llvm-nm $($(package)_staging_prefix_dir)/bin && \ -#cp bin/llvm-objcopy $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/clang $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/ld.lld $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/ld64.lld $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/lld-link $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/llvm-ranlib $($(package)_staging_prefix_dir)/bin && \ -#cp -P bin/llvm-strip $($(package)_staging_prefix_dir)/bin && \ -#mv include/ $($(package)_staging_prefix_dir) && \ -#mv lib/ $($(package)_staging_prefix_dir) && \ -#mv libexec/ $($(package)_staging_prefix_dir) diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index de9248379..042867bec 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,6 +1,10 @@ zcash_packages := libsodium utfcpp packages := boost libevent zeromq $(zcash_packages) googletest -native_packages := native_clang native_libtinfo native_ccache native_rust +native_packages := native_clang native_ccache native_rust + +ifneq (,$(wildcard /etc/arch-release)) +native_packages += native_libtinfo +endif wallet_packages=bdb From 9c59279802bbdc0c6e0f15697a482b68acf54fba Mon Sep 17 00:00:00 2001 From: sasha Date: Fri, 25 Feb 2022 14:43:13 -0800 Subject: [PATCH 09/23] remove superfluous space at end of native_packages line (cherry picked from commit 077f5550d44d523b0b4fb34ee5bcb96f96c4a087) --- depends/packages/packages.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 042867bec..2d85c3226 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,6 +1,6 @@ zcash_packages := libsodium utfcpp packages := boost libevent zeromq $(zcash_packages) googletest -native_packages := native_clang native_ccache native_rust +native_packages := native_clang native_ccache native_rust ifneq (,$(wildcard /etc/arch-release)) native_packages += native_libtinfo From e24deba8a7ea19382f083ca4730b6d22c9c91102 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 1 Mar 2022 00:03:42 +0000 Subject: [PATCH 10/23] qa: Bump all postponed dependencies We have a pending PR to address the `native_ccache` and `googletest` dependencies, and we aren't going to touch `bdb`. (cherry picked from commit 4c49af7750634e4e14c64f8e226884ad02dcd01e) --- qa/zcash/postponed-updates.txt | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/qa/zcash/postponed-updates.txt b/qa/zcash/postponed-updates.txt index a3a8d8e10..9ea09d7fb 100644 --- a/qa/zcash/postponed-updates.txt +++ b/qa/zcash/postponed-updates.txt @@ -5,23 +5,24 @@ # # Ccache 4.0 requires adding CMake to the depends system. -native_ccache 4.0 2022-02-01 -native_ccache 4.1 2022-02-01 -native_ccache 4.2 2022-02-01 -native_ccache 4.2.1 2022-02-01 -native_ccache 4.3 2022-02-01 -native_ccache 4.4 2022-02-01 -native_ccache 4.4.1 2022-02-01 -native_ccache 4.4.2 2022-02-01 -native_ccache 4.5 2022-02-01 -native_ccache 4.5.1 2022-02-01 +native_ccache 4.0 2022-05-01 +native_ccache 4.1 2022-05-01 +native_ccache 4.2 2022-05-01 +native_ccache 4.2.1 2022-05-01 +native_ccache 4.3 2022-05-01 +native_ccache 4.4 2022-05-01 +native_ccache 4.4.1 2022-05-01 +native_ccache 4.4.2 2022-05-01 +native_ccache 4.5 2022-05-01 +native_ccache 4.5.1 2022-05-01 # Clang is currently pinned to LLVM 13 # Rust is currently pinned to 1.56.1 -bdb 18.1.40 2022-02-01 +# We're never updating to this version +bdb 18.1.40 2024-02-01 # Google Test 1.10.0 requires adding CMake to the depends system. -googletest 1.10.0 2022-02-01 -googletest 1.11.0 2022-02-01 +googletest 1.10.0 2022-05-01 +googletest 1.11.0 2022-05-01 From 31244d7a570b77e58675c66f06b01388a57e8386 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 1 Mar 2022 00:05:01 +0000 Subject: [PATCH 11/23] qa: Postpone recent CCache release (cherry picked from commit adb7d074d580d91e495bce965da40db1006c3220) --- qa/zcash/postponed-updates.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/zcash/postponed-updates.txt b/qa/zcash/postponed-updates.txt index 9ea09d7fb..f590127f0 100644 --- a/qa/zcash/postponed-updates.txt +++ b/qa/zcash/postponed-updates.txt @@ -15,6 +15,7 @@ native_ccache 4.4.1 2022-05-01 native_ccache 4.4.2 2022-05-01 native_ccache 4.5 2022-05-01 native_ccache 4.5.1 2022-05-01 +native_ccache 4.6 2022-05-01 # Clang is currently pinned to LLVM 13 From 33f0a088fafa6d0ffa31ce9621a5d50150039601 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 1 Mar 2022 00:09:18 +0000 Subject: [PATCH 12/23] depends: Update Rust to 1.59.0 (cherry picked from commit 21430b13acf97404b3e5597f20b9d39285e35ced) --- .github/workflows/lints.yml | 8 ++++---- Cargo.toml | 2 +- depends/packages/native_rust.mk | 18 +++++++++--------- qa/zcash/postponed-updates.txt | 2 +- rust-toolchain | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index d2347eac3..2c26b8554 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -70,19 +70,19 @@ jobs: if: always() rust-clippy: - name: Clippy (1.54.0) + name: Clippy (1.59.0) runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.54.0 + toolchain: 1.59.0 components: clippy override: true - name: Run clippy uses: actions-rs/clippy-check@v1 with: - name: Clippy (1.54.0) + name: Clippy (1.59.0) token: ${{ secrets.GITHUB_TOKEN }} args: --all-features --all-targets -- -D warnings @@ -93,7 +93,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.54.0 + toolchain: 1.59.0 override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 diff --git a/Cargo.toml b/Cargo.toml index ff661db05..cb2d4f3d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ repository = "https://github.com/zcash/zcash" readme = "README.md" license = "MIT OR Apache-2.0" edition = "2018" -rust-version = "1.56" +rust-version = "1.59" [lib] name = "rustzcash" diff --git a/depends/packages/native_rust.mk b/depends/packages/native_rust.mk index 3b3f0ea4c..a1901a8fe 100644 --- a/depends/packages/native_rust.mk +++ b/depends/packages/native_rust.mk @@ -1,14 +1,14 @@ package=native_rust -$(package)_version=1.57.0 +$(package)_version=1.59.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=ea0253784b2e5c22659ff148d492a68d2e11da734491714ebc61cc93896efcda +$(package)_sha256_hash_linux=0c1c2da3fa26372e5178123aa5bb0fdcd4933fbad9bfb268ffbd71807182ecae $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -$(package)_sha256_hash_darwin=15ceffc4743434c19d08f73fb4edd6642b7fd8162ed7101d3e6ca2c691fcb699 +$(package)_sha256_hash_darwin=d82204f536af0c7bfd2ea2213dc46b99911860cfc5517f7321244412ae96f159 $(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz -$(package)_sha256_hash_freebsd=ebe96fa1f15e8d70c91e81aab7e0c341717b909225029f37d52fbdfa506e3fab +$(package)_sha256_hash_freebsd=83f9c49b6e9025b712fc5d65e49f1b6ad959966534cd39c8dc2ce2c85a6ca484 $(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_aarch64_linux=d66847f7cf7b548ecb328c400ac4f691ee2aea6ff5cd9286ad8733239569556c +$(package)_sha256_hash_aarch64_linux=ab5da30a3de5433e26cbc74c56b9d97b569769fc2e456fc54378adc8baaee4f0 # Mapping from GCC canonical hosts to Rust targets # If a mapping is not present, we assume they are identical, unless $host_os is @@ -17,10 +17,10 @@ $(package)_rust_target_x86_64-pc-linux-gnu=x86_64-unknown-linux-gnu $(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu # Mapping from Rust targets to SHA-256 hashes -$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=4c70901d1cbddec9ea99fbd62b20f454d30e1ffbb48a21169ac823b3f02a1fbc -$(package)_rust_std_sha256_hash_x86_64-apple-darwin=c1eb892ddb50ebeed288b7aa8171ad46d62362bb26b2d82d2b463dfd45606dc2 -$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=75c910899ed36a90b155e3a01c21b863000675867efc56f2b68c44edd4b7e18c -$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=1528a4bc7e3ba42da164bcc7b952dfa73048333c5b9254ce2d03db6bab6081e8 +$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=81dbd37919f631f962ac0798111803eb8f06ffde608f0e5dd3682d701cf5566d +$(package)_rust_std_sha256_hash_x86_64-apple-darwin=959af8bafbc9f3916a1d1111d7378fdd7aa459410cdd2d3bbfc2d9d9a6db0683 +$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=9a67ae84e9e75efb57eeeab617e32379a555de336a30bb74a476e575cd38f63a +$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=cf5e4303dd7c3b70a738a2336097c9f2189c8b702a89a8c453d83ac0dee4602c define rust_target $(if $($(1)_rust_target_$(2)),$($(1)_rust_target_$(2)),$(if $(findstring darwin,$(3)),x86_64-apple-darwin,$(if $(findstring freebsd,$(3)),x86_64-unknown-freebsd,$(2)))) diff --git a/qa/zcash/postponed-updates.txt b/qa/zcash/postponed-updates.txt index f590127f0..c4732b96a 100644 --- a/qa/zcash/postponed-updates.txt +++ b/qa/zcash/postponed-updates.txt @@ -19,7 +19,7 @@ native_ccache 4.6 2022-05-01 # Clang is currently pinned to LLVM 13 -# Rust is currently pinned to 1.56.1 +# Rust is currently pinned to 1.59.0 # We're never updating to this version bdb 18.1.40 2024-02-01 diff --git a/rust-toolchain b/rust-toolchain index 43c989b55..bb120e876 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.56.1 +1.59.0 From 663308ae9d61a94a32bdfce79a06dc45f556fcf9 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 1 Mar 2022 00:30:32 +0000 Subject: [PATCH 13/23] depends: Update Clang / libcxx to LLVM 13.0.1 (cherry picked from commit 2f1fbcc81f64d2a75b380c7eda008aab7de97a92) --- depends/packages/libcxx.mk | 20 ++++++++++---------- depends/packages/native_clang.mk | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/depends/packages/libcxx.mk b/depends/packages/libcxx.mk index c40317a4d..1409fd534 100644 --- a/depends/packages/libcxx.mk +++ b/depends/packages/libcxx.mk @@ -8,10 +8,10 @@ ifneq ($(host_os),mingw32) $(package)_download_path=$(native_clang_download_path) $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f -$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz -$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz -$(package)_sha256_hash_linux=76d0bf002ede7a893f69d9ad2c4e101d15a8f4186fbfe24e74856c8449acd7c1 +$(package)_sha256_hash_aarch64_linux=15ff2db12683e69e552b6668f7ca49edaa01ce32cb1cbc8f8ed2e887ab291069 +$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz +$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz +$(package)_sha256_hash_linux=84a54c69781ad90615d1b0276a83ff87daaeded99fbc64457c350679df7b4ff0 define $(package)_stage_cmds mkdir -p $($(package)_staging_prefix_dir)/lib && \ @@ -22,13 +22,13 @@ endef else # For Windows cross-compilation, use the MSYS2 binaries. $(package)_download_path=https://repo.msys2.org/mingw/x86_64 -$(package)_download_file=mingw-w64-x86_64-libc++-13.0.0-3-any.pkg.tar.zst -$(package)_file_name=mingw-w64-x86_64-libcxx-13.0.0-3-any.pkg.tar.zst -$(package)_sha256_hash=0f8819e88273579f7c9262456c6b8f4d73e1693095c2364d1192c61c5f6a1a4f +$(package)_download_file=mingw-w64-x86_64-libc++-13.0.1-1-any.pkg.tar.zst +$(package)_file_name=mingw-w64-x86_64-libcxx-13.0.1-1-any.pkg.tar.zst +$(package)_sha256_hash=0a7afcd88e14d6914f21f641b752ab40b106c6173f9842e22f5a5ae4701a2858 -$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-13.0.0-3-any.pkg.tar.zst -$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-13.0.0-3-any.pkg.tar.zst -$(package)_libcxxabi_sha256_hash=7224a7252a566938afe91ea8f130682abd29b10e13c9a3c2347af523ca0d7c42 +$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-13.0.1-1-any.pkg.tar.zst +$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-13.0.1-1-any.pkg.tar.zst +$(package)_libcxxabi_sha256_hash=f937818912aa6b0250e360e866f2a7dde663d1356e9fdfebf83f6b900de89391 $(package)_extra_sources += $($(package)_libcxxabi_file_name) diff --git a/depends/packages/native_clang.mk b/depends/packages/native_clang.mk index d6cd84002..662e088eb 100644 --- a/depends/packages/native_clang.mk +++ b/depends/packages/native_clang.mk @@ -1,22 +1,22 @@ package=native_clang $(package)_major_version=13 -$(package)_version=13.0.0 +$(package)_version=13.0.1 $(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) $(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz -$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz -$(package)_sha256_hash_linux=76d0bf002ede7a893f69d9ad2c4e101d15a8f4186fbfe24e74856c8449acd7c1 -$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_major_version).0.0 -$(package)_download_file_darwin=clang+llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz -$(package)_file_name_darwin=clang-llvm-$($(package)_major_version).0.0-x86_64-apple-darwin.tar.xz -$(package)_sha256_hash_darwin=d051234eca1db1f5e4bc08c64937c879c7098900f7a0370f3ceb7544816a8b09 +$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz +$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz +$(package)_sha256_hash_linux=84a54c69781ad90615d1b0276a83ff87daaeded99fbc64457c350679df7b4ff0 +$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) +$(package)_download_file_darwin=clang+llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz +$(package)_file_name_darwin=clang-llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz +$(package)_sha256_hash_darwin=dec02d17698514d0fc7ace8869c38937851c542b02adf102c4e898f027145a4d $(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) $(package)_download_file_freebsd=clang+llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz $(package)_file_name_freebsd=clang-llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz -$(package)_sha256_hash_freebsd=e579747a36ff78aa0a5533fe43bc1ed1f8ed449c9bfec43c358d953ffbbdcf76 +$(package)_sha256_hash_freebsd=8101c8d3a920bf930b33987ada5373f43537c5de8c194be0ea10530fd0ad5617 $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash_aarch64_linux=968d65d2593850ee9b37fcda074fb7641529bd45d2f976af6c8197de3c22612f +$(package)_sha256_hash_aarch64_linux=15ff2db12683e69e552b6668f7ca49edaa01ce32cb1cbc8f8ed2e887ab291069 ifneq (,$(wildcard /etc/arch-release)) $(package)_dependencies=native_libtinfo From 0e7b5c35d99e1e28fb2092298fe7778b01cf31e3 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 1 Mar 2022 01:35:37 +0000 Subject: [PATCH 14/23] rust: Fix clippy lint (cherry picked from commit b5ce94d16c26f716d5124a19160d73e8f5dd73b2) --- src/rust/src/rustzcash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/src/rustzcash.rs b/src/rust/src/rustzcash.rs index 9e9d9bd90..541ad2fad 100644 --- a/src/rust/src/rustzcash.rs +++ b/src/rust/src/rustzcash.rs @@ -156,7 +156,7 @@ pub extern "C" fn librustzcash_init_zksnark_params( let (spend_path, output_path, sprout_path) = ( Path::new(&spend_path), Path::new(&output_path), - sprout_path.as_ref().map(|p| Path::new(p)), + sprout_path.as_ref().map(Path::new), ); // Load params From 751c90879ec1c401c32f19c65346dd5c23552c4e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 5 Mar 2022 03:53:13 +0000 Subject: [PATCH 15/23] depends: Revert to `libc++ 13.0.0-3` for Windows cross-compile The 13.0.1-1 MSYS2 binaries cause linker errors due to missing `new` and `delete` symbols. This commit partially reverts the LLVM 13.0.1 upgrade: Windows cross-compilation still uses `clang 13.0.1`, but is compiled against `libc++ 13.0.0`. (cherry picked from commit fdb5709e7ebfdc617902fb05ecb090a9e766ebe7) --- depends/packages/libcxx.mk | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/depends/packages/libcxx.mk b/depends/packages/libcxx.mk index 1409fd534..bbadd228e 100644 --- a/depends/packages/libcxx.mk +++ b/depends/packages/libcxx.mk @@ -21,14 +21,15 @@ endef else # For Windows cross-compilation, use the MSYS2 binaries. +# Using 13.0.0-3 because 13.0.1-1 has missing `new` and `delete` symbols. $(package)_download_path=https://repo.msys2.org/mingw/x86_64 -$(package)_download_file=mingw-w64-x86_64-libc++-13.0.1-1-any.pkg.tar.zst -$(package)_file_name=mingw-w64-x86_64-libcxx-13.0.1-1-any.pkg.tar.zst -$(package)_sha256_hash=0a7afcd88e14d6914f21f641b752ab40b106c6173f9842e22f5a5ae4701a2858 +$(package)_download_file=mingw-w64-x86_64-libc++-13.0.0-3-any.pkg.tar.zst +$(package)_file_name=mingw-w64-x86_64-libcxx-13.0.0-3-any.pkg.tar.zst +$(package)_sha256_hash=0f8819e88273579f7c9262456c6b8f4d73e1693095c2364d1192c61c5f6a1a4f -$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-13.0.1-1-any.pkg.tar.zst -$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-13.0.1-1-any.pkg.tar.zst -$(package)_libcxxabi_sha256_hash=f937818912aa6b0250e360e866f2a7dde663d1356e9fdfebf83f6b900de89391 +$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-13.0.0-3-any.pkg.tar.zst +$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-13.0.0-3-any.pkg.tar.zst +$(package)_libcxxabi_sha256_hash=7224a7252a566938afe91ea8f130682abd29b10e13c9a3c2347af523ca0d7c42 $(package)_extra_sources += $($(package)_libcxxabi_file_name) From 8f4e853aba92a546bff4b3bd7454fbff5a958c81 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 22 Mar 2022 19:33:14 +0000 Subject: [PATCH 16/23] qa: Exclude `native_libtinfo` from dependency update checks We are pinning a specific version to get Arch builds working. (cherry picked from commit 479b10364bc14bbf2fe0c6eaa43b3bb2b35f4243) --- qa/zcash/updatecheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/zcash/updatecheck.py b/qa/zcash/updatecheck.py index cf1206c99..311fc0994 100755 --- a/qa/zcash/updatecheck.py +++ b/qa/zcash/updatecheck.py @@ -328,7 +328,9 @@ def main(): # packages.mk is not a dependency, it just specifies the list of them all. "packages", # This package doesn't have conventional version numbers - "native_cctools" + "native_cctools", + # This package is pinned specifically for Arch. + "native_libtinfo", ] print_row("NAME", "STATUS", "CURRENT VERSION", "NEWER VERSIONS") From 57d347c5fe9462ec4461f426641ac9f9469b51bb Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Tue, 29 Mar 2022 16:48:56 +0100 Subject: [PATCH 17/23] qa/zcash/updatecheck.py: print status code and response of failed http requests. Signed-off-by: Daira Hopwood (cherry picked from commit c28b00425635fa2150035a13dd4d4be4eaf4db00) --- qa/zcash/updatecheck.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qa/zcash/updatecheck.py b/qa/zcash/updatecheck.py index 311fc0994..62f73c36f 100755 --- a/qa/zcash/updatecheck.py +++ b/qa/zcash/updatecheck.py @@ -199,6 +199,8 @@ class GithubTagReleaseLister: url = "https://api.github.com/repos/" + safe(self.org) + "/" + safe(self.repo) + "/git/refs/tags" r = requests.get(url, auth=requests.auth.HTTPBasicAuth(self.token.user(), self.token.password())) if r.status_code != 200: + print("API request failed (error %d)" % (r.status_code,), file=sys.stderr) + print(r.text, file=sys.stderr) raise RuntimeError("Request to GitHub tag API failed.") json = r.json() return list(map(lambda t: t["ref"].split("/")[-1], json)) @@ -208,6 +210,8 @@ class BerkeleyDbReleaseLister: url = "https://www.oracle.com/database/technologies/related/berkeleydb-downloads.html" r = requests.get(url) if r.status_code != 200: + print("API request failed (error %d)" % (r.status_code,), file=sys.stderr) + print(r.text, file=sys.stderr) raise RuntimeError("Request to Berkeley DB download directory failed.") page = r.text From 24c20d07e4def5bc16574bc2ce69c2b3acc3a891 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Tue, 29 Mar 2022 17:00:55 +0100 Subject: [PATCH 18/23] Postpone native_clang and libcxx 14.0.0. Signed-off-by: Daira Hopwood (cherry picked from commit 5abe1b82b4b41f5755d3f8b830e5df508c775443) --- qa/zcash/postponed-updates.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qa/zcash/postponed-updates.txt b/qa/zcash/postponed-updates.txt index c4732b96a..bf08d9635 100644 --- a/qa/zcash/postponed-updates.txt +++ b/qa/zcash/postponed-updates.txt @@ -18,6 +18,8 @@ native_ccache 4.5.1 2022-05-01 native_ccache 4.6 2022-05-01 # Clang is currently pinned to LLVM 13 +native_clang 14.0.0 2022-05-01 +libcxx 14.0.0 2022-05-01 # Rust is currently pinned to 1.59.0 From adb73b33fa561dcffc98818901f2937190024a25 Mon Sep 17 00:00:00 2001 From: Charlie O'Keefe Date: Thu, 17 Mar 2022 16:13:22 -0600 Subject: [PATCH 19/23] Remove stretch (debian 9), add bullseye (debian 11) in gitian descriptor (cherry picked from commit 8c0e76e12b28b082e9ad551eafa83d979792f59f) --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 69db0cca2..f92f5a253 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -3,8 +3,8 @@ name: "zcash-4.6.0-1" enable_cache: true distro: "debian" suites: -- "stretch" - "buster" +- "bullseye" architectures: - "amd64" packages: From 4475210f87c21e30c05b83cb4d5485e2a0f6066d Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 4 Apr 2022 21:50:30 +0000 Subject: [PATCH 20/23] make-release.py: Versioning changes for 4.6.0-2. --- README.md | 2 +- configure.ac | 2 +- contrib/gitian-descriptors/gitian-linux.yml | 2 +- src/clientversion.h | 2 +- src/deprecation.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5a276efa5..70a113317 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Zcash 4.6.0-1 +Zcash 4.6.0-2 =========== diff --git a/configure.ac b/configure.ac index 4162fa308..9f26cb74c 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 4) define(_CLIENT_VERSION_MINOR, 6) define(_CLIENT_VERSION_REVISION, 0) -define(_CLIENT_VERSION_BUILD, 51) +define(_CLIENT_VERSION_BUILD, 52) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index f92f5a253..cda641a12 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -1,5 +1,5 @@ --- -name: "zcash-4.6.0-1" +name: "zcash-4.6.0-2" enable_cache: true distro: "debian" suites: diff --git a/src/clientversion.h b/src/clientversion.h index 99f24a62d..765e76f2a 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -18,7 +18,7 @@ #define CLIENT_VERSION_MAJOR 4 #define CLIENT_VERSION_MINOR 6 #define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 51 +#define CLIENT_VERSION_BUILD 52 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/deprecation.h b/src/deprecation.h index baece6442..bbf30e890 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -10,7 +10,7 @@ // Per https://zips.z.cash/zip-0200 // Shut down nodes running this version of code, 16 weeks' worth of blocks after the estimated // release block height. A warning is shown during the 14 days' worth of blocks prior to shut down. -static const int APPROX_RELEASE_HEIGHT = 1504042; +static const int APPROX_RELEASE_HEIGHT = 1540976; static const int RELEASE_TO_DEPRECATION_WEEKS = 16; static const int EXPECTED_BLOCKS_PER_HOUR = 3600 / Consensus::POST_BLOSSOM_POW_TARGET_SPACING; static_assert(EXPECTED_BLOCKS_PER_HOUR == 48, "The value of Consensus::POST_BLOSSOM_POW_TARGET_SPACING was chosen such that this assertion holds."); From 8a2c2d16b663f71664242c8be95e7a19fcc47647 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 4 Apr 2022 21:53:34 +0000 Subject: [PATCH 21/23] make-release.py: Updated manpages for 4.6.0-2. --- doc/man/zcash-cli.1 | 6 +++--- doc/man/zcash-tx.1 | 6 +++--- doc/man/zcashd.1 | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/man/zcash-cli.1 b/doc/man/zcash-cli.1 index 51ebcfcf1..cdba1ad87 100644 --- a/doc/man/zcash-cli.1 +++ b/doc/man/zcash-cli.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ZCASH-CLI "1" "January 2022" "zcash-cli v4.6.0-1" "User Commands" +.TH ZCASH-CLI "1" "April 2022" "zcash-cli v4.6.0-2" "User Commands" .SH NAME -zcash-cli \- manual page for zcash-cli v4.6.0-1 +zcash-cli \- manual page for zcash-cli v4.6.0-2 .SH DESCRIPTION -Zcash RPC client version v4.6.0\-1 +Zcash RPC client version v4.6.0\-2 .PP In order to ensure you are adequately protecting your privacy when using Zcash, please see . diff --git a/doc/man/zcash-tx.1 b/doc/man/zcash-tx.1 index ddb563fcf..78d330365 100644 --- a/doc/man/zcash-tx.1 +++ b/doc/man/zcash-tx.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ZCASH-TX "1" "January 2022" "zcash-tx v4.6.0-1" "User Commands" +.TH ZCASH-TX "1" "April 2022" "zcash-tx v4.6.0-2" "User Commands" .SH NAME -zcash-tx \- manual page for zcash-tx v4.6.0-1 +zcash-tx \- manual page for zcash-tx v4.6.0-2 .SH DESCRIPTION -Zcash zcash\-tx utility version v4.6.0\-1 +Zcash zcash\-tx utility version v4.6.0\-2 .SS "Usage:" .TP zcash\-tx [options] [commands] diff --git a/doc/man/zcashd.1 b/doc/man/zcashd.1 index cb512e41c..7eb447869 100644 --- a/doc/man/zcashd.1 +++ b/doc/man/zcashd.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ZCASHD "1" "January 2022" "zcashd v4.6.0-1" "User Commands" +.TH ZCASHD "1" "April 2022" "zcashd v4.6.0-2" "User Commands" .SH NAME -zcashd \- manual page for zcashd v4.6.0-1 +zcashd \- manual page for zcashd v4.6.0-2 .SH DESCRIPTION -Zcash Daemon version v4.6.0\-1 +Zcash Daemon version v4.6.0\-2 .PP In order to ensure you are adequately protecting your privacy when using Zcash, please see . From f1b6e499983d005eab17349a57617f833a5d87d6 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 4 Apr 2022 21:53:34 +0000 Subject: [PATCH 22/23] make-release.py: Updated release notes and changelog for 4.6.0-2. --- contrib/debian/changelog | 6 ++++ doc/authors.md | 13 ++++---- doc/release-notes/release-notes-4.6.0-2.md | 38 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 doc/release-notes/release-notes-4.6.0-2.md diff --git a/contrib/debian/changelog b/contrib/debian/changelog index 84754abf5..4d5d43922 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,3 +1,9 @@ +zcash (4.6.0+2) stable; urgency=medium + + * 4.6.0-2 release. + + -- Electric Coin Company Mon, 04 Apr 2022 21:53:34 +0000 + zcash (4.6.0+1) stable; urgency=medium * 4.6.0-1 release. diff --git a/doc/authors.md b/doc/authors.md index c7d8886dd..7a3b8f066 100644 --- a/doc/authors.md +++ b/doc/authors.md @@ -1,22 +1,22 @@ Zcash Contributors ================== -Jack Grigg (1127) +Jack Grigg (1136) Simon Liu (460) Sean Bowe (367) -Daira Hopwood (270) +Daira Hopwood (274) Eirik Ogilvie-Wigley (216) Kris Nuttycombe (181) Wladimir J. van der Laan (150) Alfredo Garcia (116) -Taylor Hornby (114) +Taylor Hornby (115) Marshall Gaucher (111) -Pieter Wuille (102) +Pieter Wuille (104) Jonas Schnelli (89) Jay Graber (89) Marco Falke (82) Cory Fields (75) -Larry Ruane (72) +Larry Ruane (73) Ying Tong Lai (56) Nathan Wilcox (56) Matt Corallo (52) @@ -38,6 +38,7 @@ Per Grön (14) Benjamin Winston (13) Pavel Janík (12) Patrick Strateman (12) +Charlie O'Keefe (12) Ariel Gabizon (12) Suhas Daftuar (11) Paige Peterson (11) @@ -46,7 +47,6 @@ Alex Morcos (11) Philip Kaufmann (10) Peter Todd (10) João Barbosa (10) -Charlie O'Keefe (10) nomnombtc (9) Marius Kjærstad (9) teor (8) @@ -94,6 +94,7 @@ Danny Willems (3) Anthony Towns (3) Alfie John (3) whythat (2) +sasha (2) rofl0r (2) ptschip (2) noname45688@gmail.com (2) diff --git a/doc/release-notes/release-notes-4.6.0-2.md b/doc/release-notes/release-notes-4.6.0-2.md new file mode 100644 index 000000000..f8f9bc2aa --- /dev/null +++ b/doc/release-notes/release-notes-4.6.0-2.md @@ -0,0 +1,38 @@ +Changelog +========= + +Charlie O'Keefe (2): + Update base image used by Dockerfile from debian 10 to debian 11 + Remove stretch (debian 9), add bullseye (debian 11) in gitian descriptor + +Daira Hopwood (4): + Avoid a warning by explicitly calling drop. + Replace call to drop with zeroization. + qa/zcash/updatecheck.py: print status code and response of failed http requests. + Postpone native_clang and libcxx 14.0.0. + +Jack Grigg (9): + qa: Bump all postponed dependencies + qa: Postpone recent CCache release + depends: Update Rust to 1.59.0 + depends: Update Clang / libcxx to LLVM 13.0.1 + rust: Fix clippy lint + depends: Revert to `libc++ 13.0.0-3` for Windows cross-compile + qa: Exclude `native_libtinfo` from dependency update checks + make-release.py: Versioning changes for 4.6.0-2. + make-release.py: Updated manpages for 4.6.0-2. + +Larry Ruane (1): + document global variables + +Pieter Wuille (2): + Fix csBestBlock/cvBlockChange waiting in rpc/mining + Modernize best block mutex/cv/hash variable naming + +Taylor Hornby (1): + Untested, not working yet, use libtinfo from the debian packages + +sasha (2): + on Arch only, use Debian's libtinfo5_6.0 to satisfy clang + remove superfluous space at end of native_packages line + From ebe6f8b26dc759c0ebf0e2d570c1448d9cf98a5b Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 4 Apr 2022 22:08:04 +0000 Subject: [PATCH 23/23] Update release notes for v4.6.0-2 --- doc/release-notes/release-notes-4.6.0-2.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/release-notes/release-notes-4.6.0-2.md b/doc/release-notes/release-notes-4.6.0-2.md index f8f9bc2aa..ae6f649f5 100644 --- a/doc/release-notes/release-notes-4.6.0-2.md +++ b/doc/release-notes/release-notes-4.6.0-2.md @@ -1,3 +1,12 @@ +This is a bugfix release that also bumps the End-of-Support height to May 16th. +It backports bugfixes from v4.7.0-rc1, including a `getblocktemplate` deadlock +fix, and several portability fixes. + +Debian 9 "Stretch" is no longer supported from v4.6.0-2, due to its +[end-of-life](https://wiki.debian.org/LTS/Stretch) on June 30th, 2022. This will +allow us to direct more resources to supporting Debian 11 Bullseye, other Linux +distributions, and other platforms such as Windows and macOS. + Changelog =========