Commit Graph

37080 Commits

Author SHA1 Message Date
fanquake
20bd591345
Merge bitcoin/bitcoin#27314: build, qt: Fix handling of CXX=clang++ when building qt package
25e8fe70c6 build, qt: Fix handling of `CXX=clang++` when building `qt` package (Hennadii Stepanov)

Pull request description:

  On the master branch (f380bb93e8):
  ```
  $ cd depends
  $ make qt CC=clang CXX=clang++
  ...
  Project ERROR: failed to parse default search paths from compiler output
  make: *** [funcs.mk:292: /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu/.qt_stamp_configured] Error 3
  ```

  Fixes https://github.com/bitcoin/bitcoin/pull/27301#issuecomment-1479622034.

  Guix builds:
  ```
  daa94946aae7d4826d6f329337791a6bda0f01ac73f27003d1677dc8de031071  guix-build-25e8fe70c6e6/output/aarch64-linux-gnu/SHA256SUMS.part
  38e9dcb99e329ad02837fd08559a8408bd7ba698f65163d0834d52dc9eefceae  guix-build-25e8fe70c6e6/output/aarch64-linux-gnu/bitcoin-25e8fe70c6e6-aarch64-linux-gnu-debug.tar.gz
  36d48b93724b112e5553a8d048c79df0532da6d271598a105038c6a5dfbce630  guix-build-25e8fe70c6e6/output/aarch64-linux-gnu/bitcoin-25e8fe70c6e6-aarch64-linux-gnu.tar.gz
  6fe9697b6c73f75b1d1ce1bf89176e4afb77a0f876cfbf72b1298660c8060c17  guix-build-25e8fe70c6e6/output/arm-linux-gnueabihf/SHA256SUMS.part
  dffe564732625f7697274f5cec89c4340327fd3094c6e22dcda39edce064b249  guix-build-25e8fe70c6e6/output/arm-linux-gnueabihf/bitcoin-25e8fe70c6e6-arm-linux-gnueabihf-debug.tar.gz
  d2fe5bb056b5d12363b2b7a2bf6dca95f2fc3734b61c770fe4919ecbf6570338  guix-build-25e8fe70c6e6/output/arm-linux-gnueabihf/bitcoin-25e8fe70c6e6-arm-linux-gnueabihf.tar.gz
  ea63144558e7f9546b771f04fec5d59814d6dc5159fdc82c6da960fdf3de328f  guix-build-25e8fe70c6e6/output/arm64-apple-darwin/SHA256SUMS.part
  579d33fb5d53789849551b25de0323714fe7d282b7506d1bcdb96690dc357911  guix-build-25e8fe70c6e6/output/arm64-apple-darwin/bitcoin-25e8fe70c6e6-arm64-apple-darwin-unsigned.dmg
  439628b325a72806d2a598c9c40811f9506b3d0ca3cd56ac327ed7f25d018f22  guix-build-25e8fe70c6e6/output/arm64-apple-darwin/bitcoin-25e8fe70c6e6-arm64-apple-darwin-unsigned.tar.gz
  8434b75c17c3e3fae9f28cfa8236191134327118c83e603783d700b0ebcf07a6  guix-build-25e8fe70c6e6/output/arm64-apple-darwin/bitcoin-25e8fe70c6e6-arm64-apple-darwin.tar.gz
  61dc9b083d63fc955f4c064348d9c49937e6cc0e969c48538b60281e0824a0f4  guix-build-25e8fe70c6e6/output/dist-archive/bitcoin-25e8fe70c6e6.tar.gz
  e31df50d868ec4ab6ecbd35ca0057a053eedd474dcc9c6287e4d225e8c0e8bee  guix-build-25e8fe70c6e6/output/powerpc64-linux-gnu/SHA256SUMS.part
  086cabfda322c5f86c128d52212ccc7276a4f6273d6acaedd949634bd211f8f4  guix-build-25e8fe70c6e6/output/powerpc64-linux-gnu/bitcoin-25e8fe70c6e6-powerpc64-linux-gnu-debug.tar.gz
  a245643fdad052b7fcc798bd1b7760540dcf47c54a9cdcc1e2f6bdb1fcc3f206  guix-build-25e8fe70c6e6/output/powerpc64-linux-gnu/bitcoin-25e8fe70c6e6-powerpc64-linux-gnu.tar.gz
  cf8f81932f8132bc26f10599cd318310b6207aea9e31a1ac41393ffc7df51801  guix-build-25e8fe70c6e6/output/powerpc64le-linux-gnu/SHA256SUMS.part
  f2fee686528ef507b5de03eb7f74f4d8a6d32338dbd7c6758795c963c6e9ce41  guix-build-25e8fe70c6e6/output/powerpc64le-linux-gnu/bitcoin-25e8fe70c6e6-powerpc64le-linux-gnu-debug.tar.gz
  84a3b3c3b76eff95f8a6f49d1e4a3c7922722c1a202d982e9e4b83f9797d1e8d  guix-build-25e8fe70c6e6/output/powerpc64le-linux-gnu/bitcoin-25e8fe70c6e6-powerpc64le-linux-gnu.tar.gz
  42b8d6fa5756e200fcd99fdad07186437403ec85098d6d3d3246d7750b6f8361  guix-build-25e8fe70c6e6/output/riscv64-linux-gnu/SHA256SUMS.part
  0e588eb81dfc7dcc472b9ea18825a6dee5967dd7f5a0f90a59d0ea2ac54bac8d  guix-build-25e8fe70c6e6/output/riscv64-linux-gnu/bitcoin-25e8fe70c6e6-riscv64-linux-gnu-debug.tar.gz
  6afcc482debcec8d3a7e32ca1216bfcd9ad4f653ace88ef39113f38bfb76e447  guix-build-25e8fe70c6e6/output/riscv64-linux-gnu/bitcoin-25e8fe70c6e6-riscv64-linux-gnu.tar.gz
  f58997be8b2dde088c80534977ad26c485c687a1e55783131da259d35b477e81  guix-build-25e8fe70c6e6/output/x86_64-apple-darwin/SHA256SUMS.part
  e7e17caa9035ba92216b591c9225b72316a65b1b6f68c85f85831d4c067e8d14  guix-build-25e8fe70c6e6/output/x86_64-apple-darwin/bitcoin-25e8fe70c6e6-x86_64-apple-darwin-unsigned.dmg
  21df826825dd3b737f373513974e5e075470b6372b5ef00f0bfb69eaa806837c  guix-build-25e8fe70c6e6/output/x86_64-apple-darwin/bitcoin-25e8fe70c6e6-x86_64-apple-darwin-unsigned.tar.gz
  81544073e667222d60591316571444b19c72be5b2e41007098b17a45e63c9691  guix-build-25e8fe70c6e6/output/x86_64-apple-darwin/bitcoin-25e8fe70c6e6-x86_64-apple-darwin.tar.gz
  b1e644cc1ce3ba5bb91ca9fa22bd7abf25b2b537c9f041416555eb4327fb6a7b  guix-build-25e8fe70c6e6/output/x86_64-linux-gnu/SHA256SUMS.part
  6942721e65ae40604e83957d19b12a6d320fa5676a5668e890db13a7b2df5102  guix-build-25e8fe70c6e6/output/x86_64-linux-gnu/bitcoin-25e8fe70c6e6-x86_64-linux-gnu-debug.tar.gz
  c0596a5625d8cd2daf3c361290be6fc58642293d44944c10fde38bff203d1225  guix-build-25e8fe70c6e6/output/x86_64-linux-gnu/bitcoin-25e8fe70c6e6-x86_64-linux-gnu.tar.gz
  ebc7bab758d37dc7a16154d24b2335aa1d261345f94eeab1ed2664bc8679f2f0  guix-build-25e8fe70c6e6/output/x86_64-w64-mingw32/SHA256SUMS.part
  38f31a70a630bf9db2616eb6732635d6b9e929ebe79a5e75c0179a5dfd9c076f  guix-build-25e8fe70c6e6/output/x86_64-w64-mingw32/bitcoin-25e8fe70c6e6-win64-debug.zip
  b84591a290e8d1d246eb56f29125bedd7b0e66eeeb875dee9c377c16ba3f7029  guix-build-25e8fe70c6e6/output/x86_64-w64-mingw32/bitcoin-25e8fe70c6e6-win64-setup-unsigned.exe
  f3b50aee206c012c663d758d5a31d0efa7186805b70c8ec79962e1d7f977de6b  guix-build-25e8fe70c6e6/output/x86_64-w64-mingw32/bitcoin-25e8fe70c6e6-win64-unsigned.tar.gz
  6d7da31b00adc5005a42983c3444f44ac13a1e0028f1db7ba07d253baf40bf9e  guix-build-25e8fe70c6e6/output/x86_64-w64-mingw32/bitcoin-25e8fe70c6e6-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    tACK 25e8fe70c6

Tree-SHA512: a773d3d4454fefd37df1c05f2227e9ff66090536af3f9ff1d5373844fbcad9666ff4d199bc990ab0190f54f34059218830c1b3472a022f88d0a4971f77f82aaf
2023-03-27 15:24:33 +01:00
fanquake
b968424c25
Merge bitcoin/bitcoin#27326: guix: combine and document enable_werror
4becee396f guix: combine and document enable_werror (fanquake)

Pull request description:

  Combine into `hardened-glibc`.
  Document why we don't use `--disable-werror` directly.

  https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
  > By default, the GNU C Library is built with -Werror. If you wish
  > to build without this option (for example, if building with a
  > newer version of GCC than this version of the GNU C Library was
  > tested with, so new warnings cause the build with -Werror to fail),
  > you can configure with --disable-werror.

ACKs for top commit:
  hebasto:
    ACK 4becee396f, the diff is correct.
  TheCharlatan:
    ACK 4becee396f

Tree-SHA512: 8724415f51b4d72d40c4e797faf52c93a81147fb629332b9388ffd7f113f2b16db3b7496bf3063dd978ac629fd5bde3ec7df4f1ff1ed714cb56f316a9334d119
2023-03-27 14:55:27 +01:00
fanquake
7fbc70395c
Merge bitcoin/bitcoin#27296: guix: import/sync python-lief (0.12.3) package definition from upstream
24f26e08cc guix: use cmake-minimal for python-lief (fanquake)
43d8173f99 guix: import LIEF from upstream (0.12.3) (fanquake)

Pull request description:

  Update to version 0.12.3.
  Retain our PPC64 patch.
  Mention when we can drop our local definition.

  Also switch to using cmake-minimal (see #27172), which fixes atleast one build failure I've seen on aarch64, where cmake dependencies fail to build. Fix that by using the cmake without all the dependencies we don't actually need:
  ```bash
  The following derivations will be built:
    /gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv
    /gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv
    /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv

  building /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv...
  / 'check' phasenote: keeping build directory `/tmp/guix-build-python-sphinx-4.2.0.drv-5'
  builder for `/gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv' failed with exit code 1
  build of /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv failed
  View build log at '/var/log/guix/drvs/3w/g6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv.gz'.
  cannot build derivation `/gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv': 1 dependencies couldn't be built
  cannot build derivation `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv': 1 dependencies couldn't be built
  guix environment: error: build of `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv' failed
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 24f26e08cc

Tree-SHA512: d4260cdf5121686fd2fa36c1fc85687848eeb26cabaad2c6566feb71a18ea7fb013cfc6353c99f6f74bc89108a9505adce513c1cfa22a0a67450e6a1c451d209
2023-03-27 14:37:16 +01:00
fanquake
3963067555
Merge bitcoin/bitcoin#26642: clang-tidy: Add more performance-* checks and related fixes
03ec5b6f9c clang-tidy: Exclude `performance-*` checks rather including them (Hennadii Stepanov)
2400437230 clang-tidy: Add `performance-type-promotion-in-math-fn` check (Hennadii Stepanov)
7e975e6cf8 clang-tidy: Add `performance-inefficient-vector-operation` check (Hennadii Stepanov)
516b75f66e clang-tidy: Add `performance-faster-string-find` check (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  martinus:
    ACK 03ec5b6f9c
  TheCharlatan:
    re-ACK [03ec5b6](03ec5b6f9c)

Tree-SHA512: 2dfa52f9131da88826f32583bfd534a56a998477db9804b7333c0e7ac0b6b36141009755c7163b9f95d0ecbf5c2cb63f8a69ce4b114bb83423faed21b50cec67
2023-03-27 14:34:52 +01:00
fanquake
3e835ca958
Merge bitcoin/bitcoin#27328: depends: fix osx build with clang 16
87afcb0029 depends: fix osx build with clang 16 (Cory Fields)

Pull request description:

  Current build (using forced system clang as a test) results in:

  > error: unknown argument: '-internal-externc-isystem/opt/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/include'

  For some reason the previous syntax worked with clang 15 and below, but clang 16 requires that the option and value are properly separated.

  See [here for an example of upstream using this syntax](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/crash-report-with-asserts.c#L9).

  There is no change in behavior for previous versions.

  I'm seeing an additional unrelated problem with linking with system clang, but I'll PR the solution to that separately as it's not as straightforward as this.

ACKs for top commit:
  TheCharlatan:
    ACK 87afcb0029
  hebasto:
    ACK 87afcb0029

Tree-SHA512: 127037c888c37c6ccd9679e96da34037cc43ccdc07915865a0a5494edb62633e83fc1bd6b1c4bb7a0322f5b59622e10090a31987f38496fb6b306488e9941594
2023-03-27 12:32:53 +01:00
fanquake
ad62bd5d6a
Merge bitcoin/bitcoin#27312: depends: qrencode 4.1.1
eb1c3adf38 depends: qrencode 4.1.1 (fanquake)

Pull request description:

  Upgrade to the latest qrencode, and disable some warnings that cause compile failures with newer compilers (clang-15+).

  I haven't tested this (from a GUI perspective) at all. This is just "good enough" to keep things compiling, and uses some similar work-arounds as we have with other older packages, i.e bdb.

  Note that upstream, libqrencode is effectively unmaintained. No code changes for > 2 years. No responses to issues/PRs. Seems like the author has mostly dropped off of GitHub as well.

  This fixes part of #27299.

ACKs for top commit:
  TheCharlatan:
    Code review ACK eb1c3adf38

Tree-SHA512: 898eaac3e9915dfcdc0a011b736fff685a3b46990bd27f6038ef4d3e7cb6a276206438ea50d45908a051ce55c9b0779347d4be1d35271b67f76f409a7dc21fed
2023-03-27 12:13:28 +01:00
Hennadii Stepanov
03ec5b6f9c
clang-tidy: Exclude performance-* checks rather including them 2023-03-26 20:18:13 +01:00
Hennadii Stepanov
2400437230
clang-tidy: Add performance-type-promotion-in-math-fn check
https://clang.llvm.org/extra/clang-tidy/checks/performance/type-promotion-in-math-fn.html
2023-03-26 20:18:03 +01:00
Hennadii Stepanov
7e975e6cf8
clang-tidy: Add performance-inefficient-vector-operation check
https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-vector-operation.html
2023-03-26 20:17:55 +01:00
Hennadii Stepanov
516b75f66e
clang-tidy: Add performance-faster-string-find check
https://clang.llvm.org/extra/clang-tidy/checks/performance/faster-string-find.html
2023-03-26 20:17:46 +01:00
Cory Fields
87afcb0029 depends: fix osx build with clang 16
For some reason the previous syntax worked with clang 15 and below, but
clang 16 requires that the option and value are properly separated.
2023-03-24 20:41:22 +00:00
fanquake
4becee396f
guix: combine and document enable_werror
Combine into hardened-glibc.
Document why we don't use --disable-werror directly.

https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
> By default, the GNU C Library is built with -Werror. If you wish
> to build without this option (for example, if building with a
> newer version of GCC than this version of the GNU C Library was
> tested with, so new warnings cause the build with -Werror to fail),
> you can configure with --disable-werror.
2023-03-24 15:35:09 +00:00
fanquake
e352f5ab6b
Merge bitcoin/bitcoin#27028: ci: Cache more stuff in the ci images: msan, iwyu, pip, sdks
faa0839837 ci: Cache more stuff in the ci images: msan, iwyu, pip, sdks (MarcoFalke)

Pull request description:

  Now that `apt` packages are cached in the ci images, it makes sense to think about caching all other packages as well.

ACKs for top commit:
  TheCharlatan:
    re-ACK faa0839837

Tree-SHA512: e2ea491570c6cdcc8522585ae7669c51ab2c0b680ff34067b58727994aa8f2e5c45ba7b76ed27a9c76d788ed155d7aade554dc164f7552fa713c00cc47b722f1
2023-03-24 12:19:18 +00:00
fanquake
873a5062db
Merge bitcoin/bitcoin#27269: test: Support decoding segwit address in address_to_scriptpubkey()
d178082996 test: add bech32 decoding support to address_to_scriptpubkey() (ismaelsadeeq)
aac8793c7a test: test_bech32_decode in address.py (ismaelsadeeq)

Pull request description:

  [rpc_scantxoutset.py](e695d8536e/test/functional/rpc_scantxoutset.py (L26))  sendtodestination only sends to legacy addresses and scriptPubkeys because  [wallet.py](e695d8536e/test/functional/test_framework/wallet.py (L415)) address_to_scriptpubkey does not support conversion of segwit address.

  This update enables address_to_scriptpubkey to support the conversion of testnet segwit addresses to scriptPubkeys.

  This change will enable [rpc_scantxoutset.py](e695d8536e/test/functional/rpc_scantxoutset.py (L22)) ScantxoutsetTest to have more test coverage by adding more sendtodestination calls with bech32 and bech32m testnet addresses, then test the bech32 and bech32m  derivation subsets UTXO amount in [Test extended key derivation](e695d8536e/test/functional/rpc_scantxoutset.py (L84)).

  I will add the test coverage in a subsequent Pull request.

ACKs for top commit:
  josibake:
    ACK d178082996
  theStack:
    ACK d178082996 ✔️
  willcl-ark:
    ACK d17808299

Tree-SHA512: 312c20ce192c648faf7dd178622700c9b871d755db56c246250e25508c3c19e7b02c0ae901dda11a1794629b9a9429c877168c05e1c4c1dbf41493316e30e7e9
2023-03-24 12:17:38 +00:00
MarcoFalke
faa0839837
ci: Cache more stuff in the ci images: msan, iwyu, pip, sdks 2023-03-24 10:19:25 +01:00
Andrew Chow
630756cac0
Merge bitcoin/bitcoin#26957: bench: update logging benchmarks
8c47d599b8 doc: improve -debuglogfile help to be a bit clearer (jonatack)
20d89d6802 bench: document expected results in logging benchmarks (jonatack)
d8deba8c36 bench: add LogPrintfCategory and LogPrintLevel benchmarks (Jon Atack)
102b203349 bench: order the logging benchmark code by output (Jon Atack)
4b3fdbf6fe bench: update logging benchmark naming for clarity (Jon Atack)
4684aa8733 bench: allow logging benchmarks to be order-independent (Larry Ruane)

Pull request description:

  Update our logging benchmarks for evaluating ongoing work like #25203 and refactoring proposals like #26619 and #26697.

  - make the logging benchmarks order-independent (Larry Ruane)
  - add missing benchmarks for the `LogPrintLevel` and `LogPrintfCategory` macros that our logging is migrating to; at some later point it should be feasible to drop some of the previous logging benchmarks
  - update the logging benchmark naming to be clear which benchmark corresponds to which log macro, and update the ordering to be the same as the output
  - add clarifying documentation to the logging benchmarks
  - improve the `-debuglogfile` config option help to be clearer; can be tested by running `./src/bitcoind -help | grep -A4 '\-debuglogfile'`

  Reviewers can run the logging benchmarks with:
  ```bash
  ./src/bench/bench_bitcoin -filter='LogP*.*'
  ```

ACKs for top commit:
  LarryRuane:
    ACK 8c47d599b8
  martinus:
    code review & tested ACK 8c47d599b8, here are my benchmark results:
  achow101:
    ACK 8c47d599b8

Tree-SHA512: 705f8720c9ceaf14a1945039c7578a0c17a12215cbc44908099af4ac444561c3f95d833c5a91b325cdd4470737d8a01e2da64db2d542dd7c9a3747fbfdbf213e
2023-03-23 17:03:39 -04:00
fanquake
2305643646
Merge bitcoin/bitcoin#27257: refactor, net: End friendship of CNode, CConnman and ConnmanTestMsg
3566aa7d49 [net] Remove CNode friends (dergoegge)
3eac5e7cd1 [net] Add CNode helper for send byte accounting (dergoegge)
60441a3432 scripted-diff: [net] Rename CNode process queue members (dergoegge)
6693c499f7 [net] Make cs_vProcessMsg a non-recursive mutex (dergoegge)
23d9352654 [net] Make CNode msg process queue members private (dergoegge)
897e342d6e [net] Encapsulate CNode message polling (dergoegge)
cc5cdf8776 [net] Deduplicate marking received message for processing (dergoegge)
ad44aa5c64 [net] Add connection type getter to CNode (dergoegge)

Pull request description:

  We should define clear interfaces between CNode, CConnman and PeerManager. This PR makes a small step in that direction by ending the friendship of CNode, CConnman and ConnmanTestMsg. CNode's message processing queue is made private in the process and its mutex is turned into a non-recursive mutex.

ACKs for top commit:
  jnewbery:
    utACK 3566aa7d49
  vasild:
    ACK 3566aa7d49
  theStack:
    re-ACK 3566aa7d49
  brunoerg:
    re-ACK 3566aa7d49

Tree-SHA512: 26b87da5054e32401b693b2904e9c5f40e35a53937c0b6cf44b8597034ad07bacf27d87cdffc54d3e7ccfebde4231ef30a38d326f88cc18133bbb34688ead567
2023-03-23 17:31:52 +00:00
glozow
381593c906
Merge bitcoin/bitcoin#24845: wallet: return error msg for "too-long-mempool-chain"
f3221d373a test: add wallet too-long-mempool-chain error coverage (furszy)
acf0119d24 wallet: return error msg for too-long-mempool-chain failure (furszy)

Pull request description:

  Fixes #23144.

  We currently return a general "Insufficient funds" from Coin
  Selection when we actually skipped unconfirmed UTXOs that
  surpassed the mempool ancestors limit.

  This PR make the error clearer by returning:
  "Unconfirmed UTXOs are available, but spending them creates
  a chain of transactions that will be rejected by the mempool"

  Also, added an early return from Coin Selection if the sum of
  the discarded coins decreases the available balance below the
  target amount.

ACKs for top commit:
  achow101:
    ACK f3221d373a
  S3RK:
    Code review ACK f3221d373a
  Xekyo:
    ACK f3221d373a

Tree-SHA512: 13e5824b75ac302280ff894560a4ebf32a74f32fe49ef8281f2bc99c0104b92cef33d3b143c6e131f3a07eafe64533af7fc60abff585142c134b9d6e531a6a66
2023-03-23 15:53:56 +00:00
fanquake
483fb8d216
Merge bitcoin/bitcoin#27287: test: Replace threading with concurrent.futures
fa0696e786 test: Replace threading with concurrent.futures (MarcoFalke)

Pull request description:

  `threading` has no easy way to get the return value or exception once the target function stops. Not checking the return value or exception can make tests more fragile and failures harder to debug.

  Fix this by checking the return value (or exception) by wrapping the function execution into a future and calling `result()` on it.

  Can be reviewed with `--ignore-all-space`.

  (There are still some uses of `threading` around, because some tests do expect an exception to be thrown and caught in the target function)

ACKs for top commit:
  ishaanam:
    ACK fa0696e786
  stickies-v:
    ACK fa0696e786

Tree-SHA512: d9ddf6b3c530cd8c485a030a3c84d4e03d3e9f9ea8240b050afcd566a884f5cabe816ac56910cec9ea9fa299239e5abb99e672dda05a74974f61bb68dc3c1d65
2023-03-23 15:09:50 +00:00
Hennadii Stepanov
25e8fe70c6
build, qt: Fix handling of CXX=clang++ when building qt package 2023-03-23 14:38:02 +00:00
fanquake
8acfb1f8e0
Merge bitcoin/bitcoin#18933: rpc: Add submit option to generateblock
fa18504d57 rpc: Add submit option to generateblock (MarcoFalke)
fab9a08e14 refactor: Replace block_hash with block_out (MarcoFalke)

Pull request description:

  When submit is turned off, a block can be generated and returned as hex, to be used for further tests. For example, it can be submitted on a different node, on a different interface (like p2p), or just never submitted and be used for other testing purposes.

ACKs for top commit:
  instagibbs:
    ACK fa18504d57
  TheCharlatan:
    tACK fa18504d57

Tree-SHA512: 1b2ab6b71bb7e155c6482d75f5373f4e77de6446cb16bc2dfd19e7a4075b3a6ad87d7ad7a049a9eed934cb71574acfd27202f54c8bb3b03fac869f2e95db7ee5
2023-03-23 13:40:30 +00:00
fanquake
f380bb93e8
Merge bitcoin/bitcoin#27311: ci: Use clang-15 in "tidy" task
8fe27fbed8 ci: Use clang-15 in "tidy" task (Hennadii Stepanov)

Pull request description:

  Newer tools usually are better in terms of features and bug fixes.

  Requested in https://github.com/bitcoin/bitcoin/pull/26642#issuecomment-1440230390.

  Split from https://github.com/bitcoin/bitcoin/pull/26766.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 8fe27fbed8

Tree-SHA512: 62be3307d488fc4f75c40c0fa095aaa091aade2d5fe85296b56751e006c801f9d58c72c5cee8c0a0b1ba1a43804e315a3301c03e6e394bb3f3eb9b763fbb6271
2023-03-23 13:27:50 +00:00
ismaelsadeeq
d178082996 test: add bech32 decoding support to address_to_scriptpubkey()
This permits functional tests to decode bech32 addresses to scriptpubkeys.
2023-03-23 12:00:54 +01:00
ismaelsadeeq
aac8793c7a test: test_bech32_decode in address.py
Adds bech32_to_bytes() which can decode a bech32 address and return the
version as an `int` and the payload in bytes.

bech32_to_bytes() is used by the test_bech32_decode unit test to test
decoding of segwit addresses.
2023-03-23 11:59:29 +01:00
fanquake
eb1c3adf38
depends: qrencode 4.1.1
Upgrade to the latest qrencode, and disable some warnings that cause
compile failures with newer compilers (clang-15+).

Fixes part of #27299.
2023-03-23 10:31:25 +00:00
fanquake
2fadb261b6
Merge bitcoin/bitcoin#27233: refactor: Replace GetTimeMicros by SystemClock
faf3f12424 refactor: Replace GetTimeMicros by SystemClock (MarcoFalke)

Pull request description:

  It is unclear from the name that `GetTimeMicros` returns the system time. Also, it is not using the type-safe `std::chrono` types.

  Fix both issues by replacing it with `SystemClock` in the only place it is used.

  This refactor should not change behavior.

ACKs for top commit:
  willcl-ark:
    tACK faf3f1242
  john-moffett:
    ACK faf3f12424 changes, but left a comment for the existing code.

Tree-SHA512: 069e6ef26467a469f128b98a4aeb334f141742befd7880cb3a7d280480e9f0684dc0686fa6a828cdcb3d11943ae5c7f8ad5d9d9dab4c668be85e5d28c78cd489
2023-03-23 10:17:23 +00:00
fanquake
4c6b7d330a
Merge bitcoin/bitcoin#27297: test: Remove unused Check* default constructors
fae349076d test: Remove unused Check* default constructors (MarcoFalke)

Pull request description:

  They are no longer needed after the removal of `swap`, see https://github.com/bitcoin/bitcoin/pull/26749#discussion_r1144532693

  Also, flatten a redundant `if` check.

ACKs for top commit:
  hebasto:
    ACK fae349076d

Tree-SHA512: c0bc0c16b5df0f16fc25e18d2414a2a3c4769da1aa30d53f8d267bc2e97dd79a0296db94c1e49cd1ca89bd42275d8c462f7bf47f03f105dfe867ebea6563454b
2023-03-22 17:58:35 +00:00
Andrew Chow
fc7c21f664
Merge bitcoin/bitcoin#27271: RPC: Fix fund transaction crash when at 0-value, 0-fee
d7cc503843 Fix fund transaction case at 0-value, 0-fee (Greg Sanders)

Pull request description:

  and when no inputs are pre-selected.

  triggered via:

  walletcreatefundedpsbt '[]' '[{"data": "deadbeef"}]' 0 '{"fee_rate": "0"}'

ACKs for top commit:
  achow101:
    ACK d7cc503843
  josibake:
    ACK d7cc503843
  furszy:
    Crashes sucks code ACK d7cc5038

Tree-SHA512: 3f5e10875666aaf52c11d6a38b951aa75d0cbe684cc7f904e199f7a864923bf31d03a654687f8b746cae0eebb886a799bff2c6d200699438480d4c0ff8785f3a
2023-03-22 12:54:26 -04:00
Hennadii Stepanov
8fe27fbed8
ci: Use clang-15 in "tidy" task 2023-03-22 15:21:39 +00:00
dergoegge
3566aa7d49 [net] Remove CNode friends
Both `CConnman` and `ConnmanTestMsg` no longer access private members of
`CNode`, we can therefore remove the friend relationship.
2023-03-22 13:18:57 +01:00
dergoegge
3eac5e7cd1 [net] Add CNode helper for send byte accounting 2023-03-22 13:18:57 +01:00
dergoegge
60441a3432 scripted-diff: [net] Rename CNode process queue members
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren cs_vProcessMsg    m_msg_process_queue_mutex
ren vProcessMsg       m_msg_process_queue
ren nProcessQueueSize m_msg_process_queue_size

-END VERIFY SCRIPT-
2023-03-22 13:18:56 +01:00
dergoegge
6693c499f7 [net] Make cs_vProcessMsg a non-recursive mutex 2023-03-22 13:18:32 +01:00
dergoegge
23d9352654 [net] Make CNode msg process queue members private
Now that all access to the process queue members is handled by methods
of `CNode` we can make these members private.
2023-03-22 13:18:32 +01:00
dergoegge
897e342d6e [net] Encapsulate CNode message polling 2023-03-22 13:18:30 +01:00
MarcoFalke
fae349076d
test: Remove unused Check* default constructors 2023-03-22 12:37:07 +01:00
fanquake
a70911492f
Merge bitcoin/bitcoin#26749: refactor: Use move semantics instead of custom swap functions
95ad70ab65 test: Default initialize `should_freeze` to `true` (Hennadii Stepanov)
cea50521fe refactor: Drop no longer used `swap` member functions (Hennadii Stepanov)
a87fb6bee5 clang-tidy: Fix modernize-use-default-member-init in `CScriptCheck` (Hennadii Stepanov)
b4bed5c1f9 refactor: Drop no longer used `CScriptCheck()` default constructor (Hennadii Stepanov)
d8427cc28e refactor: Use move semantics in `CCheckQueue::Loop` (Hennadii Stepanov)
9a0b524139 clang-tidy, test: Fix bugprone-use-after-move in `Correct_Queue_range()` (Hennadii Stepanov)
04831fee6d refactor: Make move semantics explicit for callers (Hennadii Stepanov)
6c2d5972f3 refactor: Use move semantics in `CCheckQueue::Add` (Hennadii Stepanov)
0682003214 test, refactor: Avoid `CScriptCheck::swap` in `transaction_tests` (Hennadii Stepanov)
15209d97c6 consensus, refactor: Avoid `CScriptCheck::swap` in `CheckInputScripts` (Hennadii Stepanov)

Pull request description:

  This PR makes code more succinct and readable by using move semantics.

ACKs for top commit:
  martinus:
    re-ACK 95ad70ab65
  achow101:
    ACK 95ad70ab65
  TheCharlatan:
    re-ACK 95ad70ab65
  MarcoFalke:
    re-ACK 95ad70ab65 🚥

Tree-SHA512: adda760891b12d252dc9b823fe7c41eed660364b6fb1a69f17607d7a31eb0bbb82a80d154a7acfaa241b5de37d42a293c2b6e059f26a8e92d88d3a87c99768fb
2023-03-22 11:16:56 +00:00
fanquake
6e69fead2b
Merge bitcoin/bitcoin#27280: test: Fix TypeError (expected str instance, bytes found) in wait_for_debug_log
33337eb860 test: Fix TypeError in wait_for_debug_log (MarcoFalke)

Pull request description:

ACKs for top commit:
  davidgumberg:
    tACK 33337eb860

Tree-SHA512: e641f23f0adc074d12b0ee10cab5845c16f3ac2858e42f895c69857c375fcb15c31bc1c9476bf2b6e2b49d0d2db4944687733da16d4a464152ae3323cbc6ca68
2023-03-22 10:01:01 +00:00
fanquake
24f26e08cc
guix: use cmake-minimal for python-lief
This also fixes atleast one --no-substitues build failure I've seen,
where cmake dependencies wouldn't build:
```bash
The following derivations will be built:
  /gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv
  /gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv
  /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv

