From c5eb8a557ab6df4fa82fdab763cc803516d5d884 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 16 Oct 2020 14:08:24 +0200 Subject: [PATCH 01/11] Merge bitcoin-core/gui#97: Relax GUI freezes during IBD (when using wallets) 0d9d2a1f7c26dc9c7b233ea8c3182fe1f8936bca Only update the updateSmartFeeLabel once in sync (Jonas Schnelli) Pull request description: Calling `updateSmartFeeLabel` and therefore `estimateSmartFee` is pointless during IBD. GUI freezes appear because `estimateSmartFee` competes with `processBlock` for the `m_cs_fee_estimator` lock leading to multiple seconds of blocking the GUI thread in `updateSmartFeeLabel`. ACKs for top commit: ryanofsky: Code review ACK 0d9d2a1f7c26dc9c7b233ea8c3182fe1f8936bca. Clever fix. Didn't test but I remember I could reproduce the startup issue easily before by putting a sleep in estimateSmartFee. promag: Code review ACK 0d9d2a1f7c26dc9c7b233ea8c3182fe1f8936bca. hebasto: ACK 0d9d2a1f7c26dc9c7b233ea8c3182fe1f8936bca, tested on Linux Mint 20 (x86_64) with `QT_FATAL_WARNINGS=1` and `-debug=qt`. Tree-SHA512: 85ec2266f06ddd7b523e24d2a462f10ed965d5b4d479005263056f81b7fe49996e1568dafb84658af406e9202ed3bfa846d59c10bb951e0f97cee230e30fafd5 --- src/qt/sendcoinsdialog.cpp | 10 +++++++++- src/qt/sendcoinsdialog.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 14b3da5fb882..e33543396a69 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -158,7 +160,7 @@ void SendCoinsDialog::setClientModel(ClientModel *_clientModel) this->clientModel = _clientModel; if (_clientModel) { - connect(_clientModel, &ClientModel::numBlocksChanged, this, &SendCoinsDialog::updateSmartFeeLabel); + connect(_clientModel, &ClientModel::numBlocksChanged, this, &SendCoinsDialog::updateNumberOfBlocks); } } @@ -838,6 +840,12 @@ void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl) ctrl.fAllowWatchOnly = model->wallet().privateKeysDisabled(); } +void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header, SynchronizationState sync_state) { + if (sync_state == SynchronizationState::POST_INIT) { + updateSmartFeeLabel(); + } +} + void SendCoinsDialog::updateSmartFeeLabel() { if(!model || !model->getOptionsModel()) diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 30bd8af90234..c8766be9e8ba 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -19,6 +19,7 @@ class CCoinControl; class ClientModel; class SendCoinsEntry; class SendCoinsRecipient; +enum class SynchronizationState; namespace Ui { class SendCoinsDialog; @@ -101,6 +102,7 @@ private Q_SLOTS: void coinControlClipboardLowOutput(); void coinControlClipboardChange(); void updateFeeSectionControls(); + void updateNumberOfBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header, SynchronizationState sync_state); void updateSmartFeeLabel(); void keepChangeAddressChanged(bool); From 7127f8bb2b69e28b10086615ce2f4cfa9faeaac2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 24 Oct 2020 09:01:29 +0200 Subject: [PATCH 02/11] Merge bitcoin-core/gui#43: bugfix: Call setWalletActionsEnabled(true) only for the first wallet 20c9e035543892e322c7134e89eb33115678bb30 gui: Call setWalletActionsEnabled(true) only for the first wallet (Hennadii Stepanov) Pull request description: On master (a78742830aa35bf57bcb0a4730977a1e5a1876bc) there is a bug: - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected: ![Screenshot from 2020-08-03 12-38-37](https://user-images.githubusercontent.com/32963518/89169084-70060c80-d586-11ea-86b9-05ef38d08f41.png) - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong: ![Screenshot from 2020-08-03 12-42-36](https://user-images.githubusercontent.com/32963518/89169385-d68b2a80-d586-11ea-9813-a533a847e098.png) This PR fixes this bug. ACKs for top commit: jonasschnelli: Tested ACK 20c9e035543892e322c7134e89eb33115678bb30 - I could reproduce the issue on master and have verify that this PR fixes it. achow101: ACK 20c9e035543892e322c7134e89eb33115678bb30 Tree-SHA512: 2c9ab94bde8c4f413b0a95c05bf3a1a29f5910e0f99d6639a11dd77758c78af25b060b3fecd78117066ef15b113feb79870bc1347cc04289da915c00623e5787 --- src/qt/bitcoingui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 4543c1a3a1f4..bf13e714589c 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -904,13 +904,14 @@ void BitcoinGUI::addWallet(WalletModel* walletModel) { if (!walletFrame) return; if (!walletFrame->addWallet(walletModel)) return; - const QString display_name = walletModel->getDisplayName(); - setWalletActionsEnabled(true); rpcConsole->addWallet(walletModel); - m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); - if (m_wallet_selector->count() == 2) { + if (m_wallet_selector->count() == 0) { + setWalletActionsEnabled(true); + } else if (m_wallet_selector->count() == 1) { m_wallet_selector_action->setVisible(true); } + const QString display_name = walletModel->getDisplayName(); + m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); } void BitcoinGUI::removeWallet(WalletModel* walletModel) From 35d972f83cfbe9840a1db47f0c341e1397027b77 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 2 Oct 2019 07:51:38 +0800 Subject: [PATCH 03/11] Merge #17002: chainparams: Bump assumed chain params fa3a7331160d1a460b1c15fca1810e98070d629c chainparams: Bump assumed chain params (MarcoFalke) Pull request description: As every year, reviewers get extra point when their node is running: * `assumevalid=0` * `checkpoints=0` * on non-x86_64 hardware See https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-major-and-minor-release for the process. ACKs for top commit: laanwj: ACK fa3a7331160d1a460b1c15fca1810e98070d629c Sjors: ACK fa3a7331160d1a460b1c15fca1810e98070d629c for mainnet on macOS 10.14.6. jamesob: ACK https://github.com/bitcoin/bitcoin/pull/17002/commits/fa3a7331160d1a460b1c15fca1810e98070d629c fanquake: ACK fa3a7331160d1a460b1c15fca1810e98070d629c - checked the mainnet values. I have notes on reviewing `assumevalid` updates in [core-review](https://github.com/fanquake/core-review/blob/master/update-assumevalid.md). Tree-SHA512: fc545ba0a7056908040b47076b393d028c1c022967c25a2074752f76f0386ef099a64445da6125117a04418bd7eb0655121bfc94e6f60b7bc2666947491b5228 --- doc/release-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-process.md b/doc/release-process.md index 10c12d3ac6b0..457a3841d86f 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -275,7 +275,7 @@ Both variables are used as a guideline for how much space the user needs on thei Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value. To calculate `m_assumed_blockchain_size`: -- For `mainnet` -> Take the size of the Dash Core data directory, excluding `/regtest` and `/testnet3` directories. +- For `mainnet` -> Take the size of the data directory, excluding `/regtest` and `/testnet3` directories. - For `testnet` -> Take the size of the `/testnet3` directory. From 6d90ac115baf9c690e26a5ed68e3c3034c515c19 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 2 Nov 2020 15:58:22 +0100 Subject: [PATCH 04/11] Merge #20279: doc: release process updates/fixups BACKPORT NOTICE There's some extra changes that has been forgotten due to skipped bitcoin#17002 (which is DNM) ------------- e5f3e95a8e277acc54bc377a6b116d60d8c4eb5c doc: fix getchaintxstats fields in release-process.md (Jon Atack) Pull request description: ISTM the getchaintxstats fields should be `window_final_block_hash` rather than `window_last_block_hash`. While here, replace getblockchaininfo with getblockheader (and getblockhash) instead of getblockchaininfo for updating the nMinimumChainWork and defaultAssumeValid consensus params, update the example PR, and improve a link with a named anchor tag. Markdown rendering here: https://github.com/jonatack/bitcoin/blob/release-process-getchaintxstats-fix/doc/release-process.md ACKs for top commit: theStack: re-ACK e5f3e95a8e277acc54bc377a6b116d60d8c4eb5c Tree-SHA512: 48c9c65f10d65e461da8d4935af56b6c67e6faca94e4593237f754d8c48f03bef2b9b4a71e5d1009b215a415ba7c4c4218aca6dce97238101ca1c81f5d098bdb --- doc/release-process.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 457a3841d86f..c7a804e6793d 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -25,8 +25,8 @@ Before every minor and major release: Before every major release: * [ ] Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/dashpay/dash/pull/5692) for an example. -* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `m_assumed_blockchain_size` and `m_assumed_chain_state_size` with the current size plus some overhead (see [this](#how-to-calculate-m_assumed_blockchain_size-and-m_assumed_chain_state_size) for information on how to calculate them). -* [ ] Update `src/chainparams.cpp` `chainTxData` with statistics about the transaction count and rate. Use the output of the RPC `getchaintxstats`, see +* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `m_assumed_blockchain_size` and `m_assumed_chain_state_size` with the current size plus some overhead (see [this](#how-to-calculate-assumed-blockchain-and-chain-state-size) for information on how to calculate them). +* [ ] Update [`src/chainparams.cpp`](/src/chainparams.cpp) `chainTxData` with statistics about the transaction count and rate. Use the output of the `getchaintxstats` RPC, see [this pull request](https://github.com/dashpay/dash/pull/5692) for an example. Reviewers can verify the results by running `getchaintxstats ` with the `window_block_count` and `window_last_block_hash` from your output. ### First time / New builders @@ -269,7 +269,7 @@ checks. If the app is successfully notarized, the command line will include a li ### Additional information -#### How to calculate `m_assumed_blockchain_size` and `m_assumed_chain_state_size` +#### How to calculate `m_assumed_blockchain_size` and `m_assumed_chain_state_size` Both variables are used as a guideline for how much space the user needs on their drive in total, not just strictly for the blockchain. Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value. From f8e425b43735164ccd4db7a8f4b22864162e4b6a Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 19 Jun 2020 12:53:12 -0400 Subject: [PATCH 05/11] Merge #19267: ci: Upgrade most ci configs to focal fa05f44893d228f672f39436d0cb6b3376f81ac2 ci: Upgrade most ci configs to focal (MarcoFalke) fad67208914e5a74b64f4cc018368902ef3a2e9b doc: move doc to ci readme (MarcoFalke) fa880773b425fcd292ed7669d237ee3151a15bc6 ci: Have one config run in xenial to test against python3.5 (MarcoFalke) fa6ddb2fa167df52f59cb9eaabed48315ddcdb2e travis: Always run multiprocess build (MarcoFalke) Pull request description: Generally developers compile with recent compilers, so bumping the ci configs to a recent OS should be uncontroversial. Older OSes (especially with compiler sanitizers) need workarounds that can be dropped by running on a more recent OS. This pull changes the asan sanitizer and the experimental multiprocess build to use focal. Also, it runs the no_wallet config on xenial to test against python 3.5, according to `doc/dependencies.md`. Finally, all configs that mimic gitian (win and mac) will stay at bionic. ACKs for top commit: Sjors: ACK fa05f44893d228f672f39436d0cb6b3376f81ac2, assuming Travis passes hebasto: ACK fa05f44893d228f672f39436d0cb6b3376f81ac2 Tree-SHA512: 55ec56c71ba2280d27c1a8856a1e6c310b1fbf469d5a8a1dde228063e3892e1dd1e51408ecff7a3d77ac2ae018daa9e9bbbb60598cdeaab8c32a146b11b3e7c4 --- .travis.yml | 17 +---------- ci/README.md | 39 +++++++++++++++++++++---- ci/test/00_setup_env_mac_host.sh | 1 + ci/test/00_setup_env_native_asan.sh | 1 + ci/test/00_setup_env_native_nowallet.sh | 1 + ci/test/00_setup_env_native_qt5.sh | 1 + ci/test/00_setup_env_win64.sh | 1 + 7 files changed, 39 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90847c288bf4..832d5d74e830 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,9 @@ # - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback] # IPv6 support -# The test build matrix (stage: test) is constructed to test a wide range of -# configurations, rather than a single pass/fail. This helps to catch build -# failures and logic errors that present on platforms other than the ones the -# author has tested. -# -# Some builders use the dependency-generator in `./depends`, rather than using -# apt-get to install build dependencies. This guarantees that the tester is -# using the same versions as Gitian, so the build results are nearly identical -# to what would be found in a final release. -# -# In order to avoid rebuilding all dependencies for each build, the binaries -# are cached and re-used when possible. Changes in the dependency-generator -# will trigger cache-invalidation and rebuilds as necessary. -# - version: ~> 1.0 -dist: xenial +dist: bionic os: linux language: minimal diff --git a/ci/README.md b/ci/README.md index d2ea255b4bad..3c5f04c39e34 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,12 +1,8 @@ -## ci scripts +## CI Scripts This directory contains scripts for each build step in each build stage. -Currently three stages `lint`, `extended_lint` and `test` are defined. Each stage has its own lifecycle, similar to the -[Travis CI lifecycle](https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle). Every script in here is named -and numbered according to which stage and lifecycle step it belongs to. - -### Running a stage locally +### Running a Stage Locally Be aware that the tests will be built and run in-place, so please run at your own risk. If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first. @@ -36,3 +32,34 @@ To run the test stage with a specific configuration, ``` FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh ``` + +### Configurations + +The test files (`FILE_ENV`) are constructed to test a wide range of +configurations, rather than a single pass/fail. This helps to catch build +failures and logic errors that present on platforms other than the ones the +author has tested. + +Some builders use the dependency-generator in `./depends`, rather than using +the system package manager to install build dependencies. This guarantees that +the tester is using the same versions as the release builds, which also use +`./depends`. + +If no `FILE_ENV` has been specified or values are left out, `00_setup_env.sh` +is used as the default configuration with fallback values. + +It is also possible to force a specific configuration without modifying the +file. For example, + +``` +MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh +``` + +The files starting with `0n` (`n` greater than 0) are the scripts that are run +in order. + +### Cache + +In order to avoid rebuilding all dependencies for each build, the binaries are +cached and re-used when possible. Changes in the dependency-generator will +trigger cache-invalidation and rebuilds as necessary. diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index fad5ae2889da..9adb37d5f4a0 100755 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -8,6 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos export HOST=x86_64-apple-darwin +export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well) export PIP_PACKAGES="zmq lief" export RUN_SECURITY_TESTS="true" export GOAL="install" diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index a66be085c0f0..13c628a62d60 100644 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -7,6 +7,7 @@ export LC_ALL=C.UTF-8 export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev" +export DOCKER_NAME_TAG=ubuntu:20.04 export NO_DEPENDS=1 export FUNCTIONAL_TESTS_CONFIG="--exclude wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163) export RUN_BENCH=true diff --git a/ci/test/00_setup_env_native_nowallet.sh b/ci/test/00_setup_env_native_nowallet.sh index aca3c936c756..d4aeb1fde602 100755 --- a/ci/test/00_setup_env_native_nowallet.sh +++ b/ci/test/00_setup_env_native_nowallet.sh @@ -7,6 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_nowallet +export DOCKER_NAME_TAG=ubuntu:16.04 # Use xenial to have one config run the tests in python3.5, see doc/dependencies.md export PACKAGES="python3-zmq" export DEP_OPTS="NO_WALLET=1" export GOAL="install" diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index d99dda71899c..d30b4541cab7 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -7,6 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_qt5 +export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can compile our c++17 and run our functional tests in python3 export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" export DEP_OPTS="NO_UPNP=1 DEBUG=1" # TODO: we have few rpcs that aren't covered by any test, re-enable the line below once it's fixed diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index 9014e9a2f1a2..110b36e66944 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -7,6 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 +export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to win64 (bionic is used in the gitian build as well) export HOST=x86_64-w64-mingw32 export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" export DPKG_ADD_ARCH="i386" From 8085729789b597a38bbfaf4d185f5ecc15ba04d3 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sat, 13 Jan 2024 02:34:20 +0700 Subject: [PATCH 06/11] chore: dashification: drop DOCKER_NAME_TAG We have only one docker image for all functional test and this option is confusing --- ci/test/00_setup_env_arm.sh | 1 - ci/test/00_setup_env_mac_host.sh | 1 - ci/test/00_setup_env_native_asan.sh | 1 - ci/test/00_setup_env_native_fuzz.sh | 1 - ci/test/00_setup_env_native_fuzz_with_valgrind.sh | 1 - ci/test/00_setup_env_native_nowallet.sh | 1 - ci/test/00_setup_env_native_qt5.sh | 1 - ci/test/00_setup_env_s390x.sh | 1 - ci/test/00_setup_env_win64.sh | 1 - 9 files changed, 9 deletions(-) diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh index ccffcc931c4e..df207bff319e 100755 --- a/ci/test/00_setup_env_arm.sh +++ b/ci/test/00_setup_env_arm.sh @@ -18,7 +18,6 @@ if [ -n "$QEMU_USER_CMD" ]; then fi export CONTAINER_NAME=ci_arm_linux # Use debian to avoid 404 apt errors when cross compiling -export DOCKER_NAME_TAG="debian:focal" export CHECK_DOC=1 export USE_BUSY_BOX=true export RUN_UNIT_TESTS=false diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index 9adb37d5f4a0..fad5ae2889da 100755 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -8,7 +8,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos export HOST=x86_64-apple-darwin -export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well) export PIP_PACKAGES="zmq lief" export RUN_SECURITY_TESTS="true" export GOAL="install" diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index 13c628a62d60..a66be085c0f0 100644 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev" -export DOCKER_NAME_TAG=ubuntu:20.04 export NO_DEPENDS=1 export FUNCTIONAL_TESTS_CONFIG="--exclude wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163) export RUN_BENCH=true diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index 75e88a7ab5c0..43e1a0d959b2 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -6,7 +6,6 @@ export LC_ALL=C.UTF-8 -export DOCKER_NAME_TAG="ubuntu:20.04" export CONTAINER_NAME=ci_native_fuzz export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev" export DEP_OPTS="NO_UPNP=1 DEBUG=1" diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index d7692fef098d..16eb67e08a73 100644 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -6,7 +6,6 @@ export LC_ALL=C.UTF-8 -export DOCKER_NAME_TAG="ubuntu:20.04" export CONTAINER_NAME=ci_native_fuzz_valgrind export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev valgrind" export NO_DEPENDS=1 diff --git a/ci/test/00_setup_env_native_nowallet.sh b/ci/test/00_setup_env_native_nowallet.sh index d4aeb1fde602..aca3c936c756 100755 --- a/ci/test/00_setup_env_native_nowallet.sh +++ b/ci/test/00_setup_env_native_nowallet.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_nowallet -export DOCKER_NAME_TAG=ubuntu:16.04 # Use xenial to have one config run the tests in python3.5, see doc/dependencies.md export PACKAGES="python3-zmq" export DEP_OPTS="NO_WALLET=1" export GOAL="install" diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index d30b4541cab7..d99dda71899c 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_qt5 -export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can compile our c++17 and run our functional tests in python3 export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" export DEP_OPTS="NO_UPNP=1 DEBUG=1" # TODO: we have few rpcs that aren't covered by any test, re-enable the line below once it's fixed diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index de73da937cb3..7ce028f3bd75 100644 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -18,7 +18,6 @@ if [ -n "$QEMU_USER_CMD" ]; then fi # Use debian to avoid 404 apt errors export CONTAINER_NAME=ci_s390x -export DOCKER_NAME_TAG="debian:focal" export RUN_UNIT_TESTS=true export RUN_FUNCTIONAL_TESTS=true export GOAL="install" diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index 110b36e66944..9014e9a2f1a2 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 -export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to win64 (bionic is used in the gitian build as well) export HOST=x86_64-w64-mingw32 export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" export DPKG_ADD_ARCH="i386" From 7fbcba45036fd7b2631fd6bfe30d56de25fc4b8a Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 20 Aug 2020 08:29:00 +0800 Subject: [PATCH 07/11] Merge #19765: doc: Fix getmempoolancestors RPC result doc 333329dbda423b00098ec9f8702d75d24468c56e doc: Fix getmempoolancestor RPC result doc (MarcoFalke) Pull request description: ACKs for top commit: laanwj: ACK 333329dbda423b00098ec9f8702d75d24468c56e Tree-SHA512: 30a7568ec15d1af0c484b4d479e14ec3609a01b76f17f8285688b0c5e5b0480926bbf6f651da91193b66fd752e83e9707e4b08c52b69f8c670c430da84713359 --- src/rpc/blockchain.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index a6f025a1cccf..86865c274f41 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -662,8 +662,10 @@ static UniValue getmempoolancestors(const JSONRPCRequest& request) RPCResult::Type::ARR, "", "", {{RPCResult::Type::STR_HEX, "", "The transaction id of an in-mempool ancestor transaction"}}}, RPCResult{"for verbose = true", - RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription() - }, + RPCResult::Type::OBJ_DYN, "", "", + { + {RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription()}, + }}, }, RPCExamples{ HelpExampleCli("getmempoolancestors", "\"mytxid\"") @@ -697,7 +699,6 @@ static UniValue getmempoolancestors(const JSONRPCRequest& request) for (CTxMemPool::txiter ancestorIt : setAncestors) { o.push_back(ancestorIt->GetTx().GetHash().ToString()); } - return o; } else { UniValue o(UniValue::VOBJ); From 5492191904c0744c16cd838ffae2e89ed5966432 Mon Sep 17 00:00:00 2001 From: Samuel Dobson Date: Mon, 7 Sep 2020 15:44:02 +1200 Subject: [PATCH 08/11] Merge #19738: wallet: Avoid multiple BerkeleyBatch in DelAddressBook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit abac4367607d8d2b628e4db6a9663c960bacdacc wallet: Avoid multiple BerkeleyBatch in DelAddressBook (João Barbosa) Pull request description: ACKs for top commit: achow101: ACK abac4367607d8d2b628e4db6a9663c960bacdacc jonatack: ACK abac4367607d8d2b628e4db6a9663c960bacdacc meshcollider: re-utACK abac4367607d8d2b628e4db6a9663c960bacdacc Tree-SHA512: 92309fb74c48694160807326c0fe9793044a75cd77ed19400cceab54a7eefeb54ffc9334535e6021b3af7b9a364dbbeda3a9173540fff8144dfd437e96d76b5c --- src/wallet/wallet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d08052b67d19..6a6fddad9f0e 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2713,6 +2713,7 @@ std::map> CWallet::ListCoins() const const CTxOut& CWallet::FindNonChangeParentOutput(const CTransaction& tx, int output) const { + AssertLockHeld(cs_wallet); const CTransaction* ptx = &tx; int n = output; while (IsChange(ptx->vout[n]) && ptx->vin.size() > 0) { @@ -3984,6 +3985,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address) return false; } + WalletBatch batch(GetDatabase()); { LOCK(cs_wallet); @@ -3991,15 +3993,15 @@ bool CWallet::DelAddressBook(const CTxDestination& address) std::string strAddress = EncodeDestination(address); for (const std::pair &item : m_address_book[address].destdata) { - WalletBatch(GetDatabase()).EraseDestData(strAddress, item.first); + batch.EraseDestData(strAddress, item.first); } m_address_book.erase(address); } NotifyAddressBookChanged(this, address, "", IsMine(address) != ISMINE_NO, "", CT_DELETED); - WalletBatch(GetDatabase()).ErasePurpose(EncodeDestination(address)); - return WalletBatch(GetDatabase()).EraseName(EncodeDestination(address)); + batch.ErasePurpose(EncodeDestination(address)); + return batch.EraseName(EncodeDestination(address)); } size_t CWallet::KeypoolCountExternalKeys() const From 48016a3fba0c711ac428dfc5f58c0643a87ad4e6 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 8 Sep 2020 22:13:32 +0200 Subject: [PATCH 09/11] Merge #19914: refactor: Do not pass chain params to CheckForStaleTipAndEvictPeers twice fa7e407b504bc60c77341f02636ed9d6a4b53d79 Do not pass chain params to CheckForStaleTipAndEvictPeers twice (MarcoFalke) Pull request description: `PeerManager` already keeps a reference to the chain params as a member variable. No need to pass it in once again as a function parameter. ACKs for top commit: naumenkogs: utACK fa7e407b504bc60c77341f02636ed9d6a4b53d79 jnewbery: code review ACK fa7e407b504bc60c77341f02636ed9d6a4b53d79 epson121: Code review ACK fa7e407b504bc60c77341f02636ed9d6a4b53d79 Tree-SHA512: 640c2d8adf9f1d54d0bfbdf81989064be2f5ba4b534d07d42258b372dc130f7b9c3fd087c7d28f0439678d124127f5d6f82f3139b1766f59f5ed661e7ac2a923 --- src/net_processing.cpp | 9 ++++----- src/net_processing.h | 2 +- src/test/denialofservice_tests.cpp | 15 +++++++-------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3b49fc11e9c5..6aed7027d6f5 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -240,7 +240,7 @@ class PeerManagerImpl final : public PeerManager bool SendMessages(CNode* pto) override EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing); /** Implement PeerManager */ - void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams) override; + void CheckForStaleTipAndEvictPeers() override; bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) override; bool IgnoresIncomingTxs() override { return m_ignore_incoming_txs; } void RelayTransaction(const uint256& txid) override; @@ -1582,13 +1582,12 @@ PeerManagerImpl::PeerManagerImpl(const CChainParams& chainparams, CConnman& conn m_ignore_incoming_txs(ignore_incoming_txs) { assert(std::addressof(g_chainman) == std::addressof(m_chainman)); - const Consensus::Params& consensusParams = Params().GetConsensus(); // Stale tip checking and peer eviction are on two different timers, but we // don't want them to get out of sync due to drift in the scheduler, so we // combine them in one function and schedule at the quicker (peer-eviction) // timer. static_assert(EXTRA_PEER_CHECK_INTERVAL < STALE_CHECK_INTERVAL, "peer eviction timer should be less than stale tip check timer"); - scheduler.scheduleEvery([this, consensusParams] { this->CheckForStaleTipAndEvictPeers(consensusParams); }, std::chrono::seconds{EXTRA_PEER_CHECK_INTERVAL}); + scheduler.scheduleEvery([this] { this->CheckForStaleTipAndEvictPeers(); }, std::chrono::seconds{EXTRA_PEER_CHECK_INTERVAL}); // schedule next run for 10-15 minutes in the future const std::chrono::milliseconds delta = std::chrono::minutes{10} + GetRandMillis(std::chrono::minutes{5}); @@ -4611,7 +4610,7 @@ void PeerManagerImpl::EvictExtraOutboundPeers(int64_t time_in_seconds) } } -void PeerManagerImpl::CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams) +void PeerManagerImpl::CheckForStaleTipAndEvictPeers() { LOCK(cs_main); @@ -4655,7 +4654,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto) { assert(m_llmq_ctx); - const Consensus::Params& consensusParams = Params().GetConsensus(); + const Consensus::Params& consensusParams = m_chainparams.GetConsensus(); // We must call MaybeDiscourageAndDisconnect first, to ensure that we'll // disconnect misbehaving peers even before the version handshake is complete. diff --git a/src/net_processing.h b/src/net_processing.h index 1273507a9917..266514b230bd 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -68,7 +68,7 @@ class PeerManager : public CValidationInterface, public NetEventsInterface * Evict extra outbound peers. If we think our tip may be stale, connect to an extra outbound. * Public for unit testing. */ - virtual void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams) = 0; + virtual void CheckForStaleTipAndEvictPeers() = 0; /** Process a single message from a peer. Public for fuzz testing */ virtual void ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv, diff --git a/src/test/denialofservice_tests.cpp b/src/test/denialofservice_tests.cpp index b514f3d1ba63..8a47cb639657 100644 --- a/src/test/denialofservice_tests.cpp +++ b/src/test/denialofservice_tests.cpp @@ -156,7 +156,6 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management) *m_node.chainman, *m_node.mempool, *governance, m_node.cj_ctx, m_node.llmq_ctx, false); - const Consensus::Params& consensusParams = Params().GetConsensus(); constexpr int max_outbound_full_relay = MAX_OUTBOUND_FULL_RELAY_CONNECTIONS; CConnman::Options options; options.nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS; @@ -171,18 +170,18 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management) AddRandomOutboundPeer(vNodes, *peerLogic, connman.get()); } - peerLogic->CheckForStaleTipAndEvictPeers(consensusParams); + peerLogic->CheckForStaleTipAndEvictPeers(); // No nodes should be marked for disconnection while we have no extra peers for (const CNode *node : vNodes) { BOOST_CHECK(node->fDisconnect == false); } - SetMockTime(GetTime() + 3*consensusParams.nPowTargetSpacing + 1); + SetMockTime(GetTime() + 3 * chainparams.GetConsensus().nPowTargetSpacing + 1); // Now tip should definitely be stale, and we should look for an extra // outbound peer - peerLogic->CheckForStaleTipAndEvictPeers(consensusParams); + peerLogic->CheckForStaleTipAndEvictPeers(); BOOST_CHECK(connman->GetTryNewOutboundPeer()); // Still no peers should be marked for disconnection @@ -195,8 +194,8 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management) // required time connected check should be satisfied). AddRandomOutboundPeer(vNodes, *peerLogic, connman.get()); - peerLogic->CheckForStaleTipAndEvictPeers(consensusParams); - for (int i=0; iCheckForStaleTipAndEvictPeers(); + for (int i = 0; i < max_outbound_full_relay; ++i) { BOOST_CHECK(vNodes[i]->fDisconnect == false); } // Last added node should get marked for eviction @@ -208,8 +207,8 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management) // peer, and check that the next newest node gets evicted. UpdateLastBlockAnnounceTime(vNodes.back()->GetId(), GetTime()); - peerLogic->CheckForStaleTipAndEvictPeers(consensusParams); - for (int i=0; iCheckForStaleTipAndEvictPeers(); + for (int i = 0; i < max_outbound_full_relay - 1; ++i) { BOOST_CHECK(vNodes[i]->fDisconnect == false); } BOOST_CHECK(vNodes[max_outbound_full_relay-1]->fDisconnect == true); From f0d217a2a4f6a69ced2bbc26d6f939e38b49fb6d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Sep 2020 14:09:37 +0200 Subject: [PATCH 10/11] Merge #20006: Fix misleading error message: Clean stack rule af57766182013e17c23245671a33463f754ccd28 Fix misleading error message: Clean stack rule (sanket1729) Pull request description: Error messages in clean stack is misleading as it lets the user believe that there are extra elements on the stack which is incorrect if the stack is empty. Let me know if this requires additional test. ACKs for top commit: instagibbs: re-ACK https://github.com/bitcoin/bitcoin/pull/20006/commits/af57766182013e17c23245671a33463f754ccd28 gzhao408: reACK https://github.com/bitcoin/bitcoin/commit/af57766182013e17c23245671a33463f754ccd28 theStack: re-ACK af57766182013e17c23245671a33463f754ccd28 darosior: re ACK af57766182013e17c23245671a33463f754ccd28 Tree-SHA512: 88e77416e220b080246fec368f5552a891d102d072b7bee62ac560d5e31c4a8c2ee9cbe569740b253e9df177d21dc788d10d856b2a542ab47761bb81698e4082 --- src/script/script_error.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index ff84b30398a9..9870b150efe5 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -87,7 +87,7 @@ std::string ScriptErrorString(const ScriptError serror) case SCRIPT_ERR_PUBKEYTYPE: return "Public key is neither compressed or uncompressed"; case SCRIPT_ERR_CLEANSTACK: - return "Extra items left on stack after execution"; + return "Stack size must be exactly one after execution"; case SCRIPT_ERR_OP_CODESEPARATOR: return "Using OP_CODESEPARATOR"; case SCRIPT_ERR_SIG_FINDANDDELETE: From ddb14feb833519d03c1cf27084e956bcda94bb10 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 12 Oct 2020 15:06:19 +0800 Subject: [PATCH 11/11] Merge #20119: BIP155 follow-ups 56f9dba015c592b8925795012e3061a710070a27 Only relay IPv4, IPv6, Tor addresses (Pieter Wuille) 79f3d9b932bf62b90995bce1cf4b0b1f0152d26d Mention BIP155 in doc/bips.md (Pieter Wuille) Pull request description: This: * Documents BIP155 support in doc/bips.md * Restricts addrv2 relay to IPv4, IPv6, and Tor addresses. Relaying addresses in ranges that no network software has support for seems like a gratuitous spam vector. ACKs for top commit: jonatack: ACK 56f9dba015c592b8925795012e3061a710070a27 naumenkogs: ACK 56f9dba hebasto: ACK 56f9dba015c592b8925795012e3061a710070a27, verified both links. Tree-SHA512: f0a2072b3d84a05cdbc7b961c18d7322a2e7260517f5306599ff52d8c728f9167de0a59a6d66cb95d84d69f3028680ce8bd05dab0db8c4f97938a287e5ce9631 --- doc/bips.md | 4 ++-- src/net_processing.cpp | 2 ++ src/netaddress.h | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/bips.md b/doc/bips.md index 83b776b72519..70246b46e015 100644 --- a/doc/bips.md +++ b/doc/bips.md @@ -1,5 +1,5 @@ BIPs that are implemented by Bitcoin Core, some of them are relevant for Dash Core, some are just mentioned as a reference. -Specified versions, PRs are relevant to Bitcoin's core. +Versions and PRs are relevant to Bitcoin's core if not mentioned other. * [`BIP 9`](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1** ([PR #7575](https://github.com/bitcoin/bitcoin/pull/7575)) * [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)). @@ -38,7 +38,7 @@ Specified versions, PRs are relevant to Bitcoin's core. * [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)). * [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)). * [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): The 'addrv2' and 'sendaddrv2' messages which enable relay of Tor V3 addresses (and other networks) are supported as of **v18.0** ([PR 19954](https://github.com/bitcoin/bitcoin/pull/19954)). -- [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **v18.0** ([PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)). +* [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **Dash Core v18.0** ([PR dash#4314](https://github.com/dashpay/dash/pull/4314), [PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)). * [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): The `NODE_NETWORK_LIMITED` service bit is signalled as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)), and such nodes are connected to as of **v0.17.0** ([PR 10387](https://github.com/bitcoin/bitcoin/pull/10387)). * [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v18.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)). * [`BIP 339`](https://github.com/bitcoin/bips/blob/master/bip-0339.mediawiki): Relay of transactions by wtxid is supported as of **v0.21.0** ([PR 18044](https://github.com/bitcoin/bitcoin/pull/18044)). diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6aed7027d6f5..fa37eb53b535 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1896,6 +1896,8 @@ void PeerManagerImpl::RelayTransaction(const uint256& txid) static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman& connman) { + if (!fReachable && !addr.IsRelayable()) return; + // Relay to a limited number of other nodes // Use deterministic randomness to send to the same nodes for 24 hours // at a time so the m_addr_knowns of the chosen nodes prevent repeats diff --git a/src/netaddress.h b/src/netaddress.h index 2fb2b3625bb1..e0ff362dcfde 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -227,6 +227,14 @@ class CNetAddr friend bool operator!=(const CNetAddr& a, const CNetAddr& b) { return !(a == b); } friend bool operator<(const CNetAddr& a, const CNetAddr& b); + /** + * Whether this address should be relayed to other peers even if we can't reach it ourselves. + */ + bool IsRelayable() const + { + return IsIPv4() || IsIPv6() || IsTor(); + } + /** * Serialize to a stream. */