diff options
author | glozow <gloriajzhao@gmail.com> | 2024-05-13 16:00:03 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2024-05-13 16:00:49 +0100 |
commit | ff8c606cf1eaefd0eab9f144561120ae6c5a498f (patch) | |
tree | 378e762156f0666ee890f91d0bae08024dc3b8b2 /src/wallet/test/db_tests.cpp | |
parent | c7deb761187e052ec25f94d855befdd1ff2e73fd (diff) | |
parent | 58594c7040241f2312b0b8735a8baf0412674613 (diff) |
Merge bitcoin/bitcoin#29974: fuzz: txorphan tests fixups
58594c7040241f2312b0b8735a8baf0412674613 fuzz: txorphan tests fixups (Sergi Delgado Segura)
Pull request description:
Motivated by https://github.com/bitcoin/bitcoin/pull/28970#discussion_r1576401327
Adds the following fixups in txorphan fuzz tests:
- Don't bond the output count of the created orphans to the number of available coins
- Allow duplicate inputs but don't store duplicate outpoints
Most significantly, this gets rid of the `duplicate_input` flag altogether, making the test easier to reason about. Notice how, under normal conditions, duplicate inputs would be caught by `MemPoolAccept::PreChecks`, however, no validations checks are run on the test before adding data to the orphanage (neither were they before this patch)
## Rationale
The way the test is currently written, duplicate inputs are allowed based on a random flag (`duplicate_input`). If the flag is unset, upon selecting an outpoint as input for a new transaction, the input is popped to prevent re-selection and later re-added to the collection (once all inputs have been picked). However, the re-addition to the collection is performed independently of whether the flag was set or not. This means that, if the flag is set, the selected inputs are duplicated which in turn makes these inputs more likely to be re-picked in the following iteration of the loop.
Additionally, both the input and output count of the transaction are bonded to the number of available outpoints. This makes sense for the former, but the latter shouldn't be.
ACKs for top commit:
maflcko:
utACK 58594c7040241f2312b0b8735a8baf0412674613
glozow:
ACK 58594c7
instagibbs:
ACK 58594c7040241f2312b0b8735a8baf0412674613
Tree-SHA512: e97cc2a43e388f87b64d2e4e45f929dd5b0dd85d668dd693b75e4c9ceea734cd7645952385d428208d07b70e1aafbec84cc2ec264a2e07d36fc8ba3e97885a8d
Diffstat (limited to 'src/wallet/test/db_tests.cpp')
0 files changed, 0 insertions, 0 deletions