mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
Merge bitcoin/bitcoin#27011: Add simulation-based CCoinsViewCache fuzzer
561848aaf2Exercise non-DIRTY spent coins in caches in fuzz test (Pieter Wuille)59e6828bb5Add deterministic mode to CCoinsViewCache (Pieter Wuille)b0ff310840Add CCoinsViewCache::SanityCheck() and use it in fuzz test (Pieter Wuille)3c9cea1340Add simulation-based CCoinsViewCache fuzzer (Pieter Wuille) Pull request description: The fuzzer goes through a sequence of operations that get applied to both a real stack of `CCoinsViewCache` objects, and to simulation data, comparing the two at the end. ACKs for top commit: jamesob: re-ACK561848aaf2dergoegge: Code review ACK561848aaf2Tree-SHA512: 68634f251fdb39436b128ecba093f651bff12ac11508dc9885253e57fd21efd44edf3b22b0f821c228175ec507df7d46c7f9f5404fc1eb8187fdbd136a5d5ee2
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
|
||||
SaltedTxidHasher::SaltedTxidHasher() : k0(GetRand<uint64_t>()), k1(GetRand<uint64_t>()) {}
|
||||
|
||||
SaltedOutpointHasher::SaltedOutpointHasher() : k0(GetRand<uint64_t>()), k1(GetRand<uint64_t>()) {}
|
||||
SaltedOutpointHasher::SaltedOutpointHasher(bool deterministic) :
|
||||
k0(deterministic ? 0x8e819f2607a18de6 : GetRand<uint64_t>()),
|
||||
k1(deterministic ? 0xf4020d2e3983b0eb : GetRand<uint64_t>())
|
||||
{}
|
||||
|
||||
SaltedSipHasher::SaltedSipHasher() : m_k0(GetRand<uint64_t>()), m_k1(GetRand<uint64_t>()) {}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
const uint64_t k0, k1;
|
||||
|
||||
public:
|
||||
SaltedOutpointHasher();
|
||||
SaltedOutpointHasher(bool deterministic = false);
|
||||
|
||||
/**
|
||||
* Having the hash noexcept allows libstdc++'s unordered_map to recalculate
|
||||
|
||||
Reference in New Issue
Block a user