Commit graph

29306 commits

Author SHA1 Message Date
fanquake
8837f1ebde
Merge bitcoin/bitcoin#21654: build, qt: Make Qt rcc output always deterministic
a58868d201 build: Makes rcc output always deterministic (Hennadii Stepanov)

Pull request description:

  The Qt Resource Compiler ([rcc](https://doc.qt.io/qt-5/rcc.html)) has a command-line option `--format-version` which has the [default value](https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/rcc/main.cpp?h=5.12.10#n172) 2.

  The only difference from `--format-version 1` is adding a [last modified timestamp](https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/rcc/rcc.cpp?h=5.12.10#n207) to the output file ([credits](https://github.com/bitcoin/bitcoin/pull/21654#issuecomment-819198228) to **fanquake**). That, in turn, forces us to use `QT_RCC_SOURCE_DATE_OVERRIDE=1` to get deterministic builds (#13732).

  This change makes rcc output always deterministic by using `--format-version 1` option that makes usage of the
  `QT_RCC_SOURCE_DATE_OVERRIDE` needless.

  ---

  Also it improves interaction with ccache:

  On master (f6c44e999b):
  ```
  $ make && make clean && ccache --zero-stats && make && ccache --show-stats
  ...
  cache directory                     /home/hebasto/.ccache
  primary config                      /home/hebasto/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Sun Apr 11 15:45:43 2021
  stats zeroed                        Sun Apr 11 15:45:05 2021
  cache hit (direct)                   638
  cache hit (preprocessed)               0
  cache miss                             1
  cache hit rate                     99.84 %
  called for link                       10
  cleanups performed                     0
  files in cache                     20023
  cache size                          13.2 GB
  max cache size                      15.0 GB
  ```

  The missed file is always `qt/libbitcoinqt_a-qrc_bitcoin_locale.o`.

  With this PR:
  ```
  $ make && make clean && ccache --zero-stats && make && ccache --show-stats
  ...
  cache directory                     /home/hebasto/.ccache
  primary config                      /home/hebasto/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Sun Apr 11 15:28:46 2021
  stats zeroed                        Sun Apr 11 15:28:21 2021
  cache hit (direct)                   639
  cache hit (preprocessed)               0
  cache miss                             0
  cache hit rate                    100.00 %
  called for link                       10
  cleanups performed                     0
  files in cache                     20012
  cache size                          13.2 GB
  max cache size                      15.0 GB
  ```

ACKs for top commit:
  fanquake:
    ACK a58868d201

Tree-SHA512: 52f4a3267f41883d13025c0de79b6da22e92d60c729e01b986935c6812bbfe7fadc40b742bd715bfdf09df94af6838d4fbbe8208c6123f366108e38c8e1121c5
2021-06-03 21:25:30 +08:00
fanquake
fcfd37f3f9
Merge bitcoin/bitcoin#22123: depends: Fix qt.mk for mac arm64
3b36395b96 depends: Fix qt.mk for mac arm64 (João Barbosa)

Pull request description:

  With f16d4cd8c5 `depends/config.guess` gives `aarch64-apple-darwin20.3.0` where before would give `arm-apple-darwin20.3.0`. Fix `qt.mk` accordingly.

ACKs for top commit:
  hebasto:
    ACK 3b36395b96, I have reviewed the code and it looks OK, I agree it can be merged.
  fanquake:
    ACK 3b36395b96

Tree-SHA512: bd20402d0a6e9a5bb652198de189cf2b4f3f76fd03d0cba8c4d657c60b8a088cf3532efe6c1efbbedd94c00a155e6d180b77f1cd8bc24e0e35764839e8b77e30
2021-06-03 21:04:41 +08:00
fanquake
6fe012c6bd
Merge bitcoin/bitcoin#22133: build, qt: Make QWindowsVistaStylePlugin available again (regression)
ab86ac7739 build, qt: Make QWindowsVistaStylePlugin available again (regression) (Hennadii Stepanov)

Pull request description:

  This PR is similar to 1be8e0f238, and, actually, it is a #21376 follow up.

  Required as in Qt 5.12.x style plugins are separated.

  Fixes #22132.
  Fixes https://github.com/bitcoin-core/gui/issues/303.

  **Note for reviewers**. Besides visual changes in the GUI, you could compare the first dozen of lines in the `debug.log` file.

  ---

  #### Guix build:
  ```
  $ HOSTS=x86_64-w64-mingw32 contrib/guix/guix-build
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  guix-build-ab86ac7739b2/output/dist-archive/SKIPATTEST.TAG
  d3f05888c95d6cf6f4a0bac952d4c0bf1e271f49cb7ab92b08080b753957e5e5  guix-build-ab86ac7739b2/output/dist-archive/bitcoin-ab86ac7739b2.tar.gz
  113bb86ffd2854e08d3c0c5cd3f9728f2e4fe6c7a1813bc1c4b73eb48ad6597f  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win-unsigned.tar.gz
  3fdc99754d6f26d9655a308c8847076d8fd4db8d61f4f18d8ef545894a42c10d  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64-debug.zip
  932bb69e3eb1a617f9e337b83220c9d6a277bec421f4d78e32dffde5643eb00c  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64-setup-unsigned.exe
  852f4c03ad049fcd6bb2ce25b3bcf4e18b90d34f7232660024b341bd7c8dd710  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64.zip
  c6a33a193a6b128e665198dde94758acab3a5ab7fefe0c3c6617eb98ad01693d  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/inputs.SHA256SUMS
  ```

ACKs for top commit:
  laanwj:
    Concept and code review ACK ab86ac7739
  fanquake:
    ACK ab86ac7739

Tree-SHA512: 9f5498480379fad41de616da48331e123daf5b2294ca79c33ffea2b113b314634be9a2a70bf060cb5be1392a48e9d047891e1d22c129f408f1d76a0bc888441f
2021-06-03 20:40:13 +08:00
MarcoFalke
d331e262f5
Merge bitcoin/bitcoin#22138: script: fix spelling linter raising spuriously on "invokable"
8050eb43bf script: fix spelling linter raising spuriously on "invokable" (Jon Atack)

Pull request description:

  "invokable" is a valid word that means to be callable, but the linter is raising on it:
  ```
  $ test/lint/lint-spelling.sh
  contrib/guix/guix-attest:18: invokable ==> invocable
  contrib/guix/guix-clean:18: invokable ==> invocable
  contrib/guix/guix-verify:18: invokable ==> invocable
  ^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
  ```

ACKs for top commit:
  MarcoFalke:
    cr ACK 8050eb43bf

Tree-SHA512: 43f8dc7b7adb00ae563ccfe04a64a7ceb50237f24ff87209062bf57b2564b4d38a409df80e0183aa4f40ab306b5e07d7a5fad1600d41705bd3c443ed66a6d1c1
2021-06-03 14:36:40 +02:00
Jon Atack
8050eb43bf
script: fix spelling linter raising spuriously on "invokable" 2021-06-03 13:55:45 +02:00
MarcoFalke
a9435e3445
Merge bitcoin/bitcoin#22065: Mark CheckTxInputs [[nodiscard]]. Avoid UUM in fuzzing harness coins_view.
37371268d1 Mark `CheckTxInputs` `[[nodiscard]]` (out-param `txfee` only set if call is successful). Avoid UUM in fuzzing harness `coins_view`. (practicalswift)

Pull request description:

  Mark `CheckTxInputs` `[[nodiscard]]` (out-param `txfee` only set if call is successful).

  Avoid use of uninitialised memory (UUM) in fuzzing harness `coins_view`.

ACKs for top commit:
  MarcoFalke:
    review ACK 37371268d1

Tree-SHA512: edada5b2e80ce9ad3bd57b4c445bedefffa0a2d1cc880957d6848e4b7d9fc1ce036cd17f8b18bc03a36fbf84fc29c166cd6ac3dfbfe03e69d6fdbda13697754d
2021-06-03 08:53:06 +02:00
MarcoFalke
0011167191
Merge bitcoin/bitcoin#22135: CRegTestParams: Use args instead of gArgs.
5f23531926 CRegTestParams: Use `args` instead of `gArgs`. (Kiminuo)

Pull request description:

  This PR is a very minor follow-up to #13311.

  I believe that `gArgs` was just overlooked at the modified line.

ACKs for top commit:
  MarcoFalke:
    cr ACK 5f23531926

Tree-SHA512: f4e4ed6b23fca60e88825b502f20a1341ee2e4429bc8a2a7e419057adb643abda11be2061fe7ee076931657736e629aff88fd2c33737c84c330dc9d64f368c30
2021-06-03 08:14:56 +02:00
MarcoFalke
fd7a770d32
Merge bitcoin/bitcoin#22122: ci: Bump macOS image to big-sur-xcode-12.5
faa8dfd6a1 ci: Bump macOS image to big-sur-xcode-12.5 (MarcoFalke)

Pull request description:

  Closes #22068

ACKs for top commit:
  hebasto:
    ACK faa8dfd6a1, I have reviewed the code and it looks OK, I agree it can be merged, and the Cirrus CI is green.

Tree-SHA512: e29f6290163f3727f3603a3d6b4cf47677f6b02fff370e8d9073962a42bd7ab1ae8d247306e4c41bcadf0a208784344a6229627fe1a883b1e5112df30ea88635
2021-06-03 07:46:12 +02:00
Hennadii Stepanov
ab86ac7739
build, qt: Make QWindowsVistaStylePlugin available again (regression)
In Qt 5.12.x style plugins are separated.

Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
2021-06-03 00:25:01 +03:00
Kiminuo
5f23531926 CRegTestParams: Use args instead of gArgs. 2021-06-02 22:36:48 +02:00
W. J. van der Laan
2aab8a6dd0
Merge bitcoin/bitcoin#21231: Add /opt/homebrew to path to look for boost libraries
9a0969585f build: Add /opt/homebrew to path to look for boost libraries (Fu Yong Quah)

Pull request description:

  Following the instruction in https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md for building on the M1 Macs don't work out of the box, because homebrew now defaults to /opt/homebrew instead of /usr/local. This PR fixes that.

ACKs for top commit:
  jonasschnelli:
    utACK 9a0969585f
  promag:
    Tested ACK 9a0969585f.

Tree-SHA512: 472568b97fbd8623481fe6fd43b0509fa32fe7f1c1d8090321a6a6a5bdc7343d4ad4122c10dcc7c9c93068db8a3f009a73befaf1ba11e4af54a66afd2c2dbe14
2021-06-02 20:37:11 +02:00
W. J. van der Laan
1186910b6b
Merge bitcoin/bitcoin#22088: doc: improve note on choosing posix mingw32
dafab2b1b3 doc: improve note on choosing posix mingw32 (Jarol Rodriguez)

Pull request description:

  The current [windows build doc](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md) can lead someone to believe that the step where you must choose the posix mingw32 g++ compiler option is only for `Ubuntu 18.04`. It is only until you (or just me) go through the cross-compile process and realize that it's not building because you didn't set this option on > `Ubuntu 18.04`. Then you come back and read the footnotes and see: `Starting from Ubuntu Xenial 16.04...`.

  This PR improves this portion of the doc by editing the text around this stage to state "this is now the next step". We could add a note saying `Ubuntu 18.04 and up`, but this is redundant as it's unlikely someone will be using < Ubuntu 18.04 since it's not officially supported by our build system. While here, some minor fixups and add some more guidance to completing this step.

  **Master:** [render](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#building-for-64-bit-windows)
  **PR:** [render](dafab2b1b3/doc/build-windows.md (building-for-64-bit-windows))

ACKs for top commit:
  laanwj:
    ACK dafab2b1b3
  hebasto:
    ACK dafab2b1b3

Tree-SHA512: d8d50fa13c34be753700843183a1a4addad6447c813bfc039865ba11d5fa03c25206ed6f3782331df4c6a44448e3fec4138ae911b995b5cacc5b756bb5d74bb4
2021-06-02 17:01:02 +02:00
W. J. van der Laan
a7d17daa5c
Merge bitcoin/bitcoin#22086: test: remove BasicTestingSetup from unit tests that don't need it
6c3fcd5591 test: remove BasicTestingSetup from util_threadnames unit tests (fanquake)
b53d3c1b1f test: remove BasicTestingSetup from uint256 unit tests (fanquake)
c0497a4928 test: remove BasicTestingSetup from torcontrol unit tests (fanquake)
ef8bb0473b test: remove BasicTestingSetup from sync unit tests (fanquake)
1aee83421f test: remove BasicTestingSetup from reverse_lock unit tests (fanquake)
57ba949ef5 test: remove BasicTestingSetup from policy_fee unit tests (fanquake)
3974c962b6 test: remove BasicTestingSetup from merkleblock tests (fanquake)
cd5bc4b470 test: remove BasicTestingSetup from hash unit tests (fanquake)
39cec22935 test: remove BasicTestingSetup from compilerbug unit tests (fanquake)
6d3b78c0e2 test: remove BasicTestingSetup from bswap unit tests (fanquake)
a13dc24831 test: remove BasicTestingSetup from bech32 unit tests (fanquake)
f4dcbe4498 test: remove BasicTestingSetup from base64 unit tests (fanquake)
fd144f6426 test: remove BasicTestingSetup from base32 unit tests (fanquake)
4c389ba04b test: remove BasicTestingSetup from arith_uint256 unit tests (fanquake)
05590651a0 test: remove BasicTestingSetup from amount unit tests (fanquake)
883a5c7d02 test: remove BasicTestingSetup from allocator unit tests (fanquake)

Pull request description:

  * Less setup/overhead for tests that don't need it. Some naive bench-marking would suggest that a full `test_bitcoin` run is a few % faster after this change.
  * Tests which don't need the BasicTestingSetup can't accidentally end up depending on it somehow.
  * Already the case in at least the scheduler and block_filter tests.

  This adds missing includes, but more significant is the removal of `setup_common.h` from tests where it isn't needed. This saves recompiling those tests when changes are made in the header.

ACKs for top commit:
  practicalswift:
    cr ACK 6c3fcd5591: patch looks correct
  laanwj:
    ACK 6c3fcd5591

Tree-SHA512: 69b891e2b4740402d62b86a4fc98c329a432d125971342a6f97334e166b3537ed3d4cdbb2531fa05c1feae32339c9fcb2dceda9afeeaed4edc70e8caa0962161
2021-06-02 16:53:05 +02:00
W. J. van der Laan
e3d644a127
Merge bitcoin-core/gui#351: Translations update
0680460041 qt: Translations update (Hennadii Stepanov)

Pull request description:

  This is a pre-translation-string-freeze update. See [Release schedule for 22.0](https://github.com/bitcoin/bitcoin/issues/20851).

ACKs for top commit:
  laanwj:
    ACK 0680460041

Tree-SHA512: 65f11cc20e82459ca3484d4f377ff38be5ba31ba906abcb58d3e5ea56ee0eefd5e74c1ef1ea387833812bb2b9a02995dbeed7b45707e1d6db3f49e3b8055af6f
2021-06-02 12:24:12 +02:00
João Barbosa
3b36395b96 depends: Fix qt.mk for mac arm64 2021-06-02 10:02:33 +01:00
MarcoFalke
faa8dfd6a1
ci: Bump macOS image to big-sur-xcode-12.5
This also removes the "brew update" added in commit
b7381552cd.
2021-06-02 10:03:38 +02:00
MarcoFalke
2fccd9cf30
Merge bitcoin/bitcoin#22082: test: update nanobench from release 4.0.0 to 4.3.4
44d05d0a69 test: remove sanitizer suppression for nanobench (Martin Ankerl)
e3c866e3ca test: update nanobench from release 4.0.0 to 4.3.4 (Martin Ankerl)

Pull request description:

  This updates the third-party library nanobench with the latest release. It contains mostly minor bugfixes, a new pyperf output format, ability to suppress warnings with environment variable `NANOBENCH_SUPPRESS_WARNINGS`. Full changelog:

  v4.0.2
  * Changed `doNotOptimizeAway` to what google benchmark is doing. The old code did not work on some machines.
  * fix: display correct "total" value
  * minor Documentation updates

  v4.1.0
  * Updated link to new pyperf home
  * Adds ability to configure console output time unit
  *  Add support for environment variable `NANOBENCH_SUPPRESS_WARNINGS`
  * Nanobench is now usable with CMake's FetchContent (see documentation: https://nanobench.ankerl.com/tutorial.html#cmake-integration)

  v4.2.0
  * Ability to store and later compare results added, through `pyperf`.
  * See https://nanobench.ankerl.com/tutorial.html#pyperf-python-pyperf-module-output
  * Added lots of build targets to travis, similar to bitcoin's build.
  * Some minor API & documentation improvements

  v4.3.0
  * `ankerl::nanobench::Rng` can now return the state with `std::vector<uint64_t> Rng::state()`, and this can also be used to initialize the Rng.

  v4.3.1
  * Minor cmake improvements when integrationg as a third-party library: add alias `nanobench::nanobench`, default to C++17

  v4.3.2
  * Fixed a MSVC 2015 build problem
  * updates license to 2021.
  * build should now work with very old linux headers
  * Also disable UBSAN (bitcoin needed to add a suppression)

  v4.3.3
  * Do not use locale-dependent `std::to_string`

  v4.3.4
  * Add missing sanitizer suppression to `rotl`

ACKs for top commit:
  MarcoFalke:
    review ACK 44d05d0a69

Tree-SHA512: 3291c85057720cfc84a44bfaa305a7d0df4dc35779169d20de73d32e40d4cdbf3f005bf343f79710eca517441de2459e8118c195c5f5136f99d1f50ebd5dfd08
2021-06-02 09:20:16 +02:00
fanquake
a83bbf02c7
Merge bitcoin/bitcoin#22054: depends: Bump Qt version to 5.12.11
fa416cea84 depends: Bump Qt version to 5.12.11 (Hennadii Stepanov)

Pull request description:

  Qt 5.12.11:
  - [fixes](c5d904639d) macOS related [QTBUG-87014](https://bugreports.qt.io/browse/QTBUG-87014), and the `fix_bigsur_drawing.patch` (which is our workaround for QTBUG-87014) could be dropped
  - [upgrades](00326c9dc1) supported macOS SDK to 11.0, and removes related warnings
  - fixes tab widget rendering on macOS Big Sur ([here](4d6832d03f) and [here](28b015342d)):
    - master (5.12.10)
  ![DeepinScreenshot_select-area_20210525122725](https://user-images.githubusercontent.com/32963518/119474470-dd24a180-bd54-11eb-82e6-ca4d39b0b177.png)
  ![DeepinScreenshot_select-area_20210525123634](https://user-images.githubusercontent.com/32963518/119475548-ebbf8880-bd55-11eb-9c13-477016f8c23b.png)
    - this PR (5.12.11)
  ![Screenshot from 2021-05-25 12-28-02](https://user-images.githubusercontent.com/32963518/119474537-ed3c8100-bd54-11eb-8efe-7fe5ccae8a98.png)

  Closes https://github.com/bitcoin-core/gui/issues/136.

ACKs for top commit:
  goums:
    ACK fa416cea84
  fanquake:
    ACK fa416cea84 - merging this now to move it out of the way of other Qt related changes.

Tree-SHA512: 4e621b214f05d12a060757fadf2fa103c09b594d7b1c2ad9200f550e55c1e1fdf66f2f830550e724b9277448e5480be256cb0003f4597902944400e16c4a68b8
2021-06-02 12:12:33 +08:00
fanquake
0a3b8ea11a
Merge bitcoin/bitcoin#22106: refactor: address ProcessNewBlock comments from #21713
e12f287498 net: cleanup newly added PeerManagerImpl::ProcessNewBlock (fanquake)
610151f5b0 validation: change ProcessNewBlock() to take a CBlock reference (fanquake)

Pull request description:

  Addresses some [post-merge comments](https://github.com/bitcoin/bitcoin/pull/21713#pullrequestreview-638777410) from #21713. Also makes `ChainstateManager::ProcessNewBlock` take a const reference argument, as it [was asked](https://github.com/bitcoin/bitcoin/pull/21713#discussion_r615229548) why it was not the case in that PR.

ACKs for top commit:
  jnewbery:
    Code review ACK e12f287498
  MarcoFalke:
    review ACK e12f287498 🚚

Tree-SHA512: 9c3e7353240c862d50bce2a0f58741c109dd628040b56ed46250103f8ebe9009238b131da710486791e28e3a83c985057b7be0a32aed1a929269b43097c7425b
2021-06-02 10:45:47 +08:00
Hennadii Stepanov
0680460041
qt: Translations update 2021-06-01 17:09:20 +03:00
MarcoFalke
7e83e74e7f
Merge bitcoin/bitcoin#21178: test: run mempool_reorg.py even with wallet disabled
a3f0cbf82d test: run mempool_reorg.py even with wallet disabled (Darius Parvin)

Pull request description:

  Run mempool_reorg.py test even when the wallet is disabled, as discussed in #20078.

  As part of this PR I created a new method in `MiniWallet`, `create_self_transfer`, to return a raw tx (without broadcasting it) and its associated utxo.

ACKs for top commit:
  MarcoFalke:
    cr ACK a3f0cbf82d

Tree-SHA512: 316a38faffadcb87499c1d6eca21e9696cef65362bbffcf621788a9b771bb1fa2971b1c7835cbd34b952d7612ad83afbca824cd8be39ecd6b994e8963027f991
2021-06-01 15:05:45 +02:00
MarcoFalke
0b9ed3f6e7
Merge bitcoin/bitcoin#22113: test: minor cleanups in feature_cltv.py
7e32fde912 test: feature_cltv.py: don't return tx copies in modification functions (Sebastian Falbesoner)
9ab2ce0a66 test: drop unused node parameters in feature_cltv.py (Sebastian Falbesoner)
0c2139a3f1 test: fix typo in feature_cltv.py (s/ctlv/cltv/) (Sebastian Falbesoner)

Pull request description:

  This tiny PR cleans up the test `feature_cltv.py` in the following ways:
  * fixes a typo (s/ctlv/cltv/); compared to CHECKLOCKTIMEVERIFY, CHECKTIMELOCKVERIFY probably also sounds good and you [even get some search results for it](https://www.google.com/search?q=%22CHECKTIMELOCKVERIFY%22), but it's still wrong ;)
  * drops the unused "node" parameters from the tx modification functions
  * don't return a copy from the tx modification functions; it's modified in-place, hence a copy is not needed and `cltv_validate(tx, ...)` looks more natural than `tx = cltv_validate(tx, ...)`

ACKs for top commit:
  MarcoFalke:
    review ACK 7e32fde912 📼

Tree-SHA512: d2e6230977442f6a511d0f7c99431a44ad3a423647f4f327ce2ce8efe78bf9616c0d2093f5e3c3550f690dcb3f625ddf53227505c01ced70227425f249c25364
2021-06-01 14:55:56 +02:00
MarcoFalke
f63fc53c2a
Merge bitcoin/bitcoin#21767: [Bundle 6/n] Prune g_chainman usage in auxiliary modules
7a799c9c2b index: refactor-only: Reuse CChain ref (Carl Dong)
db33cde80f index: Add chainstate member to BaseIndex (Carl Dong)
f4a47a1feb bench: Use existing chainman in AssembleBlock (Carl Dong)
91226eb917 bench: Use existing NodeContext in DuplicateInputs (Carl Dong)
e6b4aa6eb5 miner: Pass in chainman to RegenerateCommitments (Carl Dong)
9ecade1425 rest: Add GetChainman function and use it (Carl Dong)
fc1c282845 rpc/blockchain: Use existing blockman in gettxoutsetinfo (Carl Dong)

Pull request description:

  Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)

  The first 2 commits are fixups addressing review for the last bundle: #21391

  NEW note:
  1. I have opened #21766 which keeps track of potential improvements where the flaws already existed before the de-globalization work, please post on that issue about these improvements, thanks!

  Note to reviewers:
  1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so:
  1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only**
  2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase**
  3. Remove `old_function`

ACKs for top commit:
  jarolrod:
    ACK  7a799c9
  ariard:
    Code Review ACK 7a799c9
  fjahr:
    re-ACK 7a799c9c2b
  MarcoFalke:
    review ACK 7a799c9c2b 🌠
  ryanofsky:
    Code review ACK 7a799c9c2b. Basically no change since last review except fixed rebase conflicts and a new comment about REST Ensure()
  jamesob:
    conditional ACK 7a799c9c2b ([`jamesob/ackr/21767.1.dongcarl.bundle_6_n_prune_g_chai`](https://github.com/jamesob/bitcoin/tree/ackr/21767.1.dongcarl.bundle_6_n_prune_g_chai))

Tree-SHA512: 531c00ddcb318817457db2812d9a9d930bc664e58e6f7f1c746350732b031dd624270bfa6b9f49d8056aeb6321d973f0e38e4ff914acd6768edd8602c017d10e
2021-06-01 13:34:18 +02:00
Martin Ankerl
44d05d0a69 test: remove sanitizer suppression for nanobench
In #21738 an ASAN suppression for nanobench was added. This is not needed any more,as nanobench.h already includes the necessary suppressions for the relevant code.
2021-06-01 12:00:21 +02:00
Martin Ankerl
e3c866e3ca test: update nanobench from release 4.0.0 to 4.3.4
This updates the third-party library nanobench with the latest release. It contains mostly minor bugfixes, a new pyperf output format, ability to suppress warnings with environment variable `NANOBENCH_SUPPRESS_WARNINGS`. Full changelog:

v4.0.2
* Changed `doNotOptimizeAway` to what google benchmark is doing. The old code did not work on some machines.
* fix: display correct "total" value
* minor Documentation updates

v4.1.0
* Updated link to new pyperf home
* Adds ability to configure console output time unit
*  Add support for environment variable `NANOBENCH_SUPPRESS_WARNINGS`
* Nanobench is now usable with CMake's FetchContent (see documentation: https://nanobench.ankerl.com/tutorial.html#cmake-integration)

v4.2.0
* Ability to store and later compare results added, through `pyperf`.
* See https://nanobench.ankerl.com/tutorial.html#pyperf-python-pyperf-module-output
* Added lots of build targets to travis, similar to bitcoin's build.
* Some minor API & documentation improvements

v4.3.0
* `ankerl::nanobench::Rng` can now return the state with `std::vector<uint64_t> Rng::state()`, and this can also be used to initialize the Rng.

v4.3.1
* Minor cmake improvements when integrationg as a third-party library: add alias `nanobench::nanobench`, default to C++17

v4.3.2
* Fixed a MSVC 2015 build problem
* updates license to 2021.
* build should now work with very old linux headers
* Also disable UBSAN (bitcoin needed to add a suppression)

v4.3.3
* Do not use locale-dependent `std::to_string`

v4.3.4
* Add missing sanitizer suppression to `rotl`
2021-06-01 12:00:00 +02:00
MarcoFalke
c91589dc2d
Merge bitcoin/bitcoin#22005: fuzz: Speed up banman fuzz target
fae0f836be fuzz: Speed up banman fuzz target (MarcoFalke)

Pull request description:

  Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34463

ACKs for top commit:
  practicalswift:
    cr ACK fae0f836be: patch looks correct and touches only `src/test/fuzz/banman.cpp`

Tree-SHA512: edbad168c607d09a5f4a29639f2d0b852605dd61403334356ad35a1eac667b6ce3922b1b316fdf37a991195fbc24e947df9e37359231663f8a364e5889e28417
2021-06-01 11:32:02 +02:00
MarcoFalke
5cf92c32d1
Merge bitcoin/bitcoin#21969: refactor: Switch serialize to uint8_t (Bundle 1/2)
ffff0d0442 refactor: Switch serialize to uint8_t (1/n) (MarcoFalke)

Pull request description:

  Replace `char` -> `uint8_t` in serialization where a sign doesn't make sense (char might be signed/unsigned).

ACKs for top commit:
  practicalswift:
    cr ACK ffff0d0442: patch looks correct and commit hash is ffffresh (was bbbbadass)
  kristapsk:
    ACK ffff0d0442

Tree-SHA512: cda682280c21d37cc3a6abd62569732079b31d18df3f157aa28bed80bd6f9f29a7db5c133b1f57b3a8f8d5ba181a76e473763c6e26a2df6d9244813f56f893ee
2021-06-01 09:01:29 +02:00
fanquake
62d9ff9e6e
Merge bitcoin/bitcoin#22107: scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds
feb72e5432 scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds (fanquake)

Pull request description:

  This PR simply renames `GetSystemTimeInSeconds` to `GetTimeSeconds`, for uniformity amongst our time handling functions (`GetTimeMillis`, `GetTimeMicros`). I have a branch that does a chunk of `GetTime()` -> `GetSystemTimeInSeconds` (`GetTimeSeconds`) / `GetTime<T>` migration, so we can eventually remove the (2 year) deprecated `GetTime()`.

  However, splitting this off and doing the renaming first while the number of `GetSystemTimeInSeconds` instances is small seems worthwhile.

ACKs for top commit:
  practicalswift:
    cr ACK feb72e5432: patch looks correct
  promag:
    Code review ACK feb72e5432.

Tree-SHA512: e2ac30be9cbcd77b70c9f74bef820b558945d0fcc6f3dc59fde68a18d08a7d36f42088b804ffe7c03478c8db048615b4c4aa65a3d8d9f5d717d59b58c99f1c54
2021-06-01 11:07:39 +08:00
Hennadii Stepanov
684e687d42
Merge bitcoin-core/gui#123: rpc: Do not accept command while executing another one
38eb37c0bd qt, rpc: Do not accept command while executing another one (Hennadii Stepanov)
0c32b9c527 qt, rpc: Accept stop RPC even another command is executing (Hennadii Stepanov)
ccf790287c qt, rpc, refactor: Return early in RPCConsole::on_lineEdit_returnPressed (Hennadii Stepanov)
5b9c8c9cdd qt, rpc: Add "Executing…" message (Hennadii Stepanov)

Pull request description:

  On master (3f512f3d56) it is possible to enter another command while the current command is still being executed. That makes a mess in the output.

  With this PR:
  ![Screenshot from 2020-10-29 20-48-55](https://user-images.githubusercontent.com/32963518/97619690-329c0880-1a29-11eb-9f5b-6ae3c02c13b2.png)

  Some previous context: https://github.com/bitcoin-core/gui/pull/59#issuecomment-715275185

  ---

  It is still possible to enter and execute the `stop` command any time.

ACKs for top commit:
  jarolrod:
    ACK  38eb37c
  promag:
    Tested ACK 38eb37c0bd.

Tree-SHA512: 2b37a4b6838bf586b1b5c878192106721f713caeb6252514a6540356aab898986396e0777e73891d331b1be797a4926c20d3f9f38ba2c984ea90d55b0c34f664
2021-06-01 03:27:29 +03:00
Hennadii Stepanov
aedf71dcc5
Merge bitcoin-core/gui#331: Make RPC console welcome message translation-friendly
0f3d955a38 qt: Make RPC console welcome message translation-friendly (Hennadii Stepanov)

Pull request description:

  The best practice is do not split a translatable multi-line message into single lines. This helps translators to follow the context.

ACKs for top commit:
  jarolrod:
    re-ACK 0f3d955a38

Tree-SHA512: 30911ff3a972a7787804bb8b27d0b77bfff15939bb478c199261866bfb55d9acd12ab4d44b8b9fc1d4898222cabc4007cc897f9b65728924d121f31e914c44ac
2021-05-31 23:43:58 +03:00
Hennadii Stepanov
38eb37c0bd
qt, rpc: Do not accept command while executing another one 2021-05-31 23:34:04 +03:00
Hennadii Stepanov
0c32b9c527
qt, rpc: Accept stop RPC even another command is executing
While here, clean up the command input by calling the trimmed function
on the input from the command prompt.
2021-05-31 23:34:04 +03:00
Hennadii Stepanov
ccf790287c
qt, rpc, refactor: Return early in RPCConsole::on_lineEdit_returnPressed 2021-05-31 23:32:59 +03:00
Hennadii Stepanov
5b9c8c9cdd
qt, rpc: Add "Executing…" message 2021-05-31 23:31:32 +03:00
MarcoFalke
933c6466c2
Merge bitcoin/bitcoin#22109: doc: Fix external links (IRC, ...)
9999e4c64b doc: Fix external links (IRC, ...) (MarcoFalke)

Pull request description:

  The freenode channel was deleted by their staff. Fix that by moving to libera chat.

  Also includes minor cosmetic fixups 🐷 💅

ACKs for top commit:
  hebasto:
    re-ACK 9999e4c64b, agree with the recent changes.
  kristapsk:
    re-ACK 9999e4c64b
  theStack:
    ACK 9999e4c64b
  jarolrod:
    ACK 9999e4c64b

Tree-SHA512: 67886783b1239153ac1631f6594fc2f873760da3c63aca400c0a84f852418d0e28de0400310f4d8b8fe213b7d4d243600607acc4a48c1662f9848f254c946cab
2021-05-31 21:12:46 +02:00
Sebastian Falbesoner
7e32fde912 test: feature_cltv.py: don't return tx copies in modification functions
The functions cltv_modify_tx(), cltv_invalidate() and cltv_validate()
all modify the passed transaction in-place, i.e. there is no need
to return a copy.
2021-05-31 19:47:30 +02:00
Sebastian Falbesoner
9ab2ce0a66 test: drop unused node parameters in feature_cltv.py
The following functions had a parameter "node" that is unsused
and hence can be removed:
    - cltv_modify_tx()
    - cltv_invalidate()
    - cltv_validate()
2021-05-31 19:34:00 +02:00
Sebastian Falbesoner
0c2139a3f1 test: fix typo in feature_cltv.py (s/ctlv/cltv/) 2021-05-31 19:18:04 +02:00
Hennadii Stepanov
11225905b7
Merge bitcoin-core/gui#309: Add access to the Peers tab from the network icon
d29ea72393 gui: Add access to the Peers tab from the network icon (Hennadii Stepanov)

Pull request description:

  This PR add a small context menu to the network activity icon that provides an access to the Peers tab:

  ![gui-network-icon](https://user-images.githubusercontent.com/32963518/116794314-d64b9b80-aad4-11eb-89ca-7f75c7442ba8.gif)

  Closes #93.

ACKs for top commit:
  Sjors:
    re-ACK d29ea72393
  kristapsk:
    re-ACK d29ea72393
  promag:
    Code review ACK d29ea72393.

Tree-SHA512: dd871415fe514a19c6a22100d58f31954d9e55b80585d5a3f26e17a8d51dadf912441786fc0d23beabd812f1b501658fec1dbe345cd41beae5832a8eda890f77
2021-05-31 19:37:44 +03:00
Darius Parvin
a3f0cbf82d test: run mempool_reorg.py even with wallet disabled
- run mempool_reorg.py even when the wallet is not compiled
- add `locktime` argument to `create_self_transfer` and `send_self_transfer`
- use more logs instead of comments
2021-05-31 09:28:10 -07:00
MarcoFalke
9999e4c64b
doc: Fix external links (IRC, ...) 2021-05-31 17:27:57 +02:00
MarcoFalke
ffff0d0442
refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
MarcoFalke
8462cd5601
Merge bitcoin/bitcoin#22080: doc: add maxuploadtarget to bitcoin.conf example
947f9734da doc: add maxuploadtarget to bitcoin.conf example (apitko)

Pull request description:

  picking up #21499, author has stated they [can't squash](https://github.com/bitcoin/bitcoin/pull/21499#issuecomment-849277632).

  This adds the maxuploadtarget option to the `bitcoin.conf` example file. This is useful for those looking to configure their bandwidth utilization.

  **Changes from Original PR:**
  - squash commits
  - fix typo in commit message + reword commit message to be more appropriate
  - Implement review suggestions ([1](https://github.com/bitcoin/bitcoin/pull/21499#discussion_r615409982), [2](https://github.com/bitcoin/bitcoin/pull/21499#discussion_r615410337), [3](https://github.com/bitcoin/bitcoin/pull/21499#pullrequestreview-659357756))
  - Fix spacing

ACKs for top commit:
  jonatack:
    ACK 947f9734da
  theStack:
    re-ACK 947f9734da

Tree-SHA512: 658ce6e1f204cd1c1c6f8977fd46ba1631f417d3f492e6d777b0ca49ffecc2ecfa4fbd86ca0e08c0dd5d6df4e32f0b56693e0a71bd7eafafd019e93bbcf9420f
2021-05-31 13:59:51 +02:00
MarcoFalke
8c6df2b4ca
Merge bitcoin/bitcoin#22095: test: Additional BIP32 test vector for hardened derivation with leading zeros
91ef8344d4 Additional test vector for hardened derivation with leading zeros (Kristaps Kaupe)

Pull request description:

  See [Inconsistent BIP32 Derivations](https://blog.polychainlabs.com/bitcoin,/bip32,/bip39,/kdf/2021/05/17/inconsistent-bip32-derivations.html) and https://github.com/bitcoin/bips/pull/1030.

ACKs for top commit:
  practicalswift:
    cr ACK 91ef8344d4
  sipa:
    ACK 91ef8344d4. Verified that it matches the linked BIP32 update, and that it indeed tests derivation from a private key with leading 0 byte.

Tree-SHA512: 0a3ae7aed15e4e08e9bec5db8de53c6c03ed3b3632f390394eea422597755173cbd2228ff0cfa57f5aae3df9d4cdf03a8ef4725cc8bce86ab7d9c82ab9d479ad
2021-05-31 13:46:42 +02:00
MarcoFalke
c5ee0cc11a
Merge bitcoin/bitcoin#21989: test: Use COINBASE_MATURITY in functional tests
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. (Kiminuo)
525448df9d Move COINBASE_MATURITY from `feature_nulldummy` test to `blocktools`. (Kiminuo)

Pull request description:

  `COINBASE_MATURITY` constant was added to `feature_nulldummy` test in #21373. This PR moves the constant to `blocktools.py` file and uses the constant in more tests as suggested [here](https://github.com/bitcoin/bitcoin/pull/21373#discussion_r605418462).

  Edit: Goal of this PR is to replace integer constants with `COINBASE_MATURITY` but not necessarily in *all* cases because that would mean to read and fully understand all tests. That's out of my time constraints. Any reports where `COINBASE_MATURITY` should be used are welcome though!

ACKs for top commit:
  theStack:
    ACK bfa9309ad6 🌇

Tree-SHA512: 01f04645f05a39028681f355cf3d42dd63ea3303f76d93c430e0fdce441934358a2d847a54e6068d61932f1b75e1d406f51859b057b3e4b569f7083915cb317f
2021-05-31 11:26:25 +02:00
fanquake
feb72e5432
scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds
-BEGIN VERIFY SCRIPT-
sed -i -e 's/GetSystemTimeInSeconds/GetTimeSeconds/g' $(git grep -l GetSystemTimeInSeconds src)
-END VERIFY SCRIPT-
2021-05-31 15:11:18 +08:00
fanquake
e12f287498
net: cleanup newly added PeerManagerImpl::ProcessNewBlock
Addresses some post-merge comments.
2021-05-31 14:36:46 +08:00
fanquake
610151f5b0
validation: change ProcessNewBlock() to take a CBlock reference
Update ProcessNewBlock arguments to newer style.
2021-05-31 14:36:46 +08:00
Kiminuo
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. 2021-05-31 07:32:28 +02:00
MarcoFalke
d7a6bba949
Merge bitcoin/bitcoin#22103: test: Fix IPv6 check on BSD systems
2be3572506 test: Fix IPv6 check on BSD systems (nthumann)

Pull request description:

  I noticed that `test_ipv6_local()` always returns `False` on macOS or FreeBSD, even though IPv6 is working perfectly fine. This causes `test/functional/rpc_bind.py --ipv6` and `test/functional/feature_proxy.py` to skip their run.
  Apparently, there's a check if the port number is `0` (see [here](64881da478/sys/netinet6/udp6_usrreq.c (L248)) or [here](8f02f2a044/bsd/netinet6/udp6_usrreq.c (L282))), while Linux has no problem with this.
  This is fixed by specifying any other port number than `0`, e.g. `1`. Still, because of `SOCK_DGRAM`, no actual connection is made.

ACKs for top commit:
  fanquake:
    ACK 2be3572506 - nice improvement. I checked that with this change ipv6 related tests in `feature_proxy.py` are being run.
  theStack:
    ACK 2be3572506

Tree-SHA512: 8417c2d3cf71050529f3fa409a03872040fe5d249eae4172f276e62156e505a20d375b963712a186c9ad7967d8a497b5900d327c74a9693f68c33063871d4691
2021-05-31 07:24:54 +02:00