diff options
author | fanquake <fanquake@gmail.com> | 2023-02-22 09:30:56 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-02-22 09:37:07 +0000 |
commit | 8b4dc94734a2472a201296376bfb18f982e6d92f (patch) | |
tree | fb6da9edadb6c4d3f96f1ab027021f3ccce5a435 /src/test/fuzz | |
parent | 0c579203d265e4c74a0b1fc33147bf85ef16d56a (diff) | |
parent | c1b7bd047f47dcd3eb6897adfaf9a55594deff5d (diff) |
Merge bitcoin/bitcoin#27117: fuzz: avoid redundant dup key checks when creating Miniscript nodes
c1b7bd047f47dcd3eb6897adfaf9a55594deff5d fuzz: avoid redundant dup key checks when creating Miniscript nodes (Antoine Poinsot)
Pull request description:
I thought i had done that already in #24149, but it must have slipped through the rebase. It's a 2x speed improvement against the existing corpora and will probably be much more as we extend them with larger nodes.
ACKs for top commit:
sipa:
ACK c1b7bd047f47dcd3eb6897adfaf9a55594deff5d
Tree-SHA512: 9e6ceb6254183964b6c5538e21ba6321df95a68acb343a15a6ecfef5c51a1980d2627df5aeef9aef1db41656e18cc4f3bc96e6f24314d12fa60368b04a350001
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/miniscript.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/fuzz/miniscript.cpp b/src/test/fuzz/miniscript.cpp index 1b791fc19c..73096cd5ca 100644 --- a/src/test/fuzz/miniscript.cpp +++ b/src/test/fuzz/miniscript.cpp @@ -253,7 +253,9 @@ using Type = miniscript::Type; using miniscript::operator"" _mst; //! Construct a miniscript node as a shared_ptr. -template<typename... Args> NodeRef MakeNodeRef(Args&&... args) { return miniscript::MakeNodeRef<CPubKey>(KEY_COMP, std::forward<Args>(args)...); } +template<typename... Args> NodeRef MakeNodeRef(Args&&... args) { + return miniscript::MakeNodeRef<CPubKey>(miniscript::internal::NoDupCheck{}, std::forward<Args>(args)...); +} /** Information about a yet to be constructed Miniscript node. */ struct NodeInfo { @@ -762,6 +764,7 @@ NodeRef GenNode(F ConsumeNode, Type root_type = ""_mst, bool strict_valid = fals } } assert(stack.size() == 1); + stack[0]->DuplicateKeyCheck(KEY_COMP); return std::move(stack[0]); } |