Commit graph

43420 commits

Author SHA1 Message Date
MarcoFalke
faae6fa5f6
refactor: Simplify SpanPopBack
Use the equivalent back() and first() member functions.
2024-12-19 13:46:52 +01:00
MarcoFalke
facc4f120b
refactor: Replace fwd-decl with proper include
This is fine, because the span.h include is lightweight and a proper
include will be needed anyway when switching to std::span.
2024-12-19 13:46:43 +01:00
MarcoFalke
fac3a782ea
refactor: Avoid needless, unsafe c-style cast 2024-12-19 13:46:31 +01:00
Ryan Ofsky
477b357460
Merge bitcoin/bitcoin#31493: refactor: Use immediate lambda to work around GCC bug 117966
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
fa9e0489f5 refactor: Use immediate lambda to work around GCC bug 117966 (MarcoFalke)

Pull request description:

  Currently the libstdc++ debug mode can only be used with version 11, or 15 (and later), due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117966

  This seems restrictive.

  Add a temporary workaround for now, which makes the global (temporary) `std::span` local to a lambda.

ACKs for top commit:
  theuni:
    utACK fa9e0489f5
  hebasto:
    ACK fa9e0489f5, tested on Ubuntu 24.10.
  vasild:
    ACK fa9e0489f5

Tree-SHA512: 0cc54f089f329592f7a92a6f938b7de46c92d5362615310748225a42789e858e871432721e3101271b00871d523af5fbaadba2f52433fe79e928b1d1253931f6
2024-12-17 13:32:21 -05:00
Ryan Ofsky
a60d5702fd
Merge bitcoin/bitcoin#31486: fuzz: Abort when using global PRNG without re-seed
fae63bf130 fuzz: Clarify that only SeedRandomStateForTest(SeedRand::ZEROS) is allowed (MarcoFalke)
fa18acb457 fuzz: Abort when using global PRNG without re-seed (MarcoFalke)
fa7809aeab fuzz: Add missing SeedRandomStateForTest(SeedRand::ZEROS) (MarcoFalke)

