Commit Graph

27780 Commits

Author SHA1 Message Date
fanquake
2a39b93233
Merge bitcoin/bitcoin#27226: test: Use self.wait_until over wait_until_helper
faa671591f9c83ef0fb5afea151a1907c28f024b test: Use self.wait_until over wait_until_helper (MarcoFalke)

Pull request description:

  `wait_until_helper` is a "private" helper, not intended to be used directly, because it doesn't scale the timeout with the timeout factor. Fix this by replacing it with a call to `self.wait_until`, which does the scaling.

ACKs for top commit:
  theStack:
    Code-review ACK faa671591f9c83ef0fb5afea151a1907c28f024b

Tree-SHA512: 70705f309f83ffd6ea5d090218195d05b868624d909106863372f861138b5a70887070b25beb25044ae1b44250345e45c9cc11191ae7aeca2ad37801a0f62f61
2024-10-24 12:48:23 -05:00
fanquake
be2e16f33a
Merge bitcoin/bitcoin#27192: util: add missing include and fix function signature
8847ce44e0713350a6d3524f62eaeb10ba548bae util: add missing include and fix function signature (Cory Fields)

Pull request description:

  ping hebasto

  Discovered while testing pre-compiled header support with CMake: https://github.com/theuni/bitcoin/commits/cmake-pch-poc. Compilation of that branch fails without this fix and succeeds with it.

  Similar to the fix in #27144.

  The problem of having a default argument in the definition was masked by the missing include. Using PCH forces that include, so we end up with the compiler error we should've been getting all along.

ACKs for top commit:
  fanquake:
    ACK 8847ce44e0713350a6d3524f62eaeb10ba548bae

Tree-SHA512: 5eb9a6691ee37cbc5033a48aedcbf5c93af3b234614ae14c3fcc858f1ee505f630ad68f8bbb69ffa280080c8d0f91451362cb3819290b741ce906b2b3224a622
2024-10-24 12:48:23 -05:00
fanquake
176a4a60d2
Merge bitcoin/bitcoin#27173: valgrind: remove libsecp256k1 suppression
29b62c01c8d211475ea9dd1a1093820f0a86c06d valgrind: remove libsecp256k1 suppression (fanquake)

Pull request description:

  I am no-longer been able to recreate this issue, atleast after the most recent libsecp256k1 changes. Can someone else confirm?

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 29b62c01c8d211475ea9dd1a1093820f0a86c06d
  sipa:
    utACK 29b62c01c8d211475ea9dd1a1093820f0a86c06d

Tree-SHA512: e61e5b88ac2af3c779f23d999938bec4497f6433a029c07dd57a9481fe9cc104d8d8f63586910b29f41e66bbf0ed094bc7539c0df84754a1783c4b1b15af072e
2024-10-24 12:48:22 -05:00
glozow
d2fc8be331
Merge bitcoin/bitcoin#27154: doc: mention sanitizer suppressions in developer docs
84ca5b349ecc2ad083bb39352e5d5ae731fb1622 doc: mention sanitizer suppressions in developer docs (fanquake)

Pull request description:

  Should be enough to close #17834.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 84ca5b349ecc2ad083bb39352e5d5ae731fb1622

Tree-SHA512: 233c688a3cef1006c9a00f7b7a52fd6ee0ec150367e5e56904b6f1bbdca21b9217c69f8fcf653a4943613d12c3178a39f761b25eb24fc1954a563cfb1f832f5e
2024-10-24 12:39:48 -05:00
UdjinM6
c76e398caa
ci: check ff after merge into base branch for PRs 2024-10-24 20:36:41 +03:00
pasta
aaccc9ea51
Merge #6345: backport: trivial 2024 10 23 pr1
b70e091374 Merge bitcoin/bitcoin#29667: fuzz: actually test garbage >64b in p2p transport test (fanquake)
6d7aa3d978 Merge bitcoin/bitcoin#29497: test: simplify test_runner.py (fanquake)
d0e15d59f8 Merge bitcoin/bitcoin#29606: refactor: Reserve memory for ToLower/ToUpper conversions (Ava Chow)
045fa5f57e Merge bitcoin/bitcoin#29514: tests: Provide more helpful assert_equal errors (Ava Chow)
bd607f049d Merge bitcoin/bitcoin#29393: i2p: log connection was refused due to arbitrary port (Ava Chow)
c9617558e3 Merge bitcoin/bitcoin#29595: doc: Wrap flags with code in developer-notes.md (fanquake)
8d6e5e7d67 Merge bitcoin/bitcoin#29583: fuzz: Apply fuzz env (suppressions, etc.) when fetching harness list (fanquake)
4dce690a5e Merge bitcoin/bitcoin#29576: Update functional test runner to return error code when no tests are found to run (fanquake)
910a7d6cbf Merge bitcoin/bitcoin#29529: fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)
fdac2b3286 Merge bitcoin/bitcoin#29493: subtree: update crc32c subtree (fanquake)
a23b342d7d Merge bitcoin/bitcoin#29475: doc: Fix Broken Links (fanquake)
92bad90e6c Merge bitcoin/bitcoin#28178: fuzz: Generate with random libFuzzer settings (fanquake)
9b6a05df66 Merge bitcoin/bitcoin#29443: depends: fix BDB compilation on OpenBSD (fanquake)
9963e6bc28 Merge bitcoin/bitcoin#29413: fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (fanquake)
3914745a10 Merge bitcoin/bitcoin#29425: test: fix intermittent failure in wallet_reorgrestore.py (fanquake)
b719883081 Merge bitcoin/bitcoin#29399: test: Fix utxo set hash serialisation signedness (fanquake)
f0968807bc Merge bitcoin/bitcoin#29377: test: Add makefile target for running unit tests (Ava Chow)
03e0bd3347 Merge bitcoin/bitcoin#27319: addrman, refactor: improve stochastic test in `AddSingle` (Ava Chow)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK b70e091374
  knst:
    utACK b70e091374

Tree-SHA512: 659a931f812c8a92cf3854abb873d92885219a392d6aa8e49ac4b27fe41e8e163ef9a135050e7c2e1bd33cecd2f7dae215e05a9c29f62e837e0057d3c16746d6
2024-10-24 12:24:43 -05:00
Andrew Chow
3be81a2d4c
Merge bitcoin/bitcoin#25915: test: Fix wallet_balance intermittent issue
fae5bd920007c33de0b794bf2b2d698bfccc12ee test: Fix wallet_balance intermittent issue (MacroFake)

