mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge bitcoin/bitcoin#24179: fuzz: Speed up script fuzz target
fa6842978d
fuzz: Speed up script fuzz target (MarcoFalke) Pull request description: Currently the script fuzz target takes the longest time (5000 seconds, aka 80 minutes, see https://cirrus-ci.com/task/5651378755338240?logs=ci#L4501). Fix this by making it twice as fast. Instead of running all possible combinations for all fuzz inputs, consume a bool and decide at runtime which path to take. I moved the new calls to the end to not invalidate existing fuzz inputs. ACKs for top commit: prusnak: ACKfa6842978d
Tree-SHA512: 5e408255f96f9e92e472f4e8a8a0f8d8814bad444ac0ff7d5db5ed84a59a861135ffe5e04d81f479b0695cb17e4d7af005734959dd4aa9328bdc5acc98f36665
This commit is contained in:
commit
9237bdaac1
1 changed files with 8 additions and 11 deletions
|
@ -102,17 +102,6 @@ FUZZ_TARGET_INIT(script, initialize_script)
|
|||
(void)script.IsPushOnly();
|
||||
(void)script.GetSigOpCount(/* fAccurate= */ false);
|
||||
|
||||
(void)FormatScript(script);
|
||||
(void)ScriptToAsmStr(script, false);
|
||||
(void)ScriptToAsmStr(script, true);
|
||||
|
||||
UniValue o1(UniValue::VOBJ);
|
||||
ScriptPubKeyToUniv(script, o1, true);
|
||||
UniValue o2(UniValue::VOBJ);
|
||||
ScriptPubKeyToUniv(script, o2, false);
|
||||
UniValue o3(UniValue::VOBJ);
|
||||
ScriptToUniv(script, o3);
|
||||
|
||||
{
|
||||
const std::vector<uint8_t> bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
CompressedScript compressed_script;
|
||||
|
@ -178,4 +167,12 @@ FUZZ_TARGET_INIT(script, initialize_script)
|
|||
Assert(dest == GetScriptForDestination(tx_destination_2));
|
||||
}
|
||||
}
|
||||
|
||||
(void)FormatScript(script);
|
||||
(void)ScriptToAsmStr(script, /*fAttemptSighashDecode=*/fuzzed_data_provider.ConsumeBool());
|
||||
|
||||
UniValue o1(UniValue::VOBJ);
|
||||
ScriptPubKeyToUniv(script, o1, /*include_hex=*/fuzzed_data_provider.ConsumeBool());
|
||||
UniValue o3(UniValue::VOBJ);
|
||||
ScriptToUniv(script, o3);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue