diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-05-21 09:03:22 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-21 09:03:25 +0200 |
commit | eb4df9a628bdcdd1333c7fa4fb23c73df9642902 (patch) | |
tree | 6cc52f481cb6f0e6455428fcd96f231e8b6e5037 /src/test | |
parent | ac5f7f47c16fd62afafdc227acf437170a5efd3a (diff) | |
parent | bbbb51877a96c3473aeea5914f751eec7835b5c4 (diff) | |
download | bitcoin-eb4df9a628bdcdd1333c7fa4fb23c73df9642902.tar.xz |
Merge bitcoin/bitcoin#22004: fuzz: Speed up transaction fuzz target
bbbb51877a96c3473aeea5914f751eec7835b5c4 fuzz: Speed up transaction fuzz target (MarcoFalke)
Pull request description:
`hashBlock` and `include_addresses` are orthogonal, so no need to do an exhaustive "search".
Might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34491
ACKs for top commit:
practicalswift:
cr ACK bbbb51877a96c3473aeea5914f751eec7835b5c4: patch looks correct, and `TxToUniv` surprisingly wide in the `transaction_fuzz_target` flame graph! Putting it on a diet makes sense.
Tree-SHA512: 1e7c30c7fecf96364a9a1597c0a22139389fdeb67db59f3c2c6fc088196e3332877b2865991a957980d542f99a2f48cc066dd7cc16c695a5113190fe06205089
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/transaction.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/test/fuzz/transaction.cpp b/src/test/fuzz/transaction.cpp index 797b9cea3e..ff34cc87b2 100644 --- a/src/test/fuzz/transaction.cpp +++ b/src/test/fuzz/transaction.cpp @@ -103,9 +103,6 @@ FUZZ_TARGET_INIT(transaction, initialize_transaction) (void)IsWitnessStandard(tx, coins_view_cache); UniValue u(UniValue::VOBJ); - TxToUniv(tx, /* hashBlock */ {}, /* include_addresses */ true, u); - TxToUniv(tx, /* hashBlock */ {}, /* include_addresses */ false, u); - static const uint256 u256_max(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); - TxToUniv(tx, u256_max, /* include_addresses */ true, u); - TxToUniv(tx, u256_max, /* include_addresses */ false, u); + TxToUniv(tx, /* hashBlock */ uint256::ZERO, /* include_addresses */ true, u); + TxToUniv(tx, /* hashBlock */ uint256::ONE, /* include_addresses */ false, u); } |