mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-07 14:18:18 +02:00
20ae9b98eaExtend functional test for setBlockIndexCandidates UB (marcofleon)854a6d5a9avalidation: fix UB in LoadChainTip (marcofleon)9249e6089evalidation: remove LoadChainTip call from ActivateSnapshot (marcofleon) Pull request description: Addresses https://github.com/bitcoin/bitcoin/issues/34503. See this issue for more details as well. Fixes a bug where, under certain conditions, `setBlockIndexCandidates` had blocks in it that were worse than the tip. The block index candidate set uses `nSequenceId` as a sort key, so modifying this field while blocks are in the set results in undefined behavior. This PR populates `setBlockIndexCandidates` after the `nSequenceId` modifications, avoiding the UB. ACKs for top commit: achow101: ACK20ae9b98easedited: Re-ACK20ae9b98easipa: Code review ACK20ae9b98eaTree-SHA512: 121c170bb70fb6365089d578db63c811e7926e129d7206e569947f7a1f6c5ddc8d5f4937b80f1ba1b7d7daa42789b143ca5b56f154b7ab968a1cd55f925f378d
Test library
This contains files for the test library, which is used by the test binaries (unit tests, benchmarks, fuzzers, gui tests).
Generally, the files in this folder should be well-separated modules. New code should be added to existing modules or (when in doubt) a new module should be created.
The utilities in here are compiled into a library, which does not hold any state. However, the main file setup_common
defines the common test setup for all test binaries. The test binaries will handle the global state when they
instantiate the BasicTestingSetup (or one of its derived classes).