Pull request description:

  Diff to reproduce:

  ```diff
  index d2ed97ca76..25cc2d5734 100755
  --- a/test/functional/wallet_balance.py
  +++ b/test/functional/wallet_balance.py
  @@ -265,7 +265,7 @@ class WalletTest(BitcoinTestFramework):
           self.nodes[0].invalidateblock(block_reorg)
           self.nodes[1].invalidateblock(block_reorg)
           assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted
  -        self.generatetoaddress(self.nodes[0], 1, ADDRESS_WATCHONLY, sync_fun=self.no_op)
  +        self.generatetoaddress(self.nodes[0], 1, ADDRESS_WATCHONLY)
           assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted

           # Now confirm tx_orig
  ```

  Example in CI:

  ```
   test  2022-08-24T10:09:22.486000Z TestFramework (ERROR): Assertion failed
                                     Traceback (most recent call last):
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 133, in main
                                         self.run_test()
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/wallet_balance.py", line 269, in run_test
                                         assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/util.py", line 56, in assert_equal
                                         raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
                                     AssertionError: not(98.85983340 == 0)
  ```

  https://cirrus-ci.com/task/4981266251513856?logs=ci#L3269

ACKs for top commit:
  achow101:
    ACK fae5bd920007c33de0b794bf2b2d698bfccc12ee
  w0xlt:
    ACK fae5bd9200

Tree-SHA512: 470f366720615c4a9326ec4c581fff569ecce9877f9134bb1975ec3d6f1d13a6403051418a91a80b2a86de617f43e539ec11bbf4f1713d0354d5b0ab98d22437
2024-10-24 11:21:49 -05:00
MacroFake
da1d3f2654
Merge bitcoin/bitcoin#25663: tracing: do not use coin after move in CCoinsViewCache::AddCoin
f8e228476f54b36beacc3fd09038dfeebdac6b3c tracing: do not use `coin` after move in `CCoinsViewCache::AddCoin` (Seibart Nedor)

Pull request description:

  This is fix for https://github.com/bitcoin/bitcoin/issues/25640.

ACKs for top commit:
  0xB10C:
    ACK f8e228476f54b36beacc3fd09038dfeebdac6b3c

Tree-SHA512: e7643ac8e6b6247aaf250f44572c4b458da4aea030ac0268227564e6857200e9c23efe325cfc535f46498cbeccaf46301551efeeb54b062f71d2dcf1ffe71fb8
2024-10-24 11:21:49 -05:00
fanquake
9a79217756
Merge bitcoin/bitcoin#28227: test: check for specific bip157 disconnect reasons, add test coverage
2ab7952bda8d15e91b03f8307839030cbb55614e test: add bip157 coverage for (start height > stop height) disconnect (Sebastian Falbesoner)
63e90e1d3f5ed08f9871f07667d389ec66aa621c test: check for specific disconnect reasons in p2p_blockfilters.py (Sebastian Falbesoner)

Pull request description:

  This PR checks for specific disconnect reasons using `assert_debug_log` in the functional test `p2p_blockfilters.py`. With that we ensure that the disconnect happens for the expected reason and also makes it easier to navigate between implementation and test code, i.e. both the questions "do we have test coverage for this disconnect cause?" (from an implementation reader's perspective) and "where is the code handling this disconnect cause?" (from a test reader's perspective) can be answered simply by grep-ping the corresponding debug message.

  Also, based on that, missing coverage for the (start height > stop height) disconnect case is added:
  b7138252ac/src/net_processing.cpp (L3050-L3056)

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 2ab7952bda8d15e91b03f8307839030cbb55614e
  furszy:
    Looks good, code ACK 2ab7952b

Tree-SHA512: 0581cb569d5935aaa004a95a6f16eeafe628b9d816ebb89232f2832e377049df878a1e74c369fb46931b94e1a3a5e3f4aaa21a007c0a488f4ad2cda0919c605d
2024-10-24 11:18:40 -05:00
Hennadii Stepanov
a7a4603b8e
Merge bitcoin-core/gui#755: Silence -Wcast-function-type warning
befb42f1462f886bf5bed562ba1dae00853cecde qt: Silence `-Wcast-function-type` warning (Hennadii Stepanov)

Pull request description:

  On Fedora 38 @ 8f7b9eb8711fdb32e8bdb59d2a7462a46c7a8086:
  ```
  $ x86_64-w64-mingw32-g++ --version | head -1
  x86_64-w64-mingw32-g++ (GCC) 12.2.1 20221121 (Fedora MinGW 12.2.1-8.fc38)
  $ ./configure CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-Wno-return-type -Wcast-function-type"
  $ make > /dev/null
  qt/winshutdownmonitor.cpp: In static member function 'static void WinShutdownMonitor::registerShutdownBlockReason(const QString&, HWND__* const&)':
  qt/winshutdownmonitor.cpp:46:42: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'PSHUTDOWNBRCREATE' {aka 'int (*)(HWND__*, const wchar_t*)'} [-Wcast-function-type]
     46 |     PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate");
        |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ```

  [Required](https://github.com/bitcoin/bitcoin/pull/25972#issuecomment-1713999563) for https://github.com/bitcoin/bitcoin/pull/25972.

  Picked from https://trac.nginx.org/nginx/ticket/1865.

ACKs for top commit:
  MarcoFalke:
    review ACK befb42f1462f886bf5bed562ba1dae00853cecde

Tree-SHA512: b37b2c5dd8702caf84d1833c3511bc46ee14f23b84678b8de0fd04e24e5ecc5fd4d27ba38be0d0b08de91299369f70d4924c895a71fd8e0b6feffcfb7407574a
2024-10-24 11:18:39 -05:00
fanquake
e216d0851d
Merge bitcoin/bitcoin#27934: test: added coverage to estimatefee
d05be124dbc0b24fb69d0c28ba2d6b297d243751 test: added coverage to estimatefee (kevkevin)

Pull request description:

  Added a assert for an rpc error when we try to estimate fee for the max conf_target

  Line I am adding coverage to https://github.com/bitcoin/bitcoin/blob/master/src/rpc/fees.cpp#LL71C52-L71C52

ACKs for top commit:
  MarcoFalke:
    lgtm ACK d05be124dbc0b24fb69d0c28ba2d6b297d243751

Tree-SHA512: dfab075989446e33d1a5ff1a308f1ba1b9f80cce3848fbe4231f69212ceef456a3f2b19365a42123e0397c31893fd9f1fd9973cc00cfbb324386e12ed0e6bccc
2024-10-24 11:18:39 -05:00
fanquake
34f0f56582
Merge bitcoin/bitcoin#28506: fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT
fa33b2c889b90bd44f188ba5f0fafe31d7d7fad7 fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT (MarcoFalke)

Pull request description:

  Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62455

ACKs for top commit:
  dergoegge:
    utACK fa33b2c889b90bd44f188ba5f0fafe31d7d7fad7

Tree-SHA512: 735926f7f94ad1c3c5dc0fc62a2ef3a85abae25f4fe1e7654c2857ce3e867667ed28da58ab36281d730d3e206a0728cb429671ea5d3ccd11519e637eb191f70d
2024-10-24 11:18:39 -05:00
fanquake
ca0225c0fd
Merge bitcoin/bitcoin#28480: fuzz: Don't use afl++ deferred forkserver mode
508d05f8a7b511dd53f543df8899813487eb03e5 [fuzz] Don't use afl++ deferred forkserver mode (dergoegge)

Pull request description:

  Fixes #28469

  This makes our afl++ harness essentially behave like libFuzzer, with the exception that the whole program does fully reset every 100000 iterations. 100000 is somewhat arbitrary and we could also go with `std::numeric_limits<unsigned in>::max()` but a smaller limit does allow for the occasional reset to counter act some amount of instability in the fuzzing loop (e.g. non-determinism, statefulness).

  It's a bit of a shame to do this just for the targets whose initial state can't be forked (e.g. threads) because other targets do benefit from not having to redo the state setup. An alternative would be https://github.com/bitcoin/bitcoin/issues/28469#issuecomment-1717526774:
  ```
  If the goal is to be maximally performant, the fork would need to happen for each fuzz target specifically.
  I guess it can be achieved by wrapping __AFL_INIT(); into a helper function and then require all fuzz
  target initialize() to call it?
  ```

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 508d05f8a7b511dd53f543df8899813487eb03e5

Tree-SHA512: d9fe94e2e3198795f8fb58f67eb383531a534bcd4ec75a1f0ae6ccb5531863dbc09800bb7d77536417745c4c8bc49a4f84dcc959918b27d4997a270eeacb0e7e
2024-10-24 11:18:39 -05:00
fanquake
2b236ad07b
Merge bitcoin/bitcoin#28460: fuzz: Use afl++ shared-memory fuzzing
97e2e1d641016cd7b74848b9560e3771f092c1ea [fuzz] Use afl++ shared-memory fuzzing (dergoegge)

Pull request description:

  Using shared-memory is faster than reading from stdin, see 7d2122e059/instrumentation/README.persistent_mode.md

ACKs for top commit:
  MarcoFalke:
    review ACK 97e2e1d641016cd7b74848b9560e3771f092c1ea

Tree-SHA512: 7e71b5f84835e41531c19ee959be2426da245869757de8e5dd1c730ae83ead650e2ef75f4d594d7965f661821a4ffbd27be84d3ce623702991501b34a8d02fc3
2024-10-24 11:18:39 -05:00
fanquake
52f036b316
Merge bitcoin/bitcoin#28427: index: coinstats reorg, fail when block cannot be reversed
c0bf667912064960df194ea94150976b34f7c267 index: add [nodiscard] attribute to functions writing to the db (furszy)
eef595560e9ecf3a0d1db4d8ea7ecc33a49d839f index: coinstats reorg, fail when block cannot be reversed (furszy)

Pull request description:

  Found it while reviewing https://github.com/bitcoin/bitcoin/pull/24230#discussion_r1310863359.

  During a reorg, continuing execution when a block cannot be reversed leaves the
  coinstats index in an inconsistent state.
  This was surely overlooked when 'CustomRewind' was implemented.

ACKs for top commit:
  ryanofsky:
    Code review ACK c0bf667912064960df194ea94150976b34f7c267. Only change since last review is new commit adding [[nodiscard]]

Tree-SHA512: f4fc8522508d23e4fff09a29c935971819b1bd3b2a260e08e2e2b72f9340980d74fbec742a58fe216baf61d27de057c7c8300e8fa075f8507cd1227f128af909
2024-10-24 11:18:39 -05:00
fanquake
6ad6f2f28d
Merge bitcoin/bitcoin#28412: test: remove unused variables in p2p_invalid_block
3eb03803c4111d09c63550a6a6c09afbe3430bf6 test: remove unused variables in `p2p_invalid_block` (brunoerg)

Pull request description:

ACKs for top commit:
  stickies-v:
    ACK 3eb03803c4111d09c63550a6a6c09afbe3430bf6

Tree-SHA512: eadae1eb323e5562d1ea0aed43ebf0145f0fdbb6cd6d4646bbf1ca89f384820e7b9cb69f0bb04a949e9f8983a879aee8387d6f7ac3d4e4ea027f8892e656fb98
2024-10-24 11:18:39 -05:00
fanquake
43b88315e1
Merge bitcoin/bitcoin#28426: doc: s/--no-substitute/--no-substitutes in guix/INSTALL
8f541023b9582f8291d00ed4fc14a0db096b0113 doc: s/--no-substitute/--no-substitutes in guix/INSTALL (fanquake)

Pull request description:

  https://guix.gnu.org/manual/en/html_node/Common-Build-Options.html

ACKs for top commit:
  hebasto:
    ACK 8f541023b9582f8291d00ed4fc14a0db096b0113.
  TheCharlatan:
    ACK 8f541023b9582f8291d00ed4fc14a0db096b0113

Tree-SHA512: 4d79791a8fa772d35723d35e85aaf9ab86304f2a1238e883bbb85051d0cc5f9841dab99ef0fe1e9d67f6259798e98942be00ae7c4320328987234293d9bf3012
2024-10-24 11:18:38 -05:00
fanquake
1730a267ba
Merge bitcoin/bitcoin#28386: test: remove fixed timeouts from feature_config_args
fbcacd4cf0dbe54e51f89cda05ff3db9e378ea12 test: remove fixed timeouts from feature_config_args (Martin Zumsande)

Pull request description:

  Fixes #28290

  These fixed timeouts aren't affected by the `timeout_factor` option and can therefore cause timeouts in slow environments.
  They are also unnecessary for the test because they measure the wrong thing:
  While there is an internal waiting time of 60s within `ThreadOpenConnections` (beginning only when that thread is started) for fixed seeds querying, the timeouts here don't measure that but the time from startup until a debug log message is encountered, during which many other things happen in init, so they don't make much sense to me in the first place.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK fbcacd4cf0dbe54e51f89cda05ff3db9e378ea12

Tree-SHA512: 7bb3b7db2f9666b1929ffb7773c838ee98b0845569428e5d00ecf5234973d534c4f474e213896c71baabd6096a79347bd21b41a17b130053049714eb8a447c79
2024-10-24 11:18:38 -05:00
fanquake
7f83db0d0c
Merge bitcoin/bitcoin#28332: test: previous releases: speed up fetching sources with shallow clone
360ac64b90ee16cc24bd4c574ec7e11760515a79 test: previous releases: speed up fetching sources with shallow clone (Sebastian Falbesoner)

Pull request description:

  For the sake of building previous releases, fetching the whole history of the repository for each version seems to be overkill as it takes much more time, bandwidth and disk space than necessary. Create a shallow clone instead with history truncated to the one commit of the version tag, which is directly checked out in the same command. This has the nice side-effect that we can remove the extra `git checkout` step after as it's not needed anymore.

  Note that it might look confusing to pass a _tag_ to a parameter named `--branch`, but the git-clone manpage explicitly states that this is supported.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 360ac64b90ee16cc24bd4c574ec7e11760515a79

Tree-SHA512: c885a695c1ea90895cf7a785540c24e8ef8d1d9ea78db28143837240586beb6dfb985b8b0b542d2f64e2f0ffdca7c65fc3d55f44b5e1b22cc5535bc044566f86
2024-10-24 11:18:38 -05:00
fanquake
8490bf4b03
Merge bitcoin/bitcoin#28288: test: fix 'unknown named parameter' test in wallet_basic
452c094449de00f3640e6e0763366e7603375825 test: fix 'unknown named parameter' test in `wallet_basic` (brunoerg)

Pull request description:

  This PR removes loop when testing an unknown named parameter. They don't have any effect.

ACKs for top commit:
  jonatack:
    ACK 452c094449de00f3640e6e0763366e7603375825
  theStack:
    re-ACK 452c094449de00f3640e6e0763366e7603375825

Tree-SHA512: cf1a37d738bb6fdf9817e7b1d33bc69643dae61e3dbfae5c1e9f26220c55db6f134018dd9a1c65c13869ee58bcb6f3337c5999aabf2614d3126fbc01270705e8
2024-10-24 11:18:38 -05:00
fanquake
8b8ff1c7d5
Merge bitcoin/bitcoin#28215: fuzz: fix a couple incorrect assertions in the coins_view target
e417c988f61bf9d3948d5c8e169626922fe6e24c fuzz: coins_view: remove an incorrect assertion (Antoine Poinsot)
c5f6b1db56f67f529377bfb61f58c0a8c17b0127 fuzz: coins_view: correct an incorrect assertion (Antoine Poinsot)

Pull request description:

  The `coins_view` fuzz target would assert in two places that the cache is consistent with the backend. But it's never the case (that's the whole point of using a cache).

  The only reason this didn't result in a crash was that we would never actually hit these assertions. I ran into this while introducing a new target with an in-memory `CCoinsViewDB` as the backend view (see https://github.com/bitcoin/bitcoin/pull/28216) which made the code paths with those assertions actually reachable.