building /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv...
/ 'check' phasenote: keeping build directory `/tmp/guix-build-python-sphinx-4.2.0.drv-5'
builder for `/gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv' failed with exit code 1
build of /gnu/store/3wg6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv failed
View build log at '/var/log/guix/drvs/3w/g6ya847id503m5izhzhn1qqs464lfk-python-sphinx-4.2.0.drv.gz'.
cannot build derivation `/gnu/store/f9zwh1ldy63ga0i5w6cbbqlj6sfq226j-cmake-3.21.4.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv': 1 dependencies couldn't be built
guix environment: error: build of `/gnu/store/7qqvqq2g7l5ylrjv0gn6zha565a12kar-python-lief-0.12.1.drv' failed
```
2023-03-22 09:53:13 +00:00
fanquake
43d8173f99
guix: import LIEF from upstream (0.12.3)
Updates to version 0.12.3.
Retain our PPC64 patch.
Mention when we can drop our local definition.
2023-03-22 09:52:03 +00:00
fanquake
34551cb97a
Merge bitcoin/bitcoin#27289: Refactor: Remove unused FlatFilePos::SetNull
fa67b8181c Refactor: Remove unused FlatFilePos::SetNull (MarcoFalke)

Pull request description:

  This is unused outside of tests and the default constructor. With C++11, it can be replaced by C++11 member initializers in the default constructor.

  Beside removing unused code, this also makes it less fragile in light of uninitialized memory. (See also https://github.com/bitcoin/bitcoin/pull/26296#issuecomment-1477801767)

  If new code needs to set this to null, it can use `std::optional`, or in the worst case re-introduce this method.

ACKs for top commit:
  dergoegge:
    Code review ACK fa67b8181c
  TheCharlatan:
    ACK fa67b8181c
  john-moffett:
    ACK fa67b8181c

Tree-SHA512: 465c5e3eb4625405c445695d33e09a1fc5185c7dd1e766ba06034fb093880bfc65441d5334f7d9b20e2e417c2075557d86059f59d9648ca0e62a54c699c029b9
2023-03-22 09:43:43 +00:00
Andrew Chow
664500fc71
Merge bitcoin/bitcoin#27278: Log new headers
2c3a90f663 log: on new valid header (James O'Beirne)
e5ce857634 log: net: new header over cmpctblock (James O'Beirne)

Pull request description:

  Alternate to #27276.

  Devs were [suprised to realize](https://twitter.com/jamesob/status/1637237917201383425) last night that we don't have definitive logging for when a given header was first received.

  This logs to the main stream when new headers are received outside of IBD, as well as when headers come in over cmpctblocks. The rationale of not hiding these under log categories is that they may be useful to have widely available when debugging strange network activity, and the marginal volume is modest.

ACKs for top commit:
  dergoegge:
    Code review ACK 2c3a90f663
  achow101:
    ACK 2c3a90f663
  Sjors:
    tACK 2c3a90f663
  josibake:
    ACK 2c3a90f663

Tree-SHA512: 49fdcbe07799c8adc24143d7e5054a0c93fef120d2e9d5fddbd3b119550d895e2985be6ac10dd1825ea23a6fa5479c1b76d5518c136fbd983fa76c0d39dc354f
2023-03-21 13:48:12 -04:00
Hennadii Stepanov
95ad70ab65
test: Default initialize should_freeze to true
It is safe now, when move semantics is used instead of a custom swap
function.
2023-03-21 13:05:00 +00:00
Hennadii Stepanov
cea50521fe
refactor: Drop no longer used swap member functions 2023-03-21 13:04:53 +00:00
Hennadii Stepanov
a87fb6bee5
clang-tidy: Fix modernize-use-default-member-init in CScriptCheck 2023-03-21 13:04:44 +00:00
Hennadii Stepanov
b4bed5c1f9
refactor: Drop no longer used CScriptCheck() default constructor 2023-03-21 13:04:35 +00:00
Hennadii Stepanov
d8427cc28e
refactor: Use move semantics in CCheckQueue::Loop
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
2023-03-21 13:04:21 +00:00
Hennadii Stepanov
9a0b524139
clang-tidy, test: Fix bugprone-use-after-move in Correct_Queue_range() 2023-03-21 13:04:12 +00:00
Hennadii Stepanov
04831fee6d
refactor: Make move semantics explicit for callers 2023-03-21 13:04:01 +00:00
Hennadii Stepanov
6c2d5972f3
refactor: Use move semantics in CCheckQueue::Add
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
2023-03-21 13:03:41 +00:00