Commit Graph

43539 Commits

Author SHA1 Message Date
Vasil Dimov
6b3f6eae70
test: avoid generating non-loopback traffic from p2p_seednode.py
`p2p_seednode.py` would try to connect to `0.0.0.1` and `0.0.0.2` as
seed nodes. This sends outbound TCP packets on a non-loopback interface
to the default router.

Configure an unavailable proxy for all executions of `bitcoind` during
this test. Also change `0.0.0.1` and `0.0.0.2` because connecting to
them would skip the `-proxy=` setting because for such an address:
* `CNetAddr::IsLocal()` is true, thus
* `CNetAddr::IsRoutable()` is false, thus
* `CNetAddr::GetNetwork()` is `NET_UNROUTABLE`, even though
  `CNetAddr::m_net` is `NET_IPV4`.

This speeds up the execution time of `p2p_seednode.py`
from 12.5s to 2.5s.
2025-01-14 09:20:58 +01:00
merge-script
35bf426e02
Merge bitcoin/bitcoin#28724: wallet: Cleanup accidental encryption keys in watchonly wallets
69e95c2b4f tests: Test cleanup of mkeys from wallets without privkeys (Andrew Chow)
2b9279b50a wallet: Remove unused encryption keys from watchonly wallets (Andrew Chow)
813a16a463 wallet: Add HasCryptedKeys (Andrew Chow)

Pull request description:

  An earlier version allowed users to create watchonly wallets (wallets without private keys) that were "encrypted". Such wallets would have a stored encryption keys, but nothing would actually be encrypted with them. This can cause unexpected behavior such as https://github.com/bitcoin-core/gui/issues/772.

  We can detect such wallets as they will have the disable private keys flag set, no encrypted keys, and encryption keys. For such wallets, we can remove those encryption keys thereby avoiding any issues that may result from this unexpected situation.

ACKs for top commit:
  sipa:
    utACK 69e95c2b4f.
  laanwj:
    Code review re-ACK 69e95c2b4f
  furszy:
    Code review ACK 69e95c2b4f

Tree-SHA512: 901932cd709c57e66c598f011f0105a243b5a8b539db2ef3fcf370dca4cf35ae09bc1110e8fca8353be470f159468855a4dd96b99bc9c1112adc86ccc50e1b9d
2025-01-10 15:29:47 +00:00
merge-script
2168406597
Merge bitcoin/bitcoin#31608: doc: Clarify min macOS and Xcode version
fa029a7878 doc: Clarify min macOS and Xcode version (MarcoFalke)

Pull request description:

  Two minor doc fixups:

  * Clarify that `macOS 13.0+` means `macOS 13+`, indicating that on any major version, only the latest security release is supported.
  * Clarify that the Xcode version was selected based on the minimum required macOS version and the minimum required clang version.

ACKs for top commit:
  jarolrod:
    ACK fa029a7878
  hebasto:
    re-ACK fa029a7878.
  theuni:
    ACK fa029a7878

Tree-SHA512: d34910fcc22e57021d7642938e5886419d2b711e1062cbc4fc3da48baf07377231f9d7b394e22ccb17e830d058c8c797dbd1bbffcc7c8828601bb500e1154a9e
2025-01-10 13:53:37 +00:00
merge-script
2f6c7e7f6c
Merge bitcoin/bitcoin#31612: ci: build msan's libc++ with _LIBCPP_ABI_BOUNDED_*
fb37acd932 ci: build msan's libc++ with _LIBCPP_ABI_BOUNDED_* (Vasil Dimov)

Pull request description:

  For the task `MSan, depends (Cirrus CI)` we build a custom libc++ for which we already use `-DLIBCXX_HARDENING_MODE=debug`. Compile it also with `_LIBCPP_ABI_BOUNDED_*` to enable further checks.

  Docs at: https://libcxx.llvm.org/Hardening.html#abi-options

ACKs for top commit:
  maflcko:
    review ACK fb37acd932

Tree-SHA512: 7687b47e86c524c947dd4311289cdd9bc3dd25e31e844375781a37c110f8ab65bdfcc485f17fd3b20f070cc93187f0ba2ad45089451220f31309c143bb21cc3f
2025-01-10 13:48:20 +00:00
merge-script
528354e213
Merge bitcoin/bitcoin#31616: init,log: Unify block index log line
e04be3731f init,log: Unify block index and chainstate loading log line (Lőrinc)

Pull request description:

  The line has been present since the beginning.

  Removed redundant duration as well since it can be recovered from the timestamps.

  Example logs before the change:
  ```
  2025-01-07T11:58:33Z Verification progress: 99%
  2025-01-07T11:58:33Z Verification: No coin database inconsistencies in last 6 blocks (18905 transactions)
  2025-01-07T11:58:33Z  block index           31892ms
  2025-01-07T11:58:33Z Setting NODE_NETWORK on non-prune mode
  ```

ACKs for top commit:
  maflcko:
    lgtm ACK e04be3731f
  TheCharlatan:
    ACK e04be3731f
  danielabrozzoni:
    tACK e04be3731f
  BrandonOdiwuor:
    Code Review ACK e04be3731f

Tree-SHA512: cbe4569a17f56ff23e829b837a083c2f730cc490b47bee3bac12126e2257e0ba9ebe9b4384deb03203a0a60aac3b8d283c5d31a6d0481635ba011ac6e2c61ad1
2025-01-10 11:27:04 +00:00
merge-script
4bedfb5c83
Merge bitcoin/bitcoin#31623: tracing: Rename the MIN macro to _TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
f93f0c9396 tracing: Rename the `MIN` macro to `_TRACEPOINT_TEST_MIN` in log_raw_p2p_msgs (0xb10c)