ACKs for top commit:
  dergoegge:
    Code review ACK e417c988f61bf9d3948d5c8e169626922fe6e24c

Tree-SHA512: 5847bb2744a2f2831dace62d32b79cc491bf54e2af4ce425411d245d566622d9aff816d9be5ec8e830d10851c13f2500bf4f0c004d88b4d7cca1d483ef8960a6
2024-10-24 11:18:38 -05:00
fanquake
c36f7d93fa
Merge bitcoin/bitcoin#27401: tracepoints: Disables -Wgnu-zero-variadic-macro-arguments to compile without warnings
5197660e947435e510ef3ef72be8be8dee3ffa41 tracepoints: Disables `-Wgnu-zero-variadic-macro-arguments` to compile without warnings (Martin Leitner-Ankerl)

Pull request description:

  Fixes #26916 by disabling the warning `-Wgnu-zero-variadic-macro-arguments` when clang is used as the compiler.

  Also see the comments
  * Proposed changes in the bug  https://github.com/bitcoin/bitcoin/issues/26916#issuecomment-1480997053
  * Proposed changes when moving to a variadic maro: https://github.com/bitcoin/bitcoin/pull/26593#discussion_r1155488768

ACKs for top commit:
  hebasto:
    ACK 5197660e947435e510ef3ef72be8be8dee3ffa41, I've reconsidered my [comment](https://github.com/bitcoin/bitcoin/pull/27401#issuecomment-1507142439) and I think the current localized approach is optimal.
  fanquake:
    ACK 5197660e947435e510ef3ef72be8be8dee3ffa41 - checked that this fixes the warnings under Clang.

Tree-SHA512: c3dda3bcbb2540af6283ffff65885a9937bfdaaef3b00dc7d60b9f9740031d5c36ac9cb3d3d8756dbadce4812201a9754f5b8770df0d5e0d5ee690ba8a7135d2
2024-10-24 11:18:38 -05:00
fanquake
163020ef92
Merge bitcoin/bitcoin#28203: refactor: serialization simplifications
f054bd072afb72d8dae7adc521ce15c13b236700 refactor: use "if constexpr" in std::vector's Unserialize() (Martin Leitner-Ankerl)
088caa68fb8efd8624709d643913b8a7e1218f8a refactor: use "if constexpr" in std::vector's Serialize() (Martin Leitner-Ankerl)
0fafaca4d3bbf0c0b5bfe1ec617ab15252ea51e6 refactor: use "if constexpr" in prevector's Unserialize() (Martin Leitner-Ankerl)
c8839ec5cd81ba9ae88081747c49ecc758973dd1 refactor: use "if constexpr" in prevector's Serialize() (Martin Leitner-Ankerl)
1403d181c106bc271ad2522adebde07c7850069b refactor: use fold expressions instead of recursive calls in UnserializeMany() (Martin Leitner-Ankerl)
bd08a008b42dac921bd9c031637e378899c1cd1d refactor: use fold expressions instead of recursive calls in SerializeMany() (Martin Leitner-Ankerl)

Pull request description:

  This simplifies the serialization code a bit and should also make it a bit faster.

  * use fold expressions instead of recursive calls. This simplifies the code, makes it most likely faster because it reduces the number of function calls, and compiles faster because there are fewer template instantiations.

  * use `if constexpr` instead of unnecessarily creating a temporary object only to call the right overload. This is used for `std::vector` and `prevector` serialization.

ACKs for top commit:
  MarcoFalke:
    only change is to add a missing `&`. lgtm, re-ACK f054bd072afb72d8dae7adc521ce15c13b236700 📦
  jonatack:
    ACK f054bd072afb72d8dae7adc521ce15c13b236700
  sipa:
    utACK f054bd072afb72d8dae7adc521ce15c13b236700
  john-moffett:
    ACK f054bd072afb72d8dae7adc521ce15c13b236700

