From a9d4ca1f2ab568be7428d5046df5134e8821c54c Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 24 May 2019 06:46:28 -0400 Subject: [PATCH 1/7] Merge #16078: test: replace tx hash with txid in rawtransaction test 0784af16ef remove parameters -addresstype=legacy in rpc_rawtransaction test (LongShao007) a65dafa8f1 replace tx hash with txid in test rawtransaction (LongShao007) Pull request description: The transaction hash is different from txid for witness transactions, so we should use txid instead of hash. ACKs for commit 0784af: Tree-SHA512: 98b699eb5f25c3a603b11eb7072efe9bc69c0c0ecc7f996405de31bc45d92105970e09fd8e4f75b42a46498817f596d36d9b28eae7d24e63a4f2f2abfcee0eab --- test/functional/rpc_rawtransaction.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index 5162b4e2e3..306f92a130 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -42,7 +42,11 @@ class RawTransactionsTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 3 - self.extra_args = [["-txindex"], ["-txindex"], ["-txindex"]] + self.extra_args = [ + ["-txindex"], + ["-txindex"], + ["-txindex"], + ] def skip_test_if_missing_module(self): self.skip_if_no_wallet() @@ -303,30 +307,30 @@ class RawTransactionsTest(BitcoinTestFramework): # getrawtransaction tests # 1. valid parameters - only supply txid - txHash = rawTx["txid"] - assert_equal(self.nodes[0].getrawtransaction(txHash), rawTxSigned['hex']) + txId = rawTx["txid"] + assert_equal(self.nodes[0].getrawtransaction(txId), rawTxSigned['hex']) # 2. valid parameters - supply txid and 0 for non-verbose - assert_equal(self.nodes[0].getrawtransaction(txHash, 0), rawTxSigned['hex']) + assert_equal(self.nodes[0].getrawtransaction(txId, 0), rawTxSigned['hex']) # 3. valid parameters - supply txid and False for non-verbose - assert_equal(self.nodes[0].getrawtransaction(txHash, False), rawTxSigned['hex']) + assert_equal(self.nodes[0].getrawtransaction(txId, False), rawTxSigned['hex']) # 4. valid parameters - supply txid and 1 for verbose. # We only check the "hex" field of the output so we don't need to update this test every time the output format changes. - assert_equal(self.nodes[0].getrawtransaction(txHash, 1)["hex"], rawTxSigned['hex']) + assert_equal(self.nodes[0].getrawtransaction(txId, 1)["hex"], rawTxSigned['hex']) # 5. valid parameters - supply txid and True for non-verbose - assert_equal(self.nodes[0].getrawtransaction(txHash, True)["hex"], rawTxSigned['hex']) + assert_equal(self.nodes[0].getrawtransaction(txId, True)["hex"], rawTxSigned['hex']) # 6. invalid parameters - supply txid and string "Flase" - assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txHash, "Flase") + assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txId, "Flase") # 7. invalid parameters - supply txid and empty array - assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txHash, []) + assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txId, []) # 8. invalid parameters - supply txid and empty dict - assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txHash, {}) + assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txId, {}) inputs = [ {'txid' : "1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000", 'vout' : 1, 'sequence' : 1000}] outputs = { self.nodes[0].getnewaddress() : 1 } From bd4f56811704f992a4be62ce43835236d137dfc3 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 29 May 2019 13:33:28 +0200 Subject: [PATCH 2/7] Merge #16089: depends: add ability to skip building zeromq c995c870aa4cc9b9ddf0a84ce15c544757a43a18 depends: add ability to skip building zeromq (fanquake) Pull request description: Similar to other depends packages, add the ability to skip building `zeromq` by passing `NO_ZMQ=1`. Fixes #15918. ACKs for commit c995c8: practicalswift: utACK c995c870aa4cc9b9ddf0a84ce15c544757a43a18 jonasschnelli: utACK c995c870aa4cc9b9ddf0a84ce15c544757a43a18 Tree-SHA512: 72269707916d5af0bc8ecdd89f61e49264dba29350f9508fe0a497e8ce8dae66f6a828cf0bf4d97b6f95356b505cb3e6c365e8476219dd56c4535c850df393c9 --- depends/Makefile | 7 +++++++ depends/README.md | 2 ++ depends/config.site.in | 4 ++++ depends/packages/packages.mk | 4 +++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/depends/Makefile b/depends/Makefile index 6d3b1d852d..269d75eca9 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -34,6 +34,7 @@ BASE_CACHE ?= $(BASEDIR)/built SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= NO_WALLET ?= +NO_ZMQ ?= NO_UPNP ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources @@ -126,6 +127,7 @@ endif qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) +zmq_packages_$(NO_ZMQ) = $(zmq_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -134,6 +136,10 @@ ifneq ($(qt_packages_),) native_packages += $(qt_native_packages) endif +ifneq ($(zmq_packages_),) +packages += $(zmq_packages) +endif + all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk @@ -193,6 +199,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ -e 's|@no_qt@|$(NO_QT)|' \ + -e 's|@no_zmq@|$(NO_ZMQ)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ -e 's|@debug@|$(DEBUG)|' \ diff --git a/depends/README.md b/depends/README.md index 320c5673f3..caaebe66b8 100644 --- a/depends/README.md +++ b/depends/README.md @@ -79,6 +79,8 @@ The following can be set when running make: `make FOO=bar`
If a source file can't be fetched, try here before giving up
NO_QT
Don't download/build/cache qt and its dependencies
+
NO_ZMQ
+
Don't download/build/cache packages needed for enabling zeromq
NO_WALLET
Don't download/build/cache libs needed to enable the wallet
NO_UPNP
diff --git a/depends/config.site.in b/depends/config.site.in index 5cada6865d..0048f26b3e 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -43,6 +43,10 @@ if test -z $with_gui && test -n "@no_qt@"; then with_gui=no fi +if test -z $enable_zmq && test -n "@no_zmq@"; then + enable_zmq=no +fi + if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then with_gui=qt5_debug fi diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index bcabf33b15..675af7f97b 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,4 +1,4 @@ -packages:=boost openssl libevent zeromq gmp bls-dash backtrace cmake immer +packages:=boost openssl libevent gmp bls-dash backtrace cmake immer qt_native_packages = native_protobuf qt_packages = qrencode protobuf zlib @@ -10,6 +10,8 @@ qt_mingw32_packages=qt wallet_packages=bdb +zmq_packages=zeromq + upnp_packages=miniupnpc darwin_native_packages = native_biplist native_ds_store native_mac_alias From 5974914031f8a8f7d87ef21c345f13c8ac82fae2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 3 Jun 2019 23:17:29 +0200 Subject: [PATCH 3/7] Merge #16090: Qt: Add vertical spacer to peer detail widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 36b0a2f2a6b49008c4f37866a9e3ab702eb34eda Add vertical spacer (Josu Goñi) Pull request description: Before: ![image](https://user-images.githubusercontent.com/25986871/58375408-a8f22c80-7f52-11e9-96ca-14f2186e6fa7.png) After: ![image](https://user-images.githubusercontent.com/25986871/58375420-fa022080-7f52-11e9-8add-eafe98068e8d.png) ACKs for commit 36b0a2: fanquake: utACK https://github.com/bitcoin/bitcoin/pull/16090/commits/36b0a2f2a6b49008c4f37866a9e3ab702eb34eda hebasto: tACK 36b0a2f2a6b49008c4f37866a9e3ab702eb34eda on Linux Mint 19.1, Qt 5.9.5 fanquake: re-utACK https://github.com/bitcoin/bitcoin/commit/36b0a2f2a6b49008c4f37866a9e3ab702eb34eda kristapsk: ACK 36b0a2f2a6b49008c4f37866a9e3ab702eb34eda (tested with Qt 5.11.3 under Linux/Xfce4) promag: Tested ACK https://github.com/bitcoin/bitcoin/pull/16090/commits/36b0a2f2a6b49008c4f37866a9e3ab702eb34eda on macos 10.14.3. Resizing the window works as expected. Tree-SHA512: 26ec9700aa9116ec2c604f8ec7b825b30c83c1d497c21f2191d3585868db4a2e3921de607dea9f7cd9a1ea49361215d738e2aba1936566d85757d87112d73088 --- src/qt/forms/debugwindow.ui | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 627cf56fb9..24cd41ee53 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1395,6 +1395,19 @@ + + + + Qt::Vertical + + + + 20 + 10 + + + + From a92ddf2784b96d5616769c244038b8dd5bf8a78f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 3 Jun 2019 23:20:52 +0200 Subject: [PATCH 4/7] Merge #16124: tests: Limit Python linting to files in the repo 3c5254a820c892b448dfb42991f6109a032a3730 Limit Python linting to files in the repo (practicalswift) Pull request description: Limit Python linting to files in the repo. Before: ``` $ test/lint/lint-python.sh not_under_version_control.py:195:9: F841 local variable 'e' is assigned to but never used $ ``` After: ``` $ test/lint/lint-python.sh $ ``` ACKs for commit 3c5254: fanquake: tACK https://github.com/bitcoin/bitcoin/pull/16124/commits/3c5254a820c892b448dfb42991f6109a032a3730 Empact: utACK https://github.com/bitcoin/bitcoin/commit/3c5254a820c892b448dfb42991f6109a032a3730 Tree-SHA512: 68733494a5f2a7764eba938af227145f5ef9ddc9ff94840134e4d2684ca7b9a819fac491ec43102f93e5e9867373bfd46b46efc9d11528329b5ecb2282fffb16 --- test/lint/lint-python.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh index fe9bb0150e..0e3730e46d 100755 --- a/test/lint/lint-python.sh +++ b/test/lint/lint-python.sh @@ -88,4 +88,10 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then exit 0 fi -PYTHONWARNINGS="ignore" git ls-files "*.py" | xargs flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") +PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}")$( + if [[ $# == 0 ]]; then + git ls-files "*.py" + else + echo "$@" + fi +) From 053e7f74e22f4845f588ef04ba282dca976bf6a6 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 4 Jun 2019 23:23:58 +0200 Subject: [PATCH 5/7] Merge #16139: Docs: Add riscv64 to outputs list in release-process.md 6f7f141f77 Add riscv64 to outputs list in release-process.md (JeremyRand) Pull request description: The `riscv64` binary is created by the Gitian scripts and distributed by the Bitcoin Core website, so it should be listed in the release process docs. I placed it between i686 and x86_64 since it looked like the original list of Linux arches was in alphabetical order; I'm open to including it in a different position if the desire is to keep the two ARM arches together and the two x86 arches together. ACKs for commit 6f7f14: fanquake: utACK https://github.com/bitcoin/bitcoin/pull/16139/commits/6f7f141f7703215f6b4fea3660136b8c47eadacb Tree-SHA512: e87723f7bddd02e33897cfacdaac9f2e3ccc2bde74eb47d52ba1dd6082c868232e58247e427d6f95dc0b54858d8ccd1b6de47a379fce0f90b63a38bd97ebf419 --- doc/release-process.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release-process.md b/doc/release-process.md index a2a05e44a0..3bb9014fbf 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -237,6 +237,7 @@ The list of files should be: dash-${VERSION}-aarch64-linux-gnu.tar.gz dash-${VERSION}-arm-linux-gnueabihf.tar.gz dash-${VERSION}-i686-pc-linux-gnu.tar.gz +dash-${VERSION}-riscv64-linux-gnu.tar.gz dash-${VERSION}-x86_64-linux-gnu.tar.gz dash-${VERSION}-osx64.tar.gz dash-${VERSION}-osx.dmg From 5d12f44d55cc3b59bb1c89b912dfa4ecad4e33e6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 5 Jun 2019 12:47:26 +0200 Subject: [PATCH 6/7] Partial Merge #16144: wallet: do not encrypt wallets with disabled private keys 7860c98bd wallet: do not encrypt wallets with disabled private keys (whythat) Pull request description: Fix for #15635. Throw an `RPC_WALLET_ENCRYPTION_FAILED` error when attempting to encrypt wallet with disabled private keys. Changed `test/function/wallet_createwallet.py` to test new behavior. ACKs for commit 7860c9: achow101: utACK 7860c98bd59cd8f56e9b2b4ae45265c046e7cfd9 meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/16144/commits/7860c98bd59cd8f56e9b2b4ae45265c046e7cfd9 Tree-SHA512: d0cc40efd303a00d0b4d3cb2de59d8d2d7dd35647e7f3fe9d4a8986589499c1f567c5780c83a129e1ab8dbe601279c459c6ebce3b48b1d81d47a28616ef4a369 --- src/wallet/rpcwallet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 52086a3075..79de9d8008 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2179,6 +2179,10 @@ static UniValue encryptwallet(const JSONRPCRequest& request) auto locked_chain = pwallet->chain().lock(); LOCK(pwallet->cs_wallet); + if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) { + throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: wallet does not contain private keys, nothing to encrypt."); + } + if (pwallet->IsCrypted()) { throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called."); } From 8179bd5316af730b7bdd4eba0146a659edbc6d1d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 5 Jun 2019 14:31:45 +0200 Subject: [PATCH 7/7] Merge #15985: Add test for GCC bug 90348 58e291cfa Add test for GCC bug 90348 (Pieter Wuille) Pull request description: This adds a test for GCC bug 90348 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348), using a test case extracted from our own `sha256d64` test in crypto_tests.cpp, which was failing on some platforms. This is based on top of #15983 to make sure the bug doesn't trigger (it does in some Travis configurations without it). ACKs for commit 58e291: Tree-SHA512: 4dc9084e92dd143a53930e42bb68e33d922a2a2b891406b259d3a0bed4511dcc49e7447a7a8e4eb793a26e3eacb188ca293b71e0e061f9b3230f8e7fcfd29525 --- src/Makefile.test.include | 1 + src/test/compilerbug_tests.cpp | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/test/compilerbug_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index dea6ce6f09..d7721d82f8 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -132,6 +132,7 @@ BITCOIN_TESTS =\ test/cachemap_tests.cpp \ test/cachemultimap_tests.cpp \ test/coins_tests.cpp \ + test/compilerbug_tests.cpp \ test/compress_tests.cpp \ test/crypto_tests.cpp \ test/cuckoocache_tests.cpp \ diff --git a/src/test/compilerbug_tests.cpp b/src/test/compilerbug_tests.cpp new file mode 100644 index 0000000000..74e1eac3ea --- /dev/null +++ b/src/test/compilerbug_tests.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2019 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include + +BOOST_FIXTURE_TEST_SUITE(compilerbug_tests, BasicTestingSetup) + +#if defined(__GNUC__) +// This block will also be built under clang, which is fine (as it supports noinline) +void __attribute__ ((noinline)) set_one(unsigned char* ptr) +{ + *ptr = 1; +} + +int __attribute__ ((noinline)) check_zero(unsigned char const* in, unsigned int len) +{ + for (unsigned int i = 0; i < len; ++i) { + if (in[i] != 0) return 0; + } + return 1; +} + +void set_one_on_stack() { + unsigned char buf[1]; + set_one(buf); +} + +BOOST_AUTO_TEST_CASE(gccbug_90348) { + // Test for GCC bug 90348. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348 + for (int i = 0; i <= 4; ++i) { + unsigned char in[4]; + for (int j = 0; j < i; ++j) { + in[j] = 0; + set_one_on_stack(); // Apparently modifies in[0] + } + BOOST_CHECK(check_zero(in, i)); + } +} +#endif + +BOOST_AUTO_TEST_SUITE_END()