Relatively simple check to ensure a block can always be created from the mempool
fuzz: Create a block template in tx_pool targets #21798
pull MarcoFalke wants to merge 4 commits into bitcoin:master from MarcoFalke:2104-fuzzMempool changing 4 files +80 −31-
MarcoFalke commented at 6:55 PM on April 28, 2021: member
-
fuzz: Allow to pass min/max to ConsumeTime fae2c8bc54
-
fab646b8ea
fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding a maximum size
This is technically a breaking change. This allows the fuzz engine to pick the right size, also larger sizes, if needed.
-
fa61ce5cf5
fuzz: Limit mocktime to MTP in tx_pool targets
This is needed for the next commit to generate blocks. Also, apply the same mocking strategies to both targets.
- DrahtBot added the label Tests on Apr 28, 2021
-
practicalswift commented at 6:11 AM on April 29, 2021: contributor
Concept ACK
Touches only
src/test/fuzz/ -
MarcoFalke commented at 12:03 PM on April 29, 2021: member
Looks like ci fails due to:
policy/feerate.cpp:26:34: runtime error: signed integer overflow: 1887171891083620 * 5555 cannot be represented in type 'long' [#0](/bitcoin-bitcoin/0/) 0x560eb0295c97 in CFeeRate::GetFee(unsigned long) const policy/feerate.cpp:26:34 [#1](/bitcoin-bitcoin/1/) 0x560eafb6409b in BlockAssembler::addPackageTxs(int&, int&) miner.cpp:378:43 [#2](/bitcoin-bitcoin/2/) 0x560eafb60c86 in BlockAssembler::CreateNewBlock(CScript const&) miner.cpp:150:5 [#3](/bitcoin-bitcoin/3/) 0x560eafa21cae in (anonymous namespace)::Finish(FuzzedDataProvider&, (anonymous namespace)::MockedTxPool&, CChainState&) test/fuzz/tx_pool.cpp:89:41 [#4](/bitcoin-bitcoin/4/) 0x560eafa1e237 in (anonymous namespace)::tx_pool_standard_fuzz_target(Span<unsigned char const>) test/fuzz/tx_pool.cpp:272:5 ... SUMMARY: UndefinedBehaviorSanitizer: signed-integer-overflow policy/feerate.cpp:26:34 in -
MarcoFalke commented at 5:50 AM on April 30, 2021: member
(ci now green)
-
adamjonas commented at 5:53 PM on May 5, 2021: member
Tested fa03232 with DEBUG=1 and observed some nice coverage increases.
My setup is still showing the CI's UB error both in faf3e9d and fa03232, but that just might be due to my own lack of understanding or a compile issue on my part.
-
fuzz: Create a block template in tx_pool targets fa03d0acd6
- MarcoFalke force-pushed on May 5, 2021
-
MarcoFalke commented at 6:12 PM on May 5, 2021: member
squashed the commits. bisecting should now work again.
-
practicalswift commented at 9:39 PM on May 5, 2021: contributor
Tested ACK fa03d0acd6bd8bb6d3d5227512f042ff537ad993
As expected the coverage achieved by the
tx_poolfuzzing harness is dramatically improved with this patch applied.Nice work!
- MarcoFalke merged this on May 6, 2021
- MarcoFalke closed this on May 6, 2021
- MarcoFalke deleted the branch on May 6, 2021
- sidhujag referenced this in commit 3101af3087 on May 6, 2021
- gwillen referenced this in commit b2376cfef6 on Jun 1, 2022
- DrahtBot locked this on Aug 16, 2022
Contributors
Labels