Pull request description:

  This is the first step toward improving fuzz stability and determinism (https://github.com/bitcoin/bitcoin/issues/29018).

  A fuzz target using the global test-only PRNG will now abort if the seed is re-used across fuzz inputs.

  Also, temporarily add `SeedRandomStateForTest(SeedRand::ZEROS)` to all affected fuzz targets. This may slow down the libfuzzer leak detector, but it will disable itself after some time, or it can be disabled explicitly with `-detect_leaks=0`.

  In a follow-up, each affected fuzz target can be stripped of the global random use and a local `RandomMixin` (or similar) can be added instead.

  (Can be tested by removing any one of the re-seed calls and observing a fuzz abort)

ACKs for top commit:
  hodlinator:
    ACK fae63bf130
  dergoegge:
    utACK fae63bf130
  marcofleon:
    Tested ACK fae63bf130

Tree-SHA512: 4a0db69af7f715408edf4f8b08b44f34ce12ee2c79d33b336ad19a6e6bd079c4ff7c971af0a3efa428213407c1171f4e2837ec6a2577086c2f94cd15618a0892
2024-12-17 12:55:38 -05:00
Ryan Ofsky
a95a8ba3a3
Merge bitcoin/bitcoin#31197: refactor: mining interface 30955 followups
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
f86678156a Check leaves size maximum in MerkleComputation (Sjors Provoost)
4d57288246 refactor: use CTransactionRef in submitSolution (Sjors Provoost)
2e81791d90 Drop TransactionMerklePath default position arg (Sjors Provoost)
39d3b538e6 Rename merkle branch to path (Sjors Provoost)

Pull request description:

  This PR implements the refactors suggested in https://github.com/bitcoin/bitcoin/pull/30955#pullrequestreview-2354931253.

ACKs for top commit:
  tdb3:
    code review re-ACK f86678156a
  itornaza:
    re ACK f86678156a
  ryanofsky:
    Code review ACK f86678156a only changes since last review are a whitespace change and adding an Assume statement to check for size_t -> uint32_t overflows

Tree-SHA512: 661b5d5d0e24b2269bf33ab1484e37c36e67b32a7796d77ca3b1856d3043378b081ad43c32a8638b46fa8c0de51c823fd9747dd9fc81f958f20d327bf330a47c
2024-12-17 12:32:45 -05:00
Ryan Ofsky
cd3d9fa5ea
Merge bitcoin/bitcoin#31318: Drop script_pub_key arg from createNewBlock
52fd1511a7 test: drop scriptPubKeyIn arg from CreateNewBlock (Sjors Provoost)
ff41b9e296 Drop script_pub_key arg from createNewBlock (Sjors Provoost)
7ab733ede4 rpc: rename coinbase_script to coinbase_output_script (Sjors Provoost)

Pull request description:

  Providing a script for the coinbase transaction is only done in test code and for (unoptimized) CPU solo mining.

  Production miners use the `getblocktemplate` RPC which omits the coinbase transaction entirely from its block template, leaving it to external (pool) software to construct it.

  This commit removes the `script_pub_key argument` from `createNewBlock()` in the Mining interface.

  A coinbase script can still be passed via `BlockCreateOptions` instead. Tests are modified to do so.

ACKs for top commit:
  ryanofsky:
    Code review ACK 52fd1511a7. No change since last review other than rebase
  TheCharlatan:
    Re-ACK 52fd1511a7
  vasild:
    ACK 52fd1511a7

Tree-SHA512: c4b3a53774d9a5dc90950e77f47a64dbb68f971baffbb9a0d8f59332ef8e52d0c039130c925bde73135b3d0e79e65d91d1df30dc4cff13f32d8a72e5c56669d8
2024-12-17 11:50:44 -05:00
merge-script
785486a975
Merge bitcoin/bitcoin#31489: fuzz: Fix test_runner error reporting
fa0e30b93a fuzz: Fix test_runner error reporting (MarcoFalke)

Pull request description:

  The error reporting is confusing, because right now it prints:

  https://cirrus-ci.com/task/4846031060336640?logs=ci#L4931

  ```
  ...
  Traceback (most recent call last):
    File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/fuzz/test_runner.py", line 411, in <module>
      main()
    File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/fuzz/test_runner.py", line 199, in main
      run_once(
    File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/fuzz/test_runner.py", line 376, in run_once
      assert len(done_stat) == 1
             ^^^^^^^^^^^^^^^^^^^
  AssertionError
  ```

  This is harmless, but confusing.

  Fix it by collecting statistics only when the program has not aborted. (Can be reviewed with `--color-moved=dimmed-zebra`)

  Also, reword the error message to align it with error messages in other test_runners in this repo.

ACKs for top commit:
  dergoegge:
    utACK fa0e30b93a
  brunoerg:
    code review ACK fa0e30b93a
  marcofleon:
    Tested ACK fa0e30b93a. Prints out the error for the target that crashed. Much clearer than the current error message.

Tree-SHA512: 5e8d3fc0e4837b3264ff0c3cb322fe7fe2ec7af48d35e2a14f82080d03ace793963c3314611b0a170a38e200497d7ba703d9c35c9a7ed3272d93e43f0f0e4c2b
2024-12-17 11:07:51 +00:00
merge-script
1251a23642
Merge bitcoin/bitcoin#31458: build: use -mbig-obj for Windows debug builds
2b9ff4a66d build: use `-mbig-obj` for mingw-w64 Debug builds (fanquake)

Pull request description:

  Windows cross builds using `-O0` (`-DCMAKE_BUILD_TYPE=Debug`) currently fail to compile, as some objects have too many sections. As a convenience, add `-mbig-obj` to our compile flags when using the `Debug` build type, so that if someone tries to build this way, it will work.

  This would also be needed if we switched the depends flags to -O0. (maybe in #29796).

  `-mbig-obj`

  > On PE/COFF target this option forces the use of big object
  > file format, which allows more than 32768 sections.

  Closes #28109. Seems unlikely that we are going to break up the relevant object files, and the main issue is still the inclusion of Boost.

ACKs for top commit:
  theuni:
    utACK 2b9ff4a66d
  hebasto:
    ACK 2b9ff4a66d, tested in the following scenarios:

Tree-SHA512: 9ad36de172629a8b7e5371fe3cd75ac2f3c29856040569052cc59e42825eec9121e012dd2178e00b163173c98e78f79dd16b8cee2c93daa2ee0d7e99799325cd
2024-12-17 11:03:50 +00:00
merge-script
d2136d32bb
Merge bitcoin/bitcoin#31502: depends: Fix CXXFLAGS on NetBSD
a10bb400e8 depends: Fix CXXFLAGS on NetBSD (Hennadii Stepanov)

Pull request description:

  This PR corrects an issue where `CXXFLAGS` were mistakenly overridden by `CFLAGS`. This behaviour was introduced in 7e7b3e42fa (from https://github.com/bitcoin/bitcoin/pull/22380).

  On the master branch:
  ```
  $ gmake --no-print-directory -C depends print-x86_64_netbsd_CXXFLAGS
  x86_64_netbsd_CXXFLAGS=-pipe -std=c11
  ```

  With this PR:
  ```
  $ gmake --no-print-directory -C depends print-x86_64_netbsd_CXXFLAGS
  x86_64_netbsd_CXXFLAGS=-pipe -std=c++20
  ```

ACKs for top commit:
  theuni:
    utACK a10bb400e8

Tree-SHA512: 0c842db2965ebb0a58693394715922810235d9e5f2a7416fe258eb252dbd68ec04f90a0f7948abe938caf94a9194cca7deb53a08335c4404cce3a40c5cb44944
2024-12-17 10:55:53 +00:00
merge-script
58436d4af3
Merge bitcoin/bitcoin#31503: cmake: Link bitcoin_consensus as a library
46e207d329 cmake: Link `bitcoin_consensus` as a library (Hennadii Stepanov)

Pull request description:

  The [`TARGET_OBJECTS`](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:TARGET_OBJECTS) generator expression was introduced in the staging branch when we aimed to build the libbitcoinconsensus shared library. However, `bitcoin_consensus` is a `STATIC` library, not an `OBJECT` library.

  This change updates the build system to link `bitcoin_consensus` normally to `test_bitcoin`, resolving [linking issues](https://github.com/bitcoin/bitcoin/issues/31456#issuecomment-2538798107) when building with clang-cl.

ACKs for top commit:
  TheCharlatan:
    ACK 46e207d329
  theuni:
    utACK 46e207d329

Tree-SHA512: b5400be8e8350f80c9fc8b66c4a22032a51578e409eb1817309116fbf0bddeb5fcadd5fda685c98859730ee6cc904adb29d54207387732c8b574a1feb2be906f
2024-12-17 10:52:22 +00:00
merge-script
38dcf0f982
Merge bitcoin/bitcoin#31498: depends: Ignore prefix directory on OpenBSD
3353d4a5e9 depends: Ignore prefix directory on OpenBSD (Hennadii Stepanov)

Pull request description:

  On OpenBSD, the prefix directory is named as follows:
  ```
  $ gmake --no-print-directory -C depends print-x86_64_openbsd_prefix
  x86_64_openbsd_prefix=/home/hebasto/dev/bitcoin/depends/amd64-unknown-openbsd7.6
  ```

  This name does not match any pattern in `depends/.gitignore`.

  This PR resolves this issue.

ACKs for top commit:
  tdb3:
    ACK 3353d4a5e9
  theuni:
    utACK 3353d4a5e9
  theStack:
    Tested ACK 3353d4a5e9 🐟

Tree-SHA512: 82dfff1af974aa43c21e5e5a4483256d5ab4efdf1a15073fb864e635eff52eb8414346cda125f097af59e3342ac031a52683529f4e64df9fc60c8783fcd85e74
2024-12-17 10:46:35 +00:00
MarcoFalke
fae63bf130
fuzz: Clarify that only SeedRandomStateForTest(SeedRand::ZEROS) is allowed 2024-12-17 08:46:37 +01:00
Sjors Provoost
f86678156a
Check leaves size maximum in MerkleComputation
Belt and suspenders for future code changes.

Currently this function is only called from TransactionMerklePath() which sets leaves to the block transactions, so the Assume always holds.
2024-12-17 10:12:31 +07:00
Sjors Provoost
4d57288246
refactor: use CTransactionRef in submitSolution 2024-12-17 10:12:31 +07:00
Sjors Provoost
2e81791d90
Drop TransactionMerklePath default position arg 2024-12-17 10:12:31 +07:00
Sjors Provoost
39d3b538e6
Rename merkle branch to path 2024-12-17 10:12:31 +07:00
MarcoFalke
fa18acb457
fuzz: Abort when using global PRNG without re-seed 2024-12-16 15:23:56 +01:00
MarcoFalke
fa9e0489f5
refactor: Use immediate lambda to work around GCC bug 117966 2024-12-16 10:39:28 +01:00
Hennadii Stepanov
46e207d329 cmake: Link bitcoin_consensus as a library
The TARGET_OBJECTS generator expression was introduced in the staging
branch when we aimed to build the libbitcoinconsensus shared library.
However, `bitcoin_consensus` is a STATIC library, not an OBJECT library.

This change updates the build system to link `bitcoin_consensus`
normally to `test_bitcoin`, resolving linking issues when building with
clang-cl.
2024-12-15 15:37:14 +00:00
Hennadii Stepanov
a10bb400e8
depends: Fix CXXFLAGS on NetBSD
This change corrects an issue where CXXFLAGS were mistakenly overridden
by CFLAGS.
2024-12-14 20:32:38 +00:00
Hennadii Stepanov
3353d4a5e9
depends: Ignore prefix directory on OpenBSD 2024-12-14 09:55:47 +00:00
Ava Chow
b042c4f053
Merge bitcoin/bitcoin#31223: net, init: derive default onion port if a user specified a -port
Some checks failed
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Has been cancelled
CI / test each commit (push) Has been cancelled
CI / macOS 14 native, arm64, fuzz (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / Win64 native fuzz, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
1dd3af8fbc Add release note for #31223 (Martin Zumsande)
997757dd2b test: add functional test for -port behavior (Martin Zumsande)
0e2b12b92a net, init: derive default onion port if a user specified a -port (Martin Zumsande)

Pull request description:

  This resolves #31133 (setups with multiple local nodes each using a different `-port` no longer working with v28.0, see the issue description for more details) by deriving the default onion listening port to be the value specified by `-port` incremented by 1 (idea by vasild / laanwj).
  Note that with this fix, the chosen `-port` values of two local nodes cannot be adjacent, otherwise there will be port collisions again.

  From the discussion in the linked issue, this was the most popular option, followed by doing nothing and telling affected users to change their setups to use `-bind` instead of `-port`. But more opinions are certainly welcome!

  I think that if we decide to do something about the problem described in the issue, we should do so soon (in 28.1.), so I opened this PR.
  Fixes #31133

ACKs for top commit:
  achow101:
    ACK 1dd3af8fbc
  laanwj:
    Tested ACK 1dd3af8fbc
  tdb3:
    Code review ACK 1dd3af8fbc

Tree-SHA512: 37fda2b23bbedcab5df3a401cf5afce66ae5318fb78f9660f83e3fd075b528e8156d7a0903f9a12ffe97ab5d83860587116b74af28670a1f4c2f0d1be4999f40
2024-12-13 18:56:37 -05:00
fanquake
2b9ff4a66d
build: use -mbig-obj for mingw-w64 Debug builds
Windows cross builds using `-O0` currently fail to compile, as some
objects have too many sections. As a convenience, add `-mbig-obj` to
our compile flags when using the `Debug` build type, so that if someone
tries to build this way, it will work.

This would also be needed if we switched the depends flags to -O0.

`-mbig-obj`

> On PE/COFF target this option forces the use of big object
> file format, which allows more than 32768 sections.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2024-12-13 14:44:30 +00:00
MarcoFalke
fa0e30b93a
fuzz: Fix test_runner error reporting 2024-12-13 14:34:36 +01:00
Ryan Ofsky
d73f37dda2
Merge bitcoin/bitcoin#31346: Set notifications m_tip_block in LoadChainTip()
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
37946c0aaf Set notifications m_tip_block in LoadChainTip() (Sjors Provoost)

Pull request description:

  Ensure KernelNotifications `m_tip_block` is set even if no new block arrives.

  Suggested in https://github.com/bitcoin/bitcoin/pull/31297#issuecomment-2486457573

ACKs for top commit:
  ryanofsky:
    Code review ACK 37946c0aaf, fixing comment bug caught by @mzumsande in https://github.com/bitcoin/bitcoin/pull/31346#discussion_r1870315593 in another really helpful clarification
  mzumsande:
    Code Review ACK 37946c0aaf
  TheCharlatan:
    ACK 37946c0aaf

Tree-SHA512: 931bf820440a0cdda276f6dbd63f03fdbcdc90b18e7d5e160a74bdd9d0290acc706c35aab15bbdcd6e5e0b77565b3d07ff49b0dcf6551cb83961bae67be5d1bb
2024-12-13 08:25:25 -05:00
MarcoFalke
fa7809aeab
fuzz: Add missing SeedRandomStateForTest(SeedRand::ZEROS) 2024-12-13 14:22:25 +01:00
merge-script
78f1bff709
Merge bitcoin/bitcoin#31477: ci: Bump centos gcc to 12
fa47baa03b ci: Bump centos gcc (MarcoFalke)

Pull request description:

  Currently the centos stream9 CI task is using gcc-11. This is fine, because this is also the minimum supported.

  However:

  * There is already a CI task that is checking the minimum supported version: 62bd61de11/ci/test/00_setup_env_native_previous_releases.sh (L11-L12)
  * The CI log is a bit useless, because it is mostly just `#warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Werror=cpp]`. This makes it harder to spot real warnings, such as https://github.com/bitcoin/bitcoin/issues/31476

  Fix both issues by using gcc-12.

ACKs for top commit:
  hebasto:
    ACK fa47baa03b.

Tree-SHA512: 573618efc949437d33365a24f77a26a9b68457f7fb9bd603ee92bc5f17fec73ccba114cafb900eddee3531af47508ce5c246def93268787cdfa2b99e6f45a13d
2024-12-13 10:48:11 +00:00
merge-script
84890e0291
Merge bitcoin/bitcoin#31484: depends: update capnproto to 1.0.2
5cd9e95eea depends: update capnproto to 1.0.2 (fanquake)

Pull request description:

  This fixes compilation on FreeBSD:
  ```bash
  -- Build files have been written to: /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4
  Building native_capnp...
  gmake[1]: Entering directory '/tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4'
  [ 1%] Building CXX object src/kj/CMakeFiles/kj.dir/array.c++.o
  [ 2%] Building CXX object src/kj/CMakeFiles/kj.dir/cidr.c++.o
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:112:71: error: member access into incomplete type 'const struct sockaddr_in6'
  otherBits = reinterpret_cast<const struct sockaddr_in6*>(addr)->sin6_addr.s6_addr;
  ^
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:112:51: note: forward declaration of 'sockaddr_in6'
  otherBits = reinterpret_cast<const struct sockaddr_in6*>(addr)->sin6_addr.s6_addr;
  ^
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:123:63: error: member access into incomplete type 'const struct sockaddr_in'
  &reinterpret_cast<const struct sockaddr_in*>(addr)->sin_addr.s_addr);
  ^
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:123:44: note: forward declaration of 'sockaddr_in'
  &reinterpret_cast<const struct sockaddr_in*>(addr)->sin_addr.s_addr);
  ^
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:133:69: error: member access into incomplete type 'const struct sockaddr_in6'
  otherBits = reinterpret_cast<const struct sockaddr_in6*>(addr)->sin6_addr.s6_addr;
  ^
  /tmp/cirrus-ci-build/bitcoin-core/depends/work/build/x86_64-unknown-freebsd14.0/native_capnp/1.0.1-867405dd2c4/src/kj/cidr.c++:133:49: note: forward declaration of 'sockaddr_in6'
  otherBits = reinterpret_cast<const struct sockaddr_in6*>(addr)->sin6_addr.s6_addr;
  ^
  3 errors generated.
  ```

  See: 1c19c362b4.

ACKs for top commit:
  kevkevinpal:
    Concept ACK [5cd9e95](5cd9e95eea)
  theuni:
    utACK 5cd9e95eea
  ryanofsky:
    Code review ACK 5cd9e95eea. Downloaded the file and checked the hash. Also followed theuni's lead and looked at the source changes which were very minor. It did look like thousands of lines changed in the autotools build, but this should not affect us as we are using the cmake build.

Tree-SHA512: 5d78887a9e950c8532c427b17969128de0c6d466ec5ffba85241457e8e19673c22ddb3493cdfce5086f57ba760eac5e91f703992b2f70f2a7c82ba885255279c
2024-12-13 10:47:31 +00:00
merge-script
d5ab5a47f0
Merge bitcoin/bitcoin#31452: wallet: Migrate non-HD keys to combo() descriptor
62b2d23edb wallet: Migrate non-HD keys to combo() descriptor (Ava Chow)

Pull request description:

  Non-HD keys do not have an HD seed ID associated with them, so if this value is the null value (all 0s), then we should not perform any seed ID comparison that would result in excluding the keys from combo() migration.

  This changes the migration of non-HD wallets (or blank wallets with imported private keys) to make a single combo() descriptors for the non-HD/imported keys, rather than pk(), pkh(), sh(wpkh()), and wpkh() descriptors for the keys.

  Implements https://github.com/bitcoin/bitcoin/pull/31374#discussion_r1876650074

ACKs for top commit:
  laanwj:
    Concept and code review ACK 62b2d23edb
  brunoerg:
    code review ACK 62b2d23edb
  furszy:
    Nice catch. ACK 62b2d23edb
  theStack:
    ACK 62b2d23edb
  rkrux:
    tACK 62b2d23edb

Tree-SHA512: 86a80b7dcc1598ab18068a2572ff4b4920b233178b760f7b76c5b21a9e6608005ac872f90e082a8f99b51daab0b049e73e4bee5b8e0b537d56ed0d34122a1f49
2024-12-13 10:43:43 +00:00
Ryan Ofsky
beac62e541
Merge bitcoin/bitcoin#31480: refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
df27ee9f02 refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up to #31306 and fixes the "modernize-use-starts-ends-with" warning in the multiprocess code (see https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2527008761).

  Fixes https://github.com/chaincodelabs/libmultiprocess/issues/124.

ACKs for top commit:
  l0rinc:
    ACK df27ee9f02
  theuni:
    utACK df27ee9f02
  ryanofsky:
    Code review ACK df27ee9f02

Tree-SHA512: b5685818e9a3f161949b79586138e4341c5fbcc77296d5f4b13ff0183b6efaac1baea8a6d9304566f25517018d4f67b6d407105a36971a03f4077697d53f17ff
2024-12-12 17:13:14 -05:00
fanquake
5cd9e95eea
depends: update capnproto to 1.0.2
This fixes compilation on FreeBSD.
See:
1c19c362b4.
2024-12-12 17:15:15 +00:00
Hennadii Stepanov
df27ee9f02
refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning 2024-12-12 11:51:40 +00:00
merge-script
435ad572a1
Merge bitcoin/bitcoin#31479: lint: Disable signature output in git log
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
e2d3372e55 lint: Disable signature output in git log (Hodlinator)

Pull request description:

  Necessary for users that have signature output enabled by default, since the script would stumble on them and error out.

  ---

  ### Testing setup

  Set local repo config to show signatures in log by default, simulating a user having that setting turned on globally.
  ```
  ₿ git config set log.showSignature true
  ```
  ### Command under test

  ```
  ₿ ( cd ./test/lint/test_runner/ && COMMIT_RANGE='HEAD^..HEAD' cargo run )
  ```
  #### Before
  ```
  ...
  fatal: invalid object name 'gpg'.
  Traceback (most recent call last):
    File "/home/hodlinator/bitcoin/test/lint/lint-git-commit-check.py", line 52, in <module>
      main()
    File "/home/hodlinator/bitcoin/test/lint/lint-git-commit-check.py", line 42, in main
      commit_info = check_output(["git", "log", "--format=%B", "-n", "1", hash], text=True, encoding="utf8").splitlines()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 466, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 571, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['git', 'log', '--format=%B', '-n', '1', 'gpg: Signature made ons 11 dec 2024 10:46:34 CET']' returned non-zero exit status 128.
  ^---- ⚠️ Failure generated from lint-git-commit-check.py
  ...
  ```
  #### After

  (No failure generated by *lint-git-commit-check.py*).

ACKs for top commit:
  maflcko:
    lgtm ACK e2d3372e55
  willcl-ark:
    ACK e2d3372e55

Tree-SHA512: 584ccece1e6e0f4691683a2b1816eff33b88f48e9ead9272e2dc73ea9c637b182632108fbeddea1ffc8ed6ba5a5838d7eac7a9f33dfda5bdf325dd7a41e43365
2024-12-12 11:11:54 +00:00
merge-script
ea9e64ff3c
Merge bitcoin/bitcoin#31461: depends: add -g to *BSD_debug flags
b7ec69c25c depends: add -g to *BSD_debug flags (fanquake)

Pull request description:

  To match the other HOST_debug_flags. Pulled out of #29796.

ACKs for top commit:
  theuni:
    utACK b7ec69c25c

Tree-SHA512: 654a6dc2c1e295021380f18565379ccde5c5bebcbb5e48ab0364aa79c6f15d301b4acf058d75629a4b217483c6788a0ecb60560e8701882e09490b92c4c346d0
2024-12-12 10:11:38 +00:00
merge-script
29ddee1796
Merge bitcoin/bitcoin#31478: docs: remove repetitive words
015aad8d6a docs: remove repetitive words (RiceChuan)

Pull request description:

  remove repetitive words

ACKs for top commit:
  maflcko:
    lgtm ACK 015aad8d6a
  hebasto:
    ACK 015aad8d6a.

Tree-SHA512: c241d19786c1fb9836f7c5b3bf4f16df737d3bee75556cecea354b66a7ab653f524ec020676b04a001daeb4293c2cd3e7a0b9b7f54df44d88290bf4409f7b304
2024-12-12 10:06:23 +00:00
Hodlinator
e2d3372e55
lint: Disable signature output in git log
Necessary for users that have signature output enabled by default, since the script would stumble on them and error out.
2024-12-12 10:28:22 +01:00
MarcoFalke
fa47baa03b
ci: Bump centos gcc 2024-12-12 09:39:17 +01:00
RiceChuan
015aad8d6a docs: remove repetitive words
Signed-off-by: RiceChuan <lc582041246@gmail.com>
2024-12-12 16:36:06 +08:00
merge-script
62bd61de11
Merge bitcoin/bitcoin#31450: guix: disable gcov in base-linux-gcc
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
f6496a8388 guix: disable gcov in base-linux-gcc (fanquake)

Pull request description:

  In a `x86_64-linux-gnu` build, this drops:
  ```bash
  x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov
  x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov-dump
  x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov-tool
  x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/12.4.0: libgcov.a
  ```

  For mingw-w64-gcc, `--disable-gcov` is currently passed for this target in Guix, due to issues with mingw-w64, see
  8bed031e58/gnu/packages/gcc.scm (L99-L102). However we'll add it in any case, in case it's re-enabled in future, when the underlying issues are fixed.

ACKs for top commit:
  TheCharlatan:
    ACK f6496a8388

Tree-SHA512: ad6de53f63e7bb658cac05fb023fb1f8e76103073c7dffb4267412d3046148e1389df8848010128c1bd3d428f05e1587b656ef2cad8c7d9078ebec83a68bad49
2024-12-11 09:46:34 +00:00
Ryan Ofsky
676936845b
Merge bitcoin/bitcoin#30933: test: Prove+document ConstevalFormatString/tinyformat parity
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
c93bf0e6e2 test: Add missing %c character test (Hodlinator)
76cca4aa6f test: Document non-parity between tinyformat and ConstevalFormatstring (Hodlinator)
533013cba2 test: Prove+document ConstevalFormatString/tinyformat parity (Hodlinator)
b81a465995 refactor test: Profit from using namespace + using detail function (Hodlinator)

Pull request description:

  Clarifies and puts the extent of parity under test.

  Broken out from #30546 based on https://github.com/bitcoin/bitcoin/pull/30546#discussion_r1755013263 and https://github.com/bitcoin/bitcoin/pull/30546#discussion_r1756495304.

ACKs for top commit:
  maflcko:
    re-ACK c93bf0e6e2 🗜
  l0rinc:
    ACK c93bf0e6e2
  ryanofsky:
    Code review ACK c93bf0e6e2. Just a few cleanups tweaking function declarations and commit comments and consolidating some test cases since last review.

Tree-SHA512: 5ecc893b26cf2761c0009861be392ec4c4fceb0ef95052a2f6f9df76b2e459cfb3f9e257f61be07c3bb2ecc6e525e72c5ca853be1f63b70b52785323d3db6b42
2024-12-10 22:05:03 -05:00
Ava Chow
8ad2c90274
Merge bitcoin/bitcoin#31343: test: avoid internet traffic in rpc_net.py
988721d37a test: avoid internet traffic in rpc_net.py (Sebastian Falbesoner)

Pull request description:

  In order to avoid connecting to the internet in the functional test `rpc_net.py`, specify a non-working proxy (parameter `-proxy=127.0.0.1:1`, same approach as in #31142) for the nodes.  There is at least one known instance where this is currently happening on master where a connection attempt to a public IP is made (see also the discussion in #31339):

  17834bd197/test/functional/rpc_net.py (L253)

  Can be tested by running
  ```
  $ sudo tcpdump -i eth0 host 11.22.33.44
  ```
  both on master and the PR branch and verifying that no packets appear in the tcpdump in the latter anymore.

ACKs for top commit:
  achow101:
    ACK 988721d37a
  tdb3:
    ACK 988721d37a
  vasild:
    ACK 988721d37a

Tree-SHA512: 0f51fedccbfac0f80a7e6f9c5ba9193d0c20b5a788553c7cd7e583225df7b1151b86cd848d6ccf61f7b2de848f0ac98d73d7b5db100aa54fe8cbeeb4c0549106
2024-12-10 21:00:07 -05:00
Ava Chow
a582ee681c
Merge bitcoin/bitcoin#29982: test: Fix intermittent issue in wallet_backwards_compatibility.py
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
ec777917d6 test: Fix intermittent issue in wallet_backwards_compatibility.py (Randall Naar)

Pull request description:

  When creating and replacing a transaction using `bumpfee`, an async update is sent in the form of the `TransactionAddedToMempool` and `TransactionRemovedFromMempool` signals. When `wallet_backwards_compatibility.py` creates `tx3_id` this way and replaces it with `tx4_id`, the `abandontransaction` rpc is called right after. In some cases the `TransactionAddedToMempool` and `TransactionRemovedFromMempool` is handled after the transaction is abandoned in the wallet, and overwrites the transaction's `abandoned` flag. This PR forces the signals to get handled before `abandontransaction` is called by invoking `self.sync_mempools` which calls `syncwithvalidationinterfacequeue` on every node's rpc connection.

  This will mitigate the immediate inconsistency observed with the abandontransaction call, but the potential race conditions between the signals and wallet operations may also be useful to note in a separate issue (if it's okay to not address it in this one).

  Fixes #29806

ACKs for top commit:
  achow101:
    ACK ec777917d6
  tdb3:
    ACK ec777917d6

Tree-SHA512: e75bc2c1f7fefc4f4910bb353654848fed5661c1436416798a5f4e0c5a76bde15617a5af04c2384464005953326317b8f273039e47508d5124677908cf36d31e
2024-12-10 16:29:06 -05:00
fanquake
b7ec69c25c
depends: add -g to *BSD_debug flags
To match the other HOST_debug_flags.
2024-12-10 15:20:46 +00:00
merge-script
37e49c2c7c
Merge bitcoin/bitcoin#31448: fuzz: add cstdlib to FuzzedDataProvider
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
bb7e686341 fuzz: add cstdlib to FuzzedDataProvider (fanquake)

Pull request description:

  Same as https://github.com/llvm/llvm-project/pull/113951.

  Avoids compile failures under clang-20 & `D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`:
  ```bash
  In file included from /bitcoin/src/test/fuzz/addition_overflow.cpp:5:
  /bitcoin/src/test/fuzz/FuzzedDataProvider.h:209:5: error: use of undeclared identifier 'abort'
    209 |     abort();
        |     ^
  /bitcoin/src/test/fuzz/FuzzedDataProvider.h:250:5: error: use of undeclared identifier 'abort'
    250 |     abort();
  ```

ACKs for top commit:
  dergoegge:
    utACK bb7e686341
  brunoerg:
    ACK bb7e686341

Tree-SHA512: 22efd5505273ec7254e8dccbb275e648fe02107397c45eff6752e4a6ea787d9d2e45eb0f2ee309df431e9b92ffd14cbcba4b0f4b11a127664466e20be43c383e
2024-12-10 09:33:33 +00:00
Ava Chow
62b2d23edb wallet: Migrate non-HD keys to combo() descriptor
Non-HD keys in legacy wallets without a HD seed ID were being migrated
to separate pk(), pkh(), sh(wpkh()), and wpkh() descriptors for each key.
These could be more compactly represented as combo() descriptors, so
migration should make combo() for them.

It is possible that existing non-HD wallets that were migrated, or
wallets that started blank and had private keys imported into them have
run into this issue. However, as the 4 descriptors produce the same output
scripts as the single combo(), so any previously migrated wallets are
not missing any output scripts. The only observable difference should be
performance related, and the wallet size on disk.
2024-12-09 15:25:57 -05:00
Ava Chow
9039d8f1a1
Merge bitcoin/bitcoin#31374: wallet: fix crash during watch-only wallet migration
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
cdd207c0e4 test: add coverage for migrating standalone imported keys (furszy)
297a876c98 test: add coverage for migrating watch-only script (furszy)
932cd1e92b wallet: fix crash during watch-only wallet migration (furszy)

Pull request description:

  The crash occurs because we assume the cached scripts structure will not be empty,
  but it can be empty for watch-only wallets that start blank.

  This also adds test coverage for standalone imported keys, which were also crashing
  because pubkey imports are treated the same way as hex script imports through
  `importaddress()`.

  Testing Notes:
  This can be verified by cherry-picking and running any of the test commits on master.
  It will crash there but pass on this branch.

ACKs for top commit:
  theStack:
    re-ACK cdd207c0e4
  brunoerg:
    reACK cdd207c0e4
  achow101:
    ACK cdd207c0e4

Tree-SHA512: e05c77cf3e9f35f10f122a73680b3f131f683c56685c1e26b5ffc857f95195b64c8c9d4535960ed3d6f931935aa79b0b1242537462006126bdb68251f0452954
2024-12-09 15:12:34 -05:00
fanquake
bb7e686341
fuzz: add cstdlib to FuzzedDataProvider
Same as https://github.com/llvm/llvm-project/pull/113951.

Avoids compile failures under clang-20 &
`D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`:
```bash
In file included from /bitcoin/src/test/fuzz/addition_overflow.cpp:5:
/bitcoin/src/test/fuzz/FuzzedDataProvider.h:209:5: error: use of undeclared identifier 'abort'
  209 |     abort();
      |     ^
/bitcoin/src/test/fuzz/FuzzedDataProvider.h:250:5: error: use of undeclared identifier 'abort'
  250 |     abort();
```
2024-12-09 17:01:10 +00:00
fanquake
f6496a8388
guix: disable gcov in base-linux-gcc
In a `x86_64-linux-gnu` build, this drops:
```bash
x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov
x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov-dump
x86_64-linux-gnu/bin/x86_64-linux-gnu-gcov-tool
x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/12.4.0: libgcov.a
```

For mingw-w64-gcc, `--disable-gcov` is currently passed for this
target in Guix, due to issues with mingw-w64, see
8bed031e58/gnu/packages/gcc.scm (L99-L102).
However we'll add it in any case, in case it's re-enabled in future,
when the underlying issues are fixed.
2024-12-09 15:28:25 +00:00
merge-script
35000e34cf
Merge bitcoin/bitcoin#31433: test: #31212 follow up (spelling, refactor)
Some checks are pending
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
41d934c72d chore: Typo Overriden -> Overridden (Hodlinator)
c9fb38a590 refactor test: Cleaner combine_logs.py logic (Hodlinator)

Pull request description:

  - Fixes typo caught by spelling linter (https://github.com/bitcoin/bitcoin/runs/33979284676).
  - Minor but nice refactoring of *combine_logs.py* change that was suggested late: https://github.com/bitcoin/bitcoin/pull/31212#discussion_r1869307947

ACKs for top commit:
  l0rinc:
    ACK 41d934c72d
  maflcko:
    lgtm ACK 41d934c72d
  theStack:
    ACK 41d934c72d
  BrandonOdiwuor:
    Code Review ACK 41d934c72d
  tdb3:
    ACK 41d934c72d

Tree-SHA512: cf8ecc070d0b01df9c4e57a75820e17d4535591e85bf9d271c7b8f60875f7e04b9978c56e9b88c10e89e69ff755c35b23ed291949c32c875a91c3317105a3c79
2024-12-08 16:33:31 +00:00