Pull request description:

  Inspired by: 00c1dbd26d (#31419)

  Unless there's a reason we *don't* want the same change here...?

ACKs for top commit:
  maflcko:
    review ACK f93f0c9396 🔶
  0xB10C:
    tested ACK f93f0c9396

Tree-SHA512: 2af2c21e575f496b966928bcffeb92847d1acab8d5e7442d0e08e27358228df326783eb576f0364001b666e956fd8efde1c50dab67d7750a0a6b65b7acec12ae
2025-01-10 11:23:32 +00:00
merge-script
e5c268084e
Merge bitcoin/bitcoin#31627: depends: Fix spacing issue
8a46286da6 depends: Fix spacing issue (Hennadii Stepanov)

Pull request description:

  This PR resolves an issue where a missing space caused the value of the `build_AR` variable to be concatenated with the "NM=" string. This resulted in subsequent calls to `${AR}` and `${NM}` failing.

  Here is a diff for the `make -C depends print-build_id DEBUG=1` output:
  ```diff
  @@ -110,50 +110,18 @@
   CXX_STANDARD=c++20
   END CXX
   BEGIN AR
  -ar: invalid option -- '='
  -Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
  -       ar -M [<mri-script]
  - commands:
  -  d            - delete file(s) from the archive
  -  m[ab]        - move file(s) in the archive
  -  p            - print file(s) found in the archive
  -  q[f]         - quick append file(s) to the archive
  -  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  -  s            - act as ranlib
  -  t[O][v]      - display contents of the archive
  -  x[o]         - extract file(s) from the archive
  - command specific modifiers:
  -  [a]          - put file(s) after [member-name]
  -  [b]          - put file(s) before [member-name] (same as [i])
  -  [D]          - use zero for timestamps and uids/gids (default)
  -  [U]          - use actual timestamps and uids/gids
  -  [N]          - use instance [count] of name
  -  [f]          - truncate inserted file names
  -  [P]          - use full path names when matching
  -  [o]          - preserve original dates
  -  [O]          - display offsets of files in the archive
  -  [u]          - only replace files that are newer than current archive contents
  - generic modifiers:
  -  [c]          - do not warn if the library had to be created
  -  [s]          - create an archive index (cf. ranlib)
  -  [l <text> ]  - specify the dependencies of this library
  -  [S]          - do not build a symbol table
  -  [T]          - deprecated, use --thin instead
  -  [v]          - be verbose
  -  [V]          - display the version number
  -  @<file>      - read options from <file>
  -  --target=BFDNAME - specify the target object format as BFDNAME
  -  --output=DIRNAME - specify the output directory for extraction operations
  -  --record-libdeps=<text> - specify the dependencies of this library
  -  --thin       - make a thin archive
  - optional:
  -  --plugin <p> - load the specified plugin
  - emulation options:
  -  No emulation specific options
  -ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big elf64-littleaarch64 elf64-bigaarch64 elf32-littleaarch64 elf32-bigaarch64 elf32-littlearm elf32-bigarm pei-aarch64-little pe-aarch64-little elf64-alpha ecoff-littlealpha elf32-littlearm-fdpic elf32-bigarm-fdpic elf32-hppa-linux elf32-hppa elf64-ia64-little elf64-ia64-big pei-ia64 elf64-loongarch elf32-loongarch pei-loongarch64 elf32-m32r-linux elf32-m32rle-linux elf32-m68k elf32-tradbigmips elf32-tradlittlemips ecoff-bigmips ecoff-littlemips elf32-ntradbigmips elf64-tradbigmips elf32-ntradlittlemips elf64-tradlittlemips elf32-powerpc aixcoff-rs6000 elf32-powerpcle ppcboot elf64-powerpc elf64-powerpcle aixcoff64-rs6000 aix5coff64-rs6000 elf64-littleriscv elf32-littleriscv elf32-bigriscv elf64-bigriscv pei-riscv64-little elf32-s390 elf64-s390 elf32-sh-linux elf32-shbig-linux elf32-sh-fdpic elf32-shbig-fdpic elf32-sparc elf64-sparc pe-bigobj-x86-64 pe-i386 pdb srec symbolsrec verilog tekhex binary ihex plugin
  +GNU ar (GNU Binutils for Ubuntu) 2.42
  +Copyright (C) 2024 Free Software Foundation, Inc.
  +This program is free software; you may redistribute it under the terms of
  +the GNU General Public License version 3 or (at your option) any later version.
  +This program has absolutely no warranty.
   END AR
   BEGIN NM
  -bash: line 1: --version: command not found
  +GNU nm (GNU Binutils for Ubuntu) 2.42
  +Copyright (C) 2024 Free Software Foundation, Inc.
  +This program is free software; you may redistribute it under the terms of
  +the GNU General Public License version 3 or (at your option) any later version.
  +This program has absolutely no warranty.
   END NM
   BEGIN RANLIB
   GNU ranlib (GNU Binutils for Ubuntu) 2.42
  @@ -321,5 +289,5 @@
   NO_HARDEN=
   END NO_HARDEN
   END ALL
  -build_id=b7effe2aa166e73f6d2587fb4805ea1cca4d3f1e5c3aae2cfd59c592816b05e3
  +build_id=4173a5f75182c792550652e621f6b4a68cc27c8909385580d4efc7bc7a769f51
   make: Leaving directory '/home/hebasto/git/bitcoin/depends'
  ```

  It was accidentally introduced in https://github.com/bitcoin/bitcoin/pull/29249.

ACKs for top commit:
  theuni:
    Nice catch. utACK 8a46286da6
  TheCharlatan:
    ACK 8a46286da6

Tree-SHA512: f50f3dea1f5fa545316743e61f69ad1a3b7de674604a560fd2a8d7095788cddfae4f88bee19eb2eed2e27800f94ec12bd8ee7e17d65f2a6839530d3646e5440d
2025-01-10 11:17:28 +00:00
merge-script
d695d13917
Merge bitcoin/bitcoin#31611: doc: upgrade license to 2025.
b537a2c02a doc: upgrade license to 2025. (Kay)

Pull request description:

ACKs for top commit:
  maflcko:
    lgtm ACK b537a2c02a
  theuni:
    ACK b537a2c02a

Tree-SHA512: 245a2c2a6b4b422f6013e12283fc74da52909c64d5d1bf6622deb5a06e6d4a114e8dccfaa106fb4b5e5fa7abf166e3c34baef2463276d2f110605fe0389680cd
2025-01-10 11:03:05 +00:00
Ava Chow
37af8bfb34
Merge bitcoin/bitcoin#31549: fuzz: Abort if system time is called without mock time being set
a96b84cb1b fuzz: Abort when calling system time without setting mock time (marcofleon)
ff21870e20 fuzz: Add SetMockTime() to necessary targets (marcofleon)

Pull request description:

  This PR expands the `CheckGlobals` utility that was introduced in https://github.com/bitcoin/bitcoin/pull/31486 and should help with fuzz stability (https://github.com/bitcoin/bitcoin/issues/29018).

  System time shouldn't be used when running a fuzz test, as it is likely to introduce instability (non-determinism). This PR identifies and fixes the targets that were calling system time without setting mock time at the start of an iteration.

  Removing`SetMockTime()` from any one of these targets should result in a crash and a message describing the issue.

ACKs for top commit:
  achow101:
    ACK a96b84cb1b
  dergoegge:
    Code review ACK a96b84cb1b
  brunoerg:
    crACK a96b84cb1b

Tree-SHA512: e093a9feb8a397954f7b1416dfa8790b2733f09d5ac51fda5a9d225a55ebd8f99135aa52bdf5ab531653ad1a3739c4ca2b5349c1d989bb4b009ec8eaad684f7d
2025-01-09 19:31:07 -05:00
Ava Chow
54115d8de5
Merge bitcoin/bitcoin#31617: build, test: Build db_tests.cpp regardless of USE_BDB
fd2d96d908 build, test: Build `db_tests.cpp` regardless of `USE_BDB` (Hennadii Stepanov)

Pull request description:

  When the building of `db_tests.cpp` was made conditional on `USE_BDB` in commit a58b719cf7, all `db_tests` were indeed specific to BDB wallets.

  However, the tests have since been [extended](ba616b932c) to include SQLite wallets as well.

  On the master branch @ 433412fd84, tests specific to SQLite wallets are not built and run if configured with `WITH_BDB=OFF` (the default option).

  This PR resolves this issue by guarding BDB-specific code in `db_tests.cpp` and ensuring this source file is compiled regardless of the `WITH_BDB` option.

ACKs for top commit:
  achow101:
    ACK fd2d96d908
  maflcko:
    review ACK fd2d96d908 🔺
  theuni:
    utACK fd2d96d908

Tree-SHA512: bd9eddf16af60c568e931467d39e9e23a268e82e367ab630c23ac3cfd37e6007c6d78579b69ccbeebc1911c749cdbe75794fd56d7fbdb30c6fea6d2ab11017a3
2025-01-09 18:46:07 -05:00
Ava Chow
0a77441158
Merge bitcoin/bitcoin#31451: wallet: migration, avoid loading legacy wallet after failure when BDB isn't compiled
589ed1a8ea wallet: migration, avoid loading wallet after failure when it wasn't loaded before (furszy)

Pull request description:

  Fixes #31447.

  During migration failure, only load wallet back into memory when the wallet was
  loaded prior to migration. This fixes the case where BDB is not supported, which
  implies that no legacy wallet can be loaded into memory due to the lack of db
  writing functionality.

  Link to error description https://github.com/bitcoin/bitcoin/issues/31447#issuecomment-2528757140.

  This PR also improves migration backup related comments to better document the
  current workflow.

ACKs for top commit:
  achow101:
    ACK 589ed1a8ea
  rkrux:
    ACK 589ed1a8ea
  pablomartin4btc:
    tACK 589ed1a8ea

Tree-SHA512: c7a489d2b253c574ee0287b691ebe29fe8d026f659f68a3f6108eca8b4e1e420c67ca7803c6bd70c1e1440791833fabca3afbcf8fe8524c6c9fc08de95b618d0
2025-01-09 18:33:23 -05:00
Ava Chow
56725f8829
Merge bitcoin/bitcoin#31462: test: raise explicit error if any of the needed release binaries is missing
1ea7e45a1f test: raise explicit error if any of the needed release binaries is missing (Sebastian Falbesoner)

Pull request description:

  If the `releases` directory exists, but still only a subset of the necessary previous release binaries are available, the test fails by throwing an exception (sometimes leading to follow-up exceptions like `AssertionError: [node 0] Error: no RPC connection`) and printing out a stack trace, which can be confusing and at a first glance suggests that the node crashed or some alike.
  Improve this by checking and printing out *all* of the missing release binaries and failing with an explicit error in this case. Also add an info on how to download previous releases binaries. Noticed while testing #30328.

  Can be tested by e.g.

  ```
  $ rm -rf ./releases
  $ ./test/get_previous_releases.py -b
  $ rm -rf ./releases/v28.0/
  $ ./build/test/functional/wallet_migration.py
  ```

  master:
  <details>
  <summary>Long test fail output</summary>

  ```
  ...
  2024-12-10T18:48:54.067000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 590, in start_nodes
      node.start(extra_args[i], *args, **kwargs)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 257, in start
      self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs)
    File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: '/home/thestack/bitcoin/releases/v28.0/bin/bitcoind'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
      self.setup()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 315, in setup
      self.setup_network()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 409, in setup_network
      self.setup_nodes()
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 54, in setup_nodes
      self.start_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 595, in start_nodes
      self.stop_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 610, in stop_nodes
      node.stop_node(wait=wait, wait_until_stopped=False)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 396, in stop_node
      self.stop(wait=wait)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 215, in __getattr__
      assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
  AssertionError: [node 0] Error: no RPC connection
  2024-12-10T18:48:54.118000Z TestFramework (INFO): Stopping nodes
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 1097, in <module>
      WalletMigrationTest(__file__).main()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 159, in main
      exit_code = self.shutdown()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 331, in shutdown
      self.stop_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 610, in stop_nodes
      node.stop_node(wait=wait, wait_until_stopped=False)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 396, in stop_node
      self.stop(wait=wait)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 215, in __getattr__
      assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
  AssertionError: [node 0] Error: no RPC connection
  [node 0] Cleaning up leftover process
  ...
  ```
  </details>

  PR:
  ```
  ...
  2025-01-01T20:26:27.999000Z TestFramework (INFO): PRNG seed is: 4570383538468804512
  2025-01-01T20:26:28.000000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_lz66_zcu
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Binary not found: /home/thestack/bitcoin/releases/v28.0/bin/bitcoind
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Binary not found: /home/thestack/bitcoin/releases/v28.0/bin/bitcoin-cli
  2025-01-01T20:26:28.003000Z TestFramework (INFO): Previous releases binaries can be downloaded via `test/get_previous_releases.py -b`.
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
      self.setup()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 315, in setup
      self.setup_network()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 409, in setup_network
      self.setup_nodes()
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 50, in setup_nodes
      self.add_nodes(self.num_nodes, versions=[
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 537, in add_nodes
      raise AssertionError("At least one release binary is missing")
  AssertionError: At least one release binary is missing
  2025-01-01T20:26:28.061000Z TestFramework (INFO): Stopping nodes
  ...
  ```

ACKs for top commit:
  fjahr:
    re-ACK 1ea7e45a1f
  kevkevinpal:
    ACK [1ea7e45](1ea7e45a1f)
  maflcko:
    lgtm ACK 1ea7e45a1f
  achow101:
    ACK 1ea7e45a1f
  pablomartin4btc:
    tACK 1ea7e45a1f

Tree-SHA512: b621c3ce044ca8fc8715a4f4b1f96a8592a470c319a64444cced9ba692d315cfd4885a066679bf377b19136fa3530d9cff6f18894a45aa9c716d39b12719baa0
2025-01-09 18:22:26 -05:00
Hennadii Stepanov
8a46286da6
depends: Fix spacing issue
This change resolves an issue where a missing space caused the value of
the `build_AR` variable to be concatenated with the "NM=" string. This
resulted in subsequent calls to `${AR}` and `${NM}` failing.
2025-01-09 13:36:19 +00:00
Lőrinc
e04be3731f init,log: Unify block index and chainstate loading log line
Example logs before the change:
```
2025-01-07T11:58:33Z Verification progress: 99%
2025-01-07T11:58:33Z Verification: No coin database inconsistencies in last 6 blocks (18905 transactions)
2025-01-07T11:58:33Z  block index           31892ms
2025-01-07T11:58:33Z Setting NODE_NETWORK on non-prune mode
2025-01-07T11:58:33Z block tree size = 878086
2025-01-07T11:58:33Z nBestHeight = 878085
```

Removed redundant duration as well since it can be recovered from the timestamps.

Co-authored-by: TheCharlatan <seb.kung@gmail.com>
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
2025-01-09 14:14:43 +01:00
0xb10c
f93f0c9396 tracing: Rename the MIN macro to _TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
Inspired by: 00c1dbd26d (#31419)
2025-01-09 06:43:05 +00:00
glozow
66aa6a47bd
Merge bitcoin/bitcoin#30391: BlockAssembler: return selected packages virtual size and fee
7c123c08dd  miner: add package feerate vector to CBlockTemplate (ismaelsadeeq)

Pull request description:

  This PR enables `BlockAssembler` to add all selected packages' fee and virtual size to a vector, and then return the vector as a member of `CBlockTemplate` struct.

  This PR is the first step in the https://github.com/bitcoin/bitcoin/issues/30392 project.

  The packages' vsize and fee are used in #30157 to select a percentile fee rate of the top block in the mempool.

ACKs for top commit:
  rkrux:
    tACK 7c123c08dd
  ryanofsky:
    Code review ACK 7c123c08dd. Changes since last review are rebasing due to a test conflict, giving the new field a better name and description, resolving the test conflict, and renaming a lot of test variables. The actual code change is still one-line change.
  glozow:
    reACK 7c123c08dd

Tree-SHA512: 767b0b3d4273cf1589fd2068d729a66c7414c0f9574b15989fbe293f8c85cd6c641dd783cde55bfabab32cd047d7d8a071d6897b06ed4295c0d071e588de0861
2025-01-08 13:01:23 -05:00
ismaelsadeeq
7c123c08dd
miner: add package feerate vector to CBlockTemplate
- The package feerates are ordered by the sequence in which
  packages are selected for inclusion in the block template.

- The commit also tests this new behaviour.

Co-authored-by: willcl-ark <will@256k1.dev>
2025-01-07 15:29:17 -05:00
Hennadii Stepanov
fd2d96d908
build, test: Build db_tests.cpp regardless of USE_BDB
While some tests are specific to BDB, `db_tests` as a whole are not
limited to BDB.
2025-01-07 15:50:39 +00:00
Vasil Dimov
fb37acd932
ci: build msan's libc++ with _LIBCPP_ABI_BOUNDED_*
For the task `MSan, depends (Cirrus CI)` we build a custom libc++ for
which we already use `-DLIBCXX_HARDENING_MODE=debug`. Compile it also
with `_LIBCPP_ABI_BOUNDED_*` to enable further checks.

Docs at: https://libcxx.llvm.org/Hardening.html#abi-options
2025-01-07 15:57:01 +01:00
Sebastian Falbesoner
1ea7e45a1f test: raise explicit error if any of the needed release binaries is missing
If the `releases` directory exists, but still only a subset of the
necessary previous release binaries are available, the test fails by
throwing an exception (sometimes leading to follow-up exceptions like
"AssertionError: [node 0] Error: no RPC connection") and printing out
a stack trace, which can be confusing and at a first glance suggests
that the node crashed or some alike.
Improve this by checking and printing out *all* of the missing release
binaries and failing with an explicit error in this case. Also add an
info on how to download previous releases binaries.
Noticed while testing #30328.

Can be tested by e.g.

$ ./test/get_previous_releases.py -b
$ rm -rf ./releases/v28.0/
$ ./build/test/functional/wallet_migration.py
2025-01-07 01:25:15 +01:00
Ava Chow
433412fd84
Merge bitcoin/bitcoin#31596: doc: Clarify comments about endianness after #30526
3e0a992a3f doc: Clarify comments about endianness after #30526 (Ryan Ofsky)

Pull request description:

  This is a documentation-only change following up on suggestions made in the #30526 review.

  Motivation for this change is that I was recently reviewing #31583, which reminded me how confusing the arithmetic blob code was and made me want to write better comments.

ACKs for top commit:
  achow101:
    ACK 3e0a992a3f
  TheCharlatan:
    ACK 3e0a992a3f
  Sjors:
    ACK 3e0a992a3f
  BrandonOdiwuor:
    LGTM ACK 3e0a992a3f

Tree-SHA512: 90d5582a25a51fc406d83ca6b8c4e5e4d3aee828a0497f4b226b2024ff89e29b9b50d0ae8ddeac6abf2757fe78548d58cf3dd54df4b6d623f634a2106048091d
2025-01-06 18:52:59 -05:00
Ava Chow
c506f2cee7
Merge bitcoin/bitcoin#31581: test: have miner_tests use Mining interface
04249682e3 test: use Mining interface in miner_tests (Sjors Provoost)

Pull request description:

  Needed for both #31283 and #31564.

  By using the Mining interface in `miner_tests.cpp` we increase its coverage in unit tests.

ACKs for top commit:
  achow101:
    ACK 04249682e3
  ryanofsky:
    Code review ACK 04249682e3, just minor suggested changes (renames, comments, BOOST_REQUIREs) since last review and some more extra clarifications and checks added to the CreateNewBlock_validity test. The CreateNewBlock_validity changes seem clear and easy to understand now.
  vasild:
    ACK 04249682e3
  tdb3:
    ACK 04249682e3

Tree-SHA512: 2761cb7555d759670e40d8f37b96a079f8e12a588ac43313b9e63c69afd478321515873a8896ea56784f0100dac4476b0c0e0ef8b5418f8aea24d9965cace4d4
2025-01-06 18:28:33 -05:00
marcofleon
a96b84cb1b fuzz: Abort when calling system time without setting mock time 2025-01-06 15:43:13 +00:00
marcofleon
ff21870e20 fuzz: Add SetMockTime() to necessary targets 2025-01-06 15:43:04 +00:00
merge-script
41a2ce9b7d
Merge bitcoin/bitcoin#31464: util: Add missing types in make_secure_unique
fa397177ac util: Add missing types in make_secure_unique (MarcoFalke)

Pull request description:

  The return type of `std::forward` depends on the template type, and can not be recovered from the args. Attempting to do so will result in a compile failure. For example, `make_secure_unique<std::string>(std::string{});` does not compile on current master, but does with this pull.

  Another example would be `make_secure_unique<std::pair<std::string, std::unique_ptr<int>>>(std::string{}, std::make_unique<int>(21));`

ACKs for top commit:
  hodlinator:
    ACK fa397177ac
  hebasto:
    ACK fa397177ac.
  TheCharlatan:
    ACK fa397177ac

Tree-SHA512: cc902c1111c929a79a6f806b5097136a465e8c727474176bad30a5777ebbb30bedb0bd35273b43bf839d2c00492500ddec724bd17349250451f6b329cb71e6f2
2025-01-06 15:19:24 +00:00
merge-script
6475849c40
Merge bitcoin/bitcoin#31435: lint: Move assertion linter into lint runner
e8f0e6efaf lint: output-only - Avoid repeated arrows, trim (Hodlinator)
fa9aacf614 lint: Move assertion linter into lint runner (MarcoFalke)

Pull request description:

  On failure, this makes the output more consistent with the other linters. Each failure will be marked with an '⚠️ ' emoji and explanation, making it easier to spot.

  Also, add --line-number to the filesystem linter.

  Also, add newlines after each failing check, to visually separate different failures from each other.

  Can be reviewed with:
  `--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`

ACKs for top commit:
  davidgumberg:
    crACK e8f0e6efaf
  hodlinator:
    re-ACK e8f0e6efaf
  TheCharlatan:
    ACK e8f0e6efaf

Tree-SHA512: 9896ff882af9d673ec3e6d2718f877b2fdc8514faba50942fcebacb9de95b1f5b4a5db595e1338fa7f505d06df2df304897350cc55c558c7a85232800e5fd804
2025-01-06 13:35:40 +00:00
Kay
b537a2c02a doc: upgrade license to 2025. 2025-01-06 12:23:11 +00:00
merge-script
49fc2258cf
Merge bitcoin/bitcoin#31526: doc: Install net/py-pyzmq port on FreeBSD for interface_zmq.py
0a76c292ac doc: Install `net/py-pyzmq` port on FreeBSD for `interface_zmq.py` (Hennadii Stepanov)

Pull request description:

  On FreeBSD, Python's `zmq` module is provided as a separate port.

  This PR updates the FreeBSD Build Guide to include this port, enabling the `interface_zmq.py` functional test.

ACKs for top commit:
  maflcko:
    lgtm ACK 0a76c292ac
  vasild:
    ACK 0a76c292ac

Tree-SHA512: c13eada3e870149f47348145d6a29f41125ac75efd88eabe6dd2d0429e0377ed280e76a764cfaf627498c1d07b9135a995cc644146fa666bc3bfa0eb2c86e88b
2025-01-06 11:36:11 +00:00
merge-script
ac918c7cc0
Merge bitcoin/bitcoin#31552: depends: Update capnproto to 1.1.0
b0b8d96d93 depends: Update capnproto to 1.1.0 (Hennadii Stepanov)

Pull request description:

  This change fixes compilation on NetBSD with GCC 14:

  ```
  $ gmake -C depends capnp MULTIPROCESS=1 CC=/usr/pkg/gcc14/bin/gcc CXX=/usr/pkg/gcc14/bin/g++
  gmake: Entering directory '/home/hebasto/dev/bitcoin/depends'
  <snip>
  In file included from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/memory.h:24,
                   from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/exception.h:24,
                   from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async-prelude.h:27,
                   from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async.h:24,
                   from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async-io.h:24,
                   from /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async-io-unix.c++:35:
  /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async-io-unix.c++: In lambda function:
  /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/src/kj/async-io-unix.c++:1243:24: error: 'AI_V4MAPPED' was not declared in this scope
   1243 |       hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
        |                        ^~~~~~~~~~~
  gmake[3]: *** [src/kj/CMakeFiles/kj-async.dir/build.make:146: src/kj/CMakeFiles/kj-async.dir/async-io-unix.c++.o] Error 1
  gmake[2]: *** [CMakeFiles/Makefile2:203: src/kj/CMakeFiles/kj-async.dir/all] Error 2
  gmake[1]: *** [Makefile:136: all] Error 2
  gmake[1]: Leaving directory '/home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5'
  gmake: *** [funcs.mk:302: /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-netbsd10.0/capnp/1.0.2-ffdefffd9f5/./.stamp_built] Error 2
  gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
  ```

  See: ccaa1f87c1.

  However, the other changes between [`v1.0.2`](https://github.com/capnproto/capnproto/releases/tag/v1.0.2) and [`v1.1.0`](https://github.com/capnproto/capnproto/releases/tag/v1.1.0) require a sanity check.

ACKs for top commit:
  hodlinator:
    cr-ACK b0b8d96d93

Tree-SHA512: bb3ee29a609fd452f07fe8a67859d5bc4f0570e6b0f8245a5fe7576caa328220f94565b410757f727d0076a13916ce6b1c0243627b5c509ec4e0d90f1e28d673
2025-01-06 11:31:26 +00:00
MarcoFalke
fa029a7878
doc: Clarify min macOS and Xcode version 2025-01-06 12:30:55 +01:00
merge-script
a0f0c48ae2
Merge bitcoin/bitcoin#31584: txmempool: fix typos in comments
34e8ee23b8 txmempool: fix typos in comments (Boris Nagaev)

Pull request description:

  Fixed typos identified by codespell lint in CI.

ACKs for top commit:
  maflcko:
    lgtm ACK 34e8ee23b8
  hebasto:
    ACK 34e8ee23b8.

Tree-SHA512: b36cddb26e33f042c074185aa6ef1b0339ae0ff05643e1c30bac56b8c9620d89c834ea5befb25d2c602a3dd541209f5a7c04da6ef9f10724144c35a6548ea52c
2025-01-06 11:10:56 +00:00
merge-script
558783625c
Merge bitcoin/bitcoin#31586: doc: Update NetBSD Build Guide
2bdaf52ed1 doc: Update NetBSD Build Guide (Hennadii Stepanov)

Pull request description:

  This PR:

  1. Updates the documented NetBSD version.

  2. Adds the optional ZeroMQ package to align the guide with other *BSD systems.

  3. Updates the Python version to meet the minimum requirement specified in https://github.com/bitcoin/bitcoin/pull/30527.

  4. Suggests to Install [`net/py-zmq`](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/py-zmq/index.html) package to enable the `interface_zmq.py` functional test.

  5. Fix a formatting issue.

  See also the recent NetBSD nightly build at https://github.com/hebasto/bitcoin-core-nightly/actions/runs/12554769828/job/35003929261.

ACKs for top commit:
  tdb3:
    ACK 2bdaf52ed1

Tree-SHA512: 16562e7325dd92e44fa641c8d4e64df69ee76175fc8eba61da06775d4a751307825a6ffe1743fb614a591ba1d33d197ea6b7f9111f5a5b335f6b257bb4868bf6
2025-01-06 10:36:43 +00:00
merge-script
3e936789b1
Merge bitcoin/bitcoin#31592: ci: Run functional tests in msan task
fa0411ee30 ci: Run functional tests in msan task (MarcoFalke)

Pull request description:

  Now that the CI machines have a bit more CPU, it seems good to run the functional tests as well under msan. (Also, bump the llvm minor version)

ACKs for top commit:
  TheCharlatan:
    ACK fa0411ee30

Tree-SHA512: 0dbb2b934485ed54b8caafb5bcd96ddef87088b148dab72a584f721c398bb7fda4095fb720b9ad602dc71f8f40a1e0f29e1b08b2879b78b90b29d46604df36c3
2025-01-06 10:22:52 +00:00
merge-script
5af642bf48
Merge bitcoin/bitcoin#31604: test: fix typo in mempool_ephemeral_dust
29bca9713d test: fix typo in mempool_ephemeral_dust (epysqyli)

Pull request description:

  The `test_node_restart` test in `test/functional/mempool_ephemeral_dust.py` has a repetition in the comment.

ACKs for top commit:
  maflcko:
    lgtm ACK 29bca9713d

Tree-SHA512: 9828d23ca27e24d64031cd103ce9f9bd9e997ef9b63e6122ad6573073fb3c956964a72cd23dfa5773e52e195eee668762ab470bb540e686a4abd3d7561b40c59
2025-01-06 10:22:18 +00:00
epysqyli
29bca9713d
test: fix typo in mempool_ephemeral_dust 2025-01-04 22:50:29 +01:00
Ava Chow
4036ee3f2b
Merge bitcoin/bitcoin#31542: test: Embed univalue json tests in binary
faf7eac364 test: clang-format -i src/univalue/test/unitester.cpp (MarcoFalke)
fafa9cc7a5 test: Embed univalue json tests in binary (MarcoFalke)
fa044857ca test: Re-enable univalue test fail18.json (MarcoFalke)
63b6b638aa build: Use character literals for generated headers to avoid narrowing (Lőrinc)

Pull request description:

  All other benchmarks and tests have their data embedded, except for the univalue json tests.

  This is not only confusing, but also problematic, when the test binary is moved to a different system for testing, because one has to put the test files in the source dir that was used at compile-time.

  Fix all issues by embedding them. Also, re-enable a disabled test. Also, fix an issue in the GenerateHeaderFromJson.cmake.

  Requested in https://github.com/bitcoin/bitcoin/pull/31434/files#r1876000910

ACKs for top commit:
  l0rinc:
    ACK faf7eac364
  fjahr:
    tACK faf7eac364
  achow101:
    ACK faf7eac364
  TheCharlatan:
    Re-ACK faf7eac364
  hebasto:
    Re-ACK faf7eac364. The commit, which modifies CMake scripts, has been replaced with the one from https://github.com/bitcoin/bitcoin/pull/31547, and a formatting commit has been added since my recent [review](https://github.com/bitcoin/bitcoin/pull/31542#pullrequestreview-2517189261).

Tree-SHA512: 72ad202125746f32ccf07411ad3efd2771f27a40525c204cba3c9c83b3ca46d05dd18f6fa5985720c6684bdcbb4c4853fc609ced095ddd1a124832318dd8a55d
2025-01-03 13:58:20 -05:00
Ryan Ofsky
6aa0e70ccb
Merge bitcoin/bitcoin#31524: refactor: Allow std::byte in Read(LE/BE)
fa83bec78e refactor: Allow std::byte in Read(LE/BE) (MarcoFalke)

Pull request description:

  Starting with C++17, `std::byte` is often (not always) a better choice over `uint8_t` for new code.

  However, the existing codebase discourages the use of `std::byte`, when helpers such as `ReadLE32` are used. This is because calling code will be cluttered with byte-casts.

  Fix it by allowing `std::byte` pointers in `ReadLE32` (and friends).

ACKs for top commit:
  sipa:
    utACK fa83bec78e
  fjahr:
    Code review ACK fa83bec78e
  theuni:
    utACK fa83bec78e
  l0rinc:
    ACK fa83bec78e

Tree-SHA512: 83604dc9df9ad447ad1b6f81f1e1844554c2c5331fcb78bdba1300e050d9dcbe9cf7a1b2dd250772bb23a8bf02a4ec26441012fe2f4bcc670ef31c15151adb15
2025-01-03 09:29:04 -05:00
Ryan Ofsky
3e0a992a3f doc: Clarify comments about endianness after #30526
This is a documentation-only change following up on suggestions made in the
#30526 review.

Motivation for this change is that I was recently reviewing #31583, which
reminded me how confusing the arithmetic blob code was and made me want to
write better comments.
2025-01-03 09:19:53 -05:00
glozow
604bf2ea37
Merge bitcoin/bitcoin#28121: include verbose "reject-details" field in testmempoolaccept response
b6f0593f43 doc: add release note about testmempoolaccept debug-message (Matthew Zipkin)
f9cac63523 test: cover testmempoolaccept debug-message in RBF test (Matthew Zipkin)
f9650e18ea rbf: remove unecessary newline at end of error string (Matthew Zipkin)
221c789e91 rpc: include verbose reject-details field in testmempoolaccept response (Matthew Zipkin)

Pull request description:

  Adds a new field `reject-details` in `testmempoolaccept` responses to include `m_debug_message` from `ValidationState`. This string is the complete error message thrown by the mempool in response to `sendrawtransaction`.

  The extra verbosity is helpful to consumers of `testmempoolaccept`, which is sort of a debug tool anyway.

  example:
  >
  > {
  >   "txid": "07d7a59a7bdad4c3a5070659ea04147c9b755ad9e173c52b6a38e017abf0f5b8",
  >   "wtxid": "5dc243b1b92ee2f5a43134eb3e23449be03d1abb3d7f3c03c836ed0f13c50185",
  >   "allowed": false,
  >   "reject-reason": "insufficient fee",
  >   "reject-details": "insufficient fee, rejecting replacement 07d7a59a7bdad4c3a5070659ea04147c9b755ad9e173c52b6a38e017abf0f5b8; new feerate 0.00300000 BTC/kvB <= old feerate 0.00300000 BTC/kvB"
  > }

ACKs for top commit:
  rkrux:
    re-ACK b6f0593f43
  glozow:
    ACK b6f0593f43

Tree-SHA512: 340b8023d59cefa84598879c4efdb7c399a3f62da126e87c595523f302e53d33098fc69da9c5f8c92b7580dc75466c66cea372051f935b197265648fe15c43a3
2025-01-03 07:03:23 -05:00
Sjors Provoost
04249682e3
test: use Mining interface in miner_tests 2025-01-03 11:48:05 +01:00
MarcoFalke
fa0411ee30
ci: Run functional tests in msan task 2025-01-02 13:46:52 +01:00
Hennadii Stepanov
2bdaf52ed1
doc: Update NetBSD Build Guide
1. Update the documented NetBSD version.

2. Add the optional ZeroMQ package to align the guide with other *BSD
systems.

3. Update the Python version to meet the minimum requirement specified
in https://github.com/bitcoin/bitcoin/pull/30527.

4. Install `net/py-zmq` package to enable the `interface_zmq.py`
functional test.

5. Fix a formatting issue.
2024-12-31 10:14:02 +00:00
Boris Nagaev
34e8ee23b8
txmempool: fix typos in comments 2024-12-31 00:04:20 -03:00
Ava Chow
228aba2c4d
Merge bitcoin/bitcoin#31555: descriptor: remove unreachable verification for pkh
366ae00b77 descriptor: Assume `ParseScript` is not being called with a P2WPKH context (brunoerg)
e366408590 descriptor: remove unreachable verification for `pkh` (brunoerg)

Pull request description:

  This PR removes an unreachable verification in the `ParseScript` function. It returns an error if `pkh` is not being used at top level, sh, wsh or tr. However, any usage of `pkh` without these contexts will not reach this verification but other ones like "invalid keys" (e.g. `wpkh(pkh(L4gM1FBdyHNpkzsFh9ipnofLhpZRp2mwobpeULy1a6dBTvw8Ywtd))`).

ACKs for top commit:
  davidgumberg:
    crACK 366ae00b77
  achow101:
    ACK 366ae00b77
  tdb3:
    cr ACK 366ae00b77
  sipa:
    crACK 366ae00b77

Tree-SHA512: b954221a77eed623aeed5eb54f14e82c49540a151d3388831924caa7a784e48a2a975e418af1e13d491e4f8cded3b1797aa39e0e4e39e302a991105df09cdec0
2024-12-30 16:40:11 -05:00
Ava Chow
9b9752217f
Merge bitcoin/bitcoin#31570: test: descriptor: fix test for MaxSatisfactionWeight
b29d68f942 test: descriptor: fix test for `MaxSatisfactionWeight` (brunoerg)

Pull request description:

  To get the maximum size of a satisfaction for a descriptor with no max sig, the parameter `use_max_sig` should be false.

ACKs for top commit:
  fjahr:
    utACK b29d68f942
  achow101:
    ACK b29d68f942
  tdb3:
    re ACK b29d68f942
  furszy:
    utACK b29d68f942

Tree-SHA512: 8559718d126e60ce21a34183f74d227546108b43e3897e49622d6677ed9e7707caa962fd811d8787bd4dafc48a0e779ef11050d5990293faa2f91ded4aaa4f4b
2024-12-30 15:04:51 -05:00
Ava Chow
87c9ebd889
Merge bitcoin/bitcoin#31563: rpc: Extend scope of validation mutex in generateblock
fa63b8232f test: generateblocks called by multiple threads (MarcoFalke)
fa62c8b1f0 rpc: Extend scope of validation mutex in generateblock (MarcoFalke)

Pull request description:

  The mutex (required by TestBlockValidity) must be held after creating the block, until TestBlockValidity is called. Otherwise, it is possible that the chain advances in the meantime and leads to a crash in TestBlockValidity: `Assertion failed: pindexPrev && pindexPrev == chainstate.m_chain.Tip() (validation.cpp: TestBlockValidity: 4338)`

  Fixes #31562

ACKs for top commit:
  davidgumberg:
    reACK fa63b8232f
  achow101:
    ACK fa63b8232f
  ismaelsadeeq:
    re-ACK fa63b8232f
  mzumsande:
    utACK fa63b8232f

Tree-SHA512: 3dfda1192af52546ab11fbffe44af8713073763863f4a63fbcdbdf95b1c6cbeb003dc4b8b29e7ec67362238ad15e07d8f6855832a0c68dc5370254f8cbf9445c
2024-12-30 14:49:21 -05:00
Ava Chow
df5c643f92
Merge bitcoin/bitcoin#31556: validation: Send correct notification during snapshot completion
bc43ecaf6d test: add functional test for balance after snapshot completion (Martin Zumsande)
226d03dd61 validation: Send correct notification during snapshot completion (Martin Zumsande)

Pull request description:

  After AssumeUtxo background sync is completed in a `ActivateBestChain()` call, the `GetRole()` function called with `BlockConnected()` returns `ChainstateRole::NORMAL` instead of `ChainstateRole::BACKGROUND` for this chainstate.
  This would make the wallet (which ignores `BlockConnected` notifications for the background chainstate) process it, change `m_last_block_processed_height` to the (ancient) snapshot height, and display an incorrect balance.

  Fix this by caching the chainstate role before calling `ActivateBestChainStep()`.
  Also contains a test for this situation that fails on master.

  Fixes #31546

ACKs for top commit:
  fjahr:
    re-ACK bc43ecaf6d
  achow101:
    ACK bc43ecaf6d
  furszy:
    Code review ACK bc43ecaf6d
  TheCharlatan:
    lgtm ACK bc43ecaf6d

Tree-SHA512: c5db677cf3fbab3a33ec127ec6c27c8812299e8368fd3c986bc34d0e515c4eb256f6104479f27829eefc098197de3af75d64ddca636b6b612900a0e21243e4f2
2024-12-30 14:40:27 -05:00
Ava Chow
fa3de038f7
Merge bitcoin/bitcoin#31537: qa: Limit -maxconnections in tests
d9d5bc2e74 qa: Limit `-maxconnections` in tests (Hennadii Stepanov)

Pull request description:

  On systems such as NetBSD, the `bitcoind` typically prints the following warning:
  ```
  Warning: Reducing -maxconnections from 125 to 96, because of system limitations.
  ```

  This breaks the functional test framework (see https://github.com/bitcoin/bitcoin/issues/23968).

  This PR limits the `-maxconnections` to mitigate the issue and enable functional tests on NetBSD.

  Fixes https://github.com/bitcoin/bitcoin/issues/23968.

  Here is CI log from the [`bitcoin-core-nightly`](https://github.com/hebasto/bitcoin-core-nightly) repository: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/12415868523/job/34663207030

ACKs for top commit:
  maflcko:
    re-ACK d9d5bc2e74
  achow101:
    ACK d9d5bc2e74
  mzumsande:
    Code Review ACK d9d5bc2e74
  tdb3:
    tested ACK d9d5bc2e74

Tree-SHA512: ad02adce98ce609176c9688289a0ca347932da5b6f259c6ab4e686914352f3d61f819adc150be80220f969200ee6a0c1c8737426525816fa0df58d688c51410c
2024-12-30 14:34:22 -05:00
Ava Chow
ba0cb7d5a5
Merge bitcoin/bitcoin#31468: test: Avoid intermittent error in assert_equal(pruneheight_new, 248)
fa0998f0a0 test: Avoid intermittent error in assert_equal(pruneheight_new, 248) (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/31446

  The test uses the P2P network to sync blocks, which has no inherent guarantee that the blocks are sent and received in the right order, assuming the headers are received first.

  This can mean that the first block file is flushed with block at height 249 and block at height 248 is added to the second file. In the log it looks like: `Leaving block file 0: CBlockFileInfo(blocks=249, size=65319, heights=0...249, time=2011-02-02...2024-12-03) (onto 1) (height 248)`. The test assumes that the height of the last pruned block in the first file is 248, expecting it to look like: `Leaving block file 0: CBlockFileInfo(blocks=249, size=65319, heights=0...248, time=2011-02-02...2024-12-09) (onto 1) (height 249) `.

  Fix the issue by using a linear dumb sync.

ACKs for top commit:
  achow101:
    ACK fa0998f0a0
  mzumsande:
    Code Review ACK fa0998f0a0
  i-am-yuvi:
    Code Review ACK fa0998f0a0
  fjahr:
    Code review ACK fa0998f0a0

Tree-SHA512: 59cb4317be6cf9012c9bf7a3e9f5ba96b8b114b30bd2ac42af4fe742cd26a634d685b075f04a84bd782b2a43a342d75bb20a042bd82ad2831dbf844d39517ca2
2024-12-30 14:28:01 -05:00
Ava Chow
69e35f5c60
Merge bitcoin/bitcoin#31403: test: Call generate RPCs through test framework only
fa6e599cf9 test: Call generate through test framework only (MarcoFalke)

Pull request description:

  The generate RPCs are special in that they should only be called by the test framework itself. This way, they will call the sync function on the nodes, which can avoid intermittent test issues. Also, when the sync is disabled, it will happen explicitly by setting the `sync_fun`.

  Apply this rule here, so that all generate calls are written consistently.

ACKs for top commit:
  achow101:
    ACK fa6e599cf9
  rkrux:
    tACK fa6e599cf9
  hodlinator:
    ACK fa6e599cf9
  i-am-yuvi:
    Tested ACK fa6e599cf9

Tree-SHA512: 31079997f1e17031ecd577904457e0560388aa53cadb1bbda281865271e8e4cf244bc6bf315838a717bf9d6620c201093e30039aa0007bec3629f7ca56abfba3
2024-12-30 14:19:07 -05:00