Tree-SHA512: 0417bf2d6be486c581732297945449211fc3481bac82964e27628b38ef55a47dfa58d730148aeaf1b19fa8eb1076489cc646ceebb178162a9afa59034601501d
2024-10-24 11:18:38 -05:00
fanquake
24e57da770
Merge bitcoin/bitcoin#28181: qa, doc: Fix comment
ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7 qa, doc: Fix comment (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up for:
  - https://github.com/bitcoin/bitcoin/pull/9956
  - https://github.com/bitcoin/bitcoin/pull/10096

ACKs for top commit:
  RandyMcMillan:
    ACK ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7

Tree-SHA512: 267ae52c961ee79e172f27cb1587282ac5cf7ec929a136db6feed3de4f319a74b462befd9b99711081db8a5c30a513f72366364068700418b273a31958b31b1d
2024-10-24 11:18:38 -05:00
fanquake
933a63e8fc
Merge bitcoin/bitcoin#28145: valgrind: add suppression for bug 472219
50f7214e0915a88dd81c1ac1d292e049a398cda2 valgrind: add suppression for bug 472219 (fanquake)

Pull request description:

  Now that https://bugs.kde.org/show_bug.cgi?id=472219 has been fixed upstream in:

  https://sourceware.org/git/?p=valgrind.git;a=commit;h=6ce0979884a8f246c80a098333ceef1a7b7f694d

  Add a supression to ignore the bug until we are using a fixed version of Valgrind.

  Related to #28072.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 50f7214e0915a88dd81c1ac1d292e049a398cda2

Tree-SHA512: 1030f3709195250350fd9c558420a9b1773fb54fdb323e0452a46eeb69ec6d60b5df50bde617c12d917e16dde07db64dee1b0101ddd4eda6161261fc7f6d4474
2024-10-24 11:18:37 -05:00
fanquake
33766805eb
Merge bitcoin/bitcoin#28124: fuzz: Re-enable symbolize=1 in ASAN_OPTIONS
faa8c1be265d2344a3bc0932455b0182ec7d64c7 fuzz: Re-enable symbolize=1 in ASAN_OPTIONS (MarcoFalke)

Pull request description:

  Looks like this fixed itself somehow and is no longer reproducible?

ACKs for top commit:
  fanquake:
    ACK faa8c1be265d2344a3bc0932455b0182ec7d64c7

Tree-SHA512: 67d2d6349cc7485f32bebabc18869ab101ae66a778a40ff9ddb037980997e600d7c6d1e0a17a011fa2a4ba07c73594b087dd781248cb8351f2688bc4cf6e587d
2024-10-24 11:18:37 -05:00
fanquake
621061459a
Merge bitcoin/bitcoin#28099: contrib: move user32.dll from bitcoind.exe libs
8c3850923300352f14dc3dde6a6ce6689ddef185 contrib: move user32.dll from bitcoind.exe libs (fanquake)

Pull request description:

  The user interface library is no-longer needed by `bitcoind.exe`, or utils, only `bitcoin-qt.exe`.
  Add missing doc.

ACKs for top commit:
  hebasto:
    ACK 8c3850923300352f14dc3dde6a6ce6689ddef185, I've verified imported libraries on a Windows machine with the `dumpbin /imports` command.

Tree-SHA512: f752a5b807341c87320523f4e7c564c8acdbfc1313054a684844035102a7c4695d34cfefb0c6904f3151b2dfdcb54d6ea243c570deceeda30345944251e4c513
2024-10-24 11:18:37 -05:00
fanquake
90a1fb0e8d
Merge bitcoin/bitcoin#28650: fuzz: Merge with -set_cover_merge=1
fa858d63a0a5d794aab38c26f60c593513fe08de fuzz: Merge with -set_cover_merge=1 (MarcoFalke)

Pull request description:

  This should be less controversial than commit 151a2b189c3561dda2bb7de809306c1cfeb40e23. The overall size of the qa-assets repo is reduced further from 1.9GB to 1.6GB. Also, the runtime to iterate on the resulting folder is reduced further from ~1699s to ~1149s (N=1).

ACKs for top commit:
  murchandamus:
    crACK fa858d63a0a5d794aab38c26f60c593513fe08de
  dergoegge:
    ACK fa858d63a0a5d794aab38c26f60c593513fe08de

Tree-SHA512: e23fa93bd48f01d11c551b035004c678bd6d76bc24ac7d0d0a7883060804e6711763cbd0cd0ded3aad3e4c40da764decae81c2703388cc11961def3c89a4f9ba
2024-10-24 11:17:28 -05:00
fanquake
f007abd19d
Merge bitcoin/bitcoin#28459: build: add -mbranch-protection=bti (aarch64) to hardening flags
61a6c3b0e9a8dab5c5f845af4becde817539133c build: add `-mbranch-protection=bti` to aarch64 hardening flags (fanquake)

Pull request description:

  This is a simpler (less hardening) version of https://github.com/bitcoin/bitcoin/pull/24123.

  You can inspect binaries using `readelf -n`, and look for BTI in a `.note.gnu.property`. i.e
  ```bash
  readelf -n src/bitcoin-cli

  Displaying notes found in: .note.gnu.property
    Owner                Data size Description
    GNU                  0x00000010NT_GNU_PROPERTY_TYPE_0
        Properties: AArch64 feature: BTI
  ```

  Related to https://github.com/bitcoin/bitcoin/issues/19075.

ACKs for top commit:
  TheCharlatan:
    utACK 61a6c3b0e9a8dab5c5f845af4becde817539133c

Tree-SHA512: 64504de44e91d853165daf4111dca905d8eb9ef3f4bfb0d447c677b02c9100dbd56f13e6fe6539fb06c2343a094229591ac5d1bd9e184b32b512c0ac3f9bac36
2024-10-24 11:17:28 -05:00
fanquake
af8d12445a
Merge bitcoin/bitcoin#28624: docs: fix typo
57131bfa3cfd9e5826b5c557aba8aa03bf41f833 docs: fix typo (vuittont60)

Pull request description:

ACKs for top commit:
  maflcko:
    lgtm ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833
  hebasto:
    ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833, the `codespell` is powerless to catch this typo.
  jarolrod:
    ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833

Tree-SHA512: 816dfc5ff64531ea92acf35feca2286a71c75344df2524ff003a3d375e60100b8531e1678be0ed11863d03ab522d5733d8a0bf4b6f5f79c495a65246fe0b697f
2024-10-24 11:17:28 -05:00
fanquake
c740264da8
Merge bitcoin/bitcoin#28532: qt: enable -ltcg for windows under LTO
f0cebbdb2a1a3c2f0facd88963484ad6fd5851db qt: enable -ltcg for windows HOST (fanquake)

Pull request description:

  Patch around multiple definition issues in Qt, and enable `-ltcg` when using `LTO=1`.

  Split from #25391.

ACKs for top commit:
  hebasto:
    ACK f0cebbdb2a1a3c2f0facd88963484ad6fd5851db

Tree-SHA512: 2d6e34779f360bf6dfea4f70fc9004a16e95da79716fcb3046afbf2b01317b7e16965cb51b967b7b5fb64549306c5f48cf59082884289c52016bc1e86949e062
2024-10-24 11:17:28 -05:00
fanquake
ccd3920d40
Merge bitcoin/bitcoin#28556: doc: fix link to developer-notes.md file in multiprocess.md
d9b172cd00fc3a8de1308e4469b82f5da474ea33 doc: fix link to developer-notes.md file in multiprocess.md (David Álvarez Rosa)

Pull request description:

  Fix link to `developer-notes.md` file in `multiprocess.md`.

ACKs for top commit:
  fanquake:
    ACK d9b172cd00fc3a8de1308e4469b82f5da474ea33

Tree-SHA512: 55fffefb37c4d67acb1fa8b0660216ec1c7f2c2314d11e4d319cae40480ed59ef448909fa2ca334167c86d60d41932220dce4186e28fa300f4d03eb0b3c769d0
2024-10-24 11:17:20 -05:00
fanquake
b70e091374
Merge bitcoin/bitcoin#29667: fuzz: actually test garbage >64b in p2p transport test
626f8e398e219b84907ccaad036f69177d39284c fuzz: actually test garbage >64b in p2p transport test (Pieter Wuille)

Pull request description:

  This fixes an oversight from #28196: in the `p2p_transport_bidirectional_v2` fuzz test, when the desired garbage length is over 64 bytes, the code would actually use garbage length 0. Fix this.

ACKs for top commit:
  instagibbs:
    ACK 626f8e398e
  brunoerg:
    crACK 626f8e398e219b84907ccaad036f69177d39284c

Tree-SHA512: f6346367adb10464b6c9d20aef43625531d2a4d8110887ad03214b8c1907b83560f2dd5b5415e2180a40b4cd276d51881b32b60c740471b5c6bb218aa19848d8
2024-10-24 11:16:21 -05:00
fanquake
6d7aa3d978
Merge bitcoin/bitcoin#29497: test: simplify test_runner.py
0831b54dfca1b9e728295fff500215da14589fc0 test: simplify test_runner.py (tdb3)

Pull request description:

  Implements the simplifications to test_runner.py proposed by sipa in PR #23995.

  Remove the num_running variable as it can be implied by the length of the jobs list.

  Remove the i variable as it can be implied by the length of the test_results list.

  Instead of counting results to determine if finished, make the queue object itself
  responsible (by looking at running jobs and jobs left).

ACKs for top commit:
  mzumsande:
    re-ACK 0831b54
  davidgumberg:
    reACK 0831b54dfc
  marcofleon:
    re-ACK 0831b54dfca1b9e728295fff500215da14589fc0

Tree-SHA512: e5473e68d49cd779b29d97635329283ae7195412cb1e92461675715ca7eedb6519a1a93ba28d40ca6f015d270f7bcd3e77cef279d9cd655155ab7805b49638f1
2024-10-24 11:16:21 -05:00
Ava Chow
d0e15d59f8
Merge bitcoin/bitcoin#29606: refactor: Reserve memory for ToLower/ToUpper conversions
6f2f4a4d096a3b261258c8cdd96cca532988d1d3 Reserve memory for ToLower/ToUpper conversions (Lőrinc)

Pull request description:

  Similarly to https://github.com/bitcoin/bitcoin/pull/29458, we're preallocating the result string based on the input string's length.
  The methods were already [covered by tests](https://github.com/bitcoin/bitcoin/blob/master/src/test/util_tests.cpp#L1250-L1276).

ACKs for top commit:
  tdb3:
    ACK for 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  maflcko:
    lgtm ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  achow101:
    ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  Empact:
    Code Review ACK 6f2f4a4d09
  stickies-v:
    ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3

Tree-SHA512: e3ba7af77decdc73272d804c94fef0b11028a85f3c0ea1ed6386672611b1c35fce151f02e64f5bb5acb5ba506aaa54577719b07925b9cc745143cf5c7e5eb262
2024-10-24 11:16:21 -05:00
Ava Chow
045fa5f57e
Merge bitcoin/bitcoin#29514: tests: Provide more helpful assert_equal errors
a3badf75f6fd88d465e59f46f0336a0c1eacb7de tests: Provide more helpful assert_equal errors (Anthony Towns)

Pull request description:

  In the functional tests, we often compare dicts with assert_equal, but the output makes it very hard to tell exactly which entry in the dicts don't match when there are a lot of entries and only minor differences. Change the output to make it clearer.

ACKs for top commit:
  achow101:
    ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  vasild:
    ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  brunoerg:
    utACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  josibake:
    ACK a3badf75f6
  BrandonOdiwuor:
    Code Review ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de

Tree-SHA512: 1d4b4a3b2e2e28ab09f10b41b04b52b37f64e0d8a54e2306f37de0c3eb3299a7ad4ba225b9efa67057a75e90d008a17385c810a32c9b212d240be280c2dcf2e5
2024-10-24 11:16:21 -05:00
Ava Chow
bd607f049d
Merge bitcoin/bitcoin#29393: i2p: log connection was refused due to arbitrary port
5b358cdd1a5f5d2fe87a9e41c638996eab2e2796 i2p: log connection was refused due to arbitrary port (brunoerg)

Pull request description:

  For I2P, we do not try to connect if port is != 0. However, we do not have anything that indicates it or any error when trying to connect with port != 0. This PR adds a log for it. Also, it improves the functional test. With this log we can ensure the reason we won't connect is the port, in the current test, we cannot ensure it.

ACKs for top commit:
  jonatack:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  epiccurious:
    re-ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796.
  achow101:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  kristapsk:
    re-ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  vasild:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796

Tree-SHA512: 027245afa771c9295fff0bfd17c251dca4a9f4c739e5773922de3c030a65ef05d96291edcbdeeaa50ba3add61f75f28d8c00be503e03fc33d3491d1956fc549f
2024-10-24 11:16:21 -05:00
fanquake
c9617558e3
Merge bitcoin/bitcoin#29595: doc: Wrap flags with code in developer-notes.md
4f1753deaa2481839a0cc4c690d703b3dfebcb5f doc: Wrap flags with code in developer-notes.md (spicyzboss)

Pull request description:

  Before wrap code block
  <img width="1077" alt="image" src="https://github.com/bitcoin/bitcoin/assets/73651621/93f39960-311d-411d-acaf-dce69ad36ca0">

  After wrap code block
  <img width="1073" alt="image" src="https://github.com/bitcoin/bitcoin/assets/73651621/fe6a5cd2-e981-45b1-a150-5a55fab81ae6">

ACKs for top commit:
  fanquake:
    ACK 4f1753deaa2481839a0cc4c690d703b3dfebcb5f

Tree-SHA512: 15a123f3a13c62d9cfdf62d5df351b8c2b3f9f666fba5a2722325600d802a29da61773ad32fb9f8483a915f59dd42731ba724b81b7874d39cb9627f0266b5713
2024-10-24 11:16:21 -05:00
fanquake
8d6e5e7d67
Merge bitcoin/bitcoin#29583: fuzz: Apply fuzz env (suppressions, etc.) when fetching harness list
738a53720e7df70a23709f7a26e4467bbe36db9c [fuzz] Apply fuzz env (suppressions, etc.) when fetching harness list (dergoegge)

Pull request description:

  The fuzz test runner does not add the UBSan suppressions when fetching the harness list. We can observe this in CI as lots of UBSan errors prior to the harnesses actually executing: https://api.cirrus-ci.com/v1/task/5678606140047360/logs/ci.log

  ```
  + test/fuzz/test_runner.py -j10 -l DEBUG /ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/ --empty_min_time=60
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:38: runtime error: unsigned integer overflow: 12 - 23 cannot be represented in type 'size_type' (aka 'unsigned long')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:38 in
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:33: runtime error: implicit conversion from type 'size_type' (aka 'unsigned long') of value 18446744073709551605 (64-bit, unsigned) to type 'const difference_type' (aka 'const long') changed the value to -11 (64-bit, signed)
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:33 in
  crypto/sha256.cpp:75:57: runtime error: left shift of 1359893119 by 26 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:57 in
  crypto/sha256.cpp:75:79: runtime error: left shift of 1359893119 by 21 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:79 in
  crypto/sha256.cpp:75:101: runtime error: left shift of 1359893119 by 7 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:101 in
  crypto/sha256.cpp:82:47: runtime error: unsigned integer overflow: 2968370640 + 2483695512 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:47 in
  crypto/sha256.cpp:74:57: runtime error: left shift of 1779033703 by 30 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:57 in
  crypto/sha256.cpp:74:79: runtime error: left shift of 1779033703 by 19 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:79 in
  crypto/sha256.cpp:74:101: runtime error: left shift of 1779033703 by 10 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:101 in
  crypto/sha256.cpp:83:29: runtime error: unsigned integer overflow: 3458249854 + 980412007 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:83:29 in
  crypto/sha256.cpp:82:21: runtime error: unsigned integer overflow: 528734635 + 4228187651 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:21 in
  crypto/sha256.cpp:84:7: runtime error: unsigned integer overflow: 1013904242 + 3720769133 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:84:7 in
  crypto/sha256.cpp:85:12: runtime error: unsigned integer overflow: 3720769133 + 2654153126 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:85:12 in
  crypto/sha256.cpp:82:33: runtime error: unsigned integer overflow: 4165002546 + 1259303586 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:33 in
  crypto/sha256.cpp:125:50: runtime error: unsigned integer overflow: 3835390401 + 1367343104 cannot be represented in type 'unsigned int'
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:125:50 in
  crypto/sha256.cpp:77:58: runtime error: left shift of 1367343104 by 15 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  ...
  ```

  To fix this we simply apply the usual fuzz env variables (that apply the suppressions) when fetching the harness list as well.

ACKs for top commit:
  ismaelsadeeq:
    Tested ACK 738a53720e7df70a23709f7a26e4467bbe36db9c
  fanquake:
    ACK 738a53720e7df70a23709f7a26e4467bbe36db9c

Tree-SHA512: befebaeb4ee5f2eddca67fc6dc69e997c6a250ea54844e5e6e93d1f6a13be49364a3ace31eaa942b02dcf73612af29ec4ace86c9eb7567b92f6f5dc3ea14dc11
2024-10-24 11:16:20 -05:00
fanquake
4dce690a5e
Merge bitcoin/bitcoin#29576: Update functional test runner to return error code when no tests are found to run
33268a855883142a039a7a7b14eb1345e52809fd test: exit with code 1 when no fn tests are found (Max Edwards)

Pull request description:

  As discussed in the following PR comment: https://github.com/bitcoin/bitcoin/pull/29535#issuecomment-1979259786

  Prevents the test_runner from exiting silently with code 0 when no tests were found which has recently happened after a GHA runner update such as in this run: https://github.com/bitcoin/bitcoin/actions/runs/8131828989/job/22239779585#step:27:63

ACKs for top commit:
  TheCharlatan:
    ACK 33268a855883142a039a7a7b14eb1345e52809fd
  theStack:
    lgtm ACK 33268a855883142a039a7a7b14eb1345e52809fd

Tree-SHA512: d389e9f5e4da7ce1627fb2fad9b33baf0b04e75dbdbfc0dbf5f1e3e2b0ae1e79721476c5668476055b0f7de29723ed02c8d7e420081a555030cb784886e240fc
2024-10-24 11:16:20 -05:00
fanquake
910a7d6cbf
Merge bitcoin/bitcoin#29529: fuzz: restrict fopencookie usage to Linux & FreeBSD
312f3381a2d3a7afb7c81b4662214d4d67b4e84a fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)

Pull request description:

  Should fix the GCC compilation portion of https://github.com/bitcoin/bitcoin/issues/29517#issuecomment-1973573314.

  See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

ACKs for top commit:
  m3dwards:
    ACK 312f3381a2
  TheCharlatan:
    utACK 312f3381a2d3a7afb7c81b4662214d4d67b4e84a

Tree-SHA512: aa8ff20c3fa735415d05a93b8855877035c300f4d2dfd82f65fd9ed5b5c96ab619b4d84eef114ed0013dc5ff0800cb628ed3801e1efde0cfb0d426930d1673d5
2024-10-24 11:16:20 -05:00
fanquake
fdac2b3286
Merge bitcoin/bitcoin#29493: subtree: update crc32c subtree
5d45552fd4303f8d668ffbc50cce1053485aeead Squashed 'src/crc32c/' changes from 0bac72c455..b60d2b7334 (fanquake)

Pull request description:

  Update the crc32c subtree. Includes:
  * https://github.com/bitcoin-core/crc32c-subtree/pull/6

  Which fixes #29178.

ACKs for top commit:
  hebasto:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d.
  theuni:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d
  dergoegge:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d

Tree-SHA512: 2cec81a34ad26bbbc298aea5daffa41e56114d31cc2eb5fe486f46a77c3467bba22bdeca1c52ae97220e119d98818304272fc6337442af55282accabcd4c5833
2024-10-24 11:16:20 -05:00
fanquake
a23b342d7d
Merge bitcoin/bitcoin#29475: doc: Fix Broken Links
6fa61e35320ac2bc623a9c9ca11b270b34e2d05a doc: Fix Broken Links (Justin Dhillon)

Pull request description:

  ### Summery

  Here is what I have fixed:

  http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/
   --> https://web.archive.org/web/20190424172231/http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/

  ### Support my work

  These links were found with [link-inspector](https://github.com/justindhillon/link-inspector). If you find this PR useful, give the repo a 

ACKs for top commit:
  fjahr:
    ACK 6fa61e35320ac2bc623a9c9ca11b270b34e2d05a

Tree-SHA512: ba83badfc8a89f33813801f749bcd7ad41d4c9c817ece76f3bb1b60f24c28e99cfccc485a0ba059ec2c1134e8ffb5fa37fdc9835e553229ee5b1167c9b2e8d1f
2024-10-24 11:16:20 -05:00
fanquake
92bad90e6c
Merge bitcoin/bitcoin#28178: fuzz: Generate with random libFuzzer settings
fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde fuzz: Set -rss_limit_mb=8000 for generate as well (MarcoFalke)
fa4e396e1da8e5b04a5f906b95017b969ea37bae fuzz: Generate with random libFuzzer settings (MarcoFalke)

Pull request description:

  Sometimes a libFuzzer setting like `-use_value_profile=1` helps [0], sometimes it hurts [1].

  [0] https://github.com/bitcoin/bitcoin/pull/20789#issuecomment-752961937
  [1] https://github.com/bitcoin/bitcoin/pull/27888#issuecomment-1645976254

  By picking a random value, it is ensured that at least some of the runs will have the beneficial configuration set.

  Also, set `-max_total_time` to prevent slow fuzz targets from getting a larger time share, or possibly peg to a single core for a long time and block the python script from exiting for a long time. This can be improved in the future. For example, the python script can exit after some time (https://github.com/bitcoin/bitcoin/pull/20752#discussion_r549248791). Alternatively, it can measure if coverage progress was made and run for less time if no progress has been made recently anyway, so that more time can be spent on targets that are new or still make progress.

ACKs for top commit:
  murchandamus:
    utACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde
  dergoegge:
    utACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde
  brunoerg:
    light ACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde

Tree-SHA512: bfd04a76ca09aec612397bae5f3f263a608faa7087697169bd4c506c8195c4d2dd84ddc7fcd3ebbc75771eab618fad840af819114968ca3668fc730092376768
2024-10-24 11:16:20 -05:00
fanquake
9b6a05df66
Merge bitcoin/bitcoin#29443: depends: fix BDB compilation on OpenBSD
0fbf051fec723f86f49ab14ea15c91bb1435c656 depends: fix BDB compilation on OpenBSD (Sebastian Falbesoner)

Pull request description:

  Compiling C++ code with `-D_XOPEN_SOURCE=600` causes problems on OpenBSD. If that define is set, the C++ standard header detection routine in BDB's configure script fails due to a missing type name for `locale_t` (see https://gist.github.com/theStack/b41884e31ebc5cdca3220bcaa674cb70 for the relevant config.log part).

  This results in `HAVE_CXX_STDHEADERS` not being defined, which then it turn leads to the inclusion of `<iostream.h>` (rather than `<iostream>`), which doesn't exist, as described in #28963.

  According to a mailing list post discussing a similar problem [1], "OpenBSD provides the POSIX APIs by default", so we don't need this define anyway and can remove it. This fixes the BDB build problem as described in issue #28963. See also f87e75ae71 for a similar fix for google's flatbuffer project.

  Tested on OpenBSD 7.4 with clang 13.0.0. Fixes #28963.

  [1] https://www.mail-archive.com/tech@openbsd.org/msg63386.html

ACKs for top commit:
  fanquake:
    ACK 0fbf051fec723f86f49ab14ea15c91bb1435c656

Tree-SHA512: 02139e9081ed855e067bfba8c81b54c657417576e553cc1035a916ada9be049358f5e14d756d5f234c5226bd7e943f61c6ae8990c1b152f9125681b7b777c9b3
2024-10-24 11:16:20 -05:00
fanquake
9963e6bc28
Merge bitcoin/bitcoin#29413: fuzz: increase length of string used for NetWhitelist{bind}Permissions::TryParse
864e2e9097de8f1fda63137f803687dd5cc96c03 fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (brunoerg)

Pull request description:

  The string `s` represents the value from `-whitelist`/`-whitebind` (e.g. "bloom,forcerelay,noban@1.2.3.4:32") and it is used in `NetWhitelistPermissions::TryParse` and `NetWhitebindPermissions::TryParse`. However, a max length of 32 is not enough to cover a lot of cases. Even disconsidering the permissions, 32 would not be enough to cover a lot of addresses. This PR fixes it.

ACKs for top commit:
  maflcko:
    lgtm ACK 864e2e9097de8f1fda63137f803687dd5cc96c03
  epiccurious:
    utACK 864e2e9097de8f1fda63137f803687dd5cc96c03.
  vasild:
    ACK 864e2e9097de8f1fda63137f803687dd5cc96c03

Tree-SHA512: 2b89031b9f2ea92d636f05fd167b1e5ac726742a7e7c1af8ddaeaf90236e659731aaa6b7c23f65ec16ce52ac1b9e68e7b16e23c59e355312d057e001976d172a
2024-10-24 11:16:20 -05:00
fanquake
3914745a10
Merge bitcoin/bitcoin#29425: test: fix intermittent failure in wallet_reorgrestore.py
44d11532f80705b790bc6e28df9a96ac54b25f9b test: fix intermittent failure in wallet_reorgrestore.py (Martin Zumsande)

Pull request description:

  By adding a missing `sync_blocks` call.
  There was a race at `node2` between connecting the block produced by `node0`, and using `-generate` to create new blocks itself. In the failed run, block generation started before connecting the block, resulting in a final block height that was smaller by 1 than expected.
  See https://github.com/bitcoin/bitcoin/issues/29392#issuecomment-1939541603 for a more detailed analysis of the failed run.

  Can be reproduced by adding a sleep to [this spot](6ff0aa089c/src/validation.cpp (L4217))  in `ChainstateManager::ProcessNewBlock()`:
  ```
  if (util::ThreadGetInternalName() == "msghand") {
      std::this_thread::sleep_for(0.2s);
  }
  ```
  which fails for me on master and succeeds with the fix.

  Fixes #29392

ACKs for top commit:
  maflcko:
    lgtm ACK 44d11532f80705b790bc6e28df9a96ac54b25f9b

Tree-SHA512: c08699e5ae348d4c0626022b519449d052f511d3f44601bcd8dac836a130a3f67fca149532e1e3690367ebfdcbcdd32e527170d039209c1f599ce861136ae29f
2024-10-24 11:16:19 -05:00
fanquake
b719883081
Merge bitcoin/bitcoin#29399: test: Fix utxo set hash serialisation signedness
fa0ceae970242d8d6bdef150c98f04c67b06e20c test: Fix utxo set hash serialisation signedness (MarcoFalke)

Pull request description:

  It is unsigned in Bitcoin Core, so the tests should match it:

  5b8990a1f3/src/kernel/coinstats.cpp (L54)

  Large positive values for the block height are too difficult to hit in tests, but it still seems fine to fix this.

  The bug was introduced when the code was written in 6ccc8fc067bf516cda7bc5d7d721945be5ac2003.

  (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters)

ACKs for top commit:
  epiccurious:
    Tested ACK fa0ceae970242d8d6bdef150c98f04c67b06e20c.
  fjahr:
    utACK fa0ceae970242d8d6bdef150c98f04c67b06e20c

Tree-SHA512: ab4405c74fb191fff8520b456d3a800cd084d616bb9ddca27d56b8e5c8969bd537490f6e204c1870dbb09a3e130b03b22a27b6644252a024059c200bbd9004e7
2024-10-24 11:16:19 -05:00
Ava Chow
f0968807bc
Merge bitcoin/bitcoin#29377: test: Add makefile target for running unit tests
5ca9b24da18e842e7a093dc44f6b222af73e92cf test: Add makefile target for running unit tests (TheCharlatan)

Pull request description:

  `make check` runs a bunch of other subtree tests that exercise code that is hardly ever changed and have a comparatively long runtime. There seems to be no target for running just the unit tests, so add one.

  Alternatively the secp256k1 tests could be removed from the `check-local` target, reducing its runtime. This was rejected before though in https://github.com/bitcoin/bitcoin/pull/20264.

ACKs for top commit:
  delta1:
    utACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  edilmedeiros:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  achow101:
    ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  ryanofsky:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf.

Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
2024-10-24 11:16:19 -05:00
Ava Chow
03e0bd3347
Merge bitcoin/bitcoin#27319: addrman, refactor: improve stochastic test in AddSingle
e064487ca28c12ba774c2f43a3c7acbdb1a278c9 addrman, refactor: improve stochastic test in `AddSingle` (brunoerg)

Pull request description:

  This PR changes this algorithm to be O(1) instead of O(n). Also, in the current implementation, if `pinfo->nRefCount` is 0, we created an unnecessary variable (`nFactor`), this changes it. the change is relatively simple and does not cause conflicts.

ACKs for top commit:
  achow101:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9
  amitiuttarwar:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9
  stratospher:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9. simple use of << instead of a loop, didn't observe any behaviour difference before and after.

Tree-SHA512: ff0a65155e47f65d2ce3cb5a3fd7a86efef1861181143df13a9d8e59cb16aee9be2f8801457bba8478b17fac47b015bff5cc656f6fac2ccc071ee7178a38d291
2024-10-24 11:16:19 -05:00