What changed, and why it matters
This is a tiny internal test-only code cleanup in Bitcoin Core's fuzzing harness. It replaces a direct call that sets a fake global clock with a helper object that automatically resets the fake clock when it goes out of scope. The commit message explicitly says it does not change behavior. There is no indication this affects real Bitcoin node software, wallets, or the live network.
No action required. This is a benign test refactor. If reviewing, confirm NodeClockContext resets mock time as documented and that no other fuzz targets still leak mock time.
Security signals we found
No security signal present: change is a test-only fuzz harness refactor
Commit message states behavior is unchanged
Change is scoped to a single fuzz target initialization step
No functional code, consensus code, networking, or wallet logic modified
Evidence from the diff
In src/wallet/test/fuzz/scriptpubkeyman.cpp, SetMockTime(ConsumeTime(…)) is replaced by NodeClockContext clock_ctx{ConsumeTime(…)}. NodeClockContext is a scoped RAII wrapper around mock time: it sets mock time on construction and clears it on destruction. The change ensures no mock time leaks between fuzz target initialization and the first input, or between successive fuzz inputs. This is a defensive refactor inside fuzz test code only.
Changed components
src/wallet/test/fuzz/scriptpubkeyman.cppwallet fuzz test harness onlyInspect captured patch +1 / −1
diff --git a/src/wallet/test/fuzz/scriptpubkeyman.cpp b/src/wallet/test/fuzz/scriptpubkeyman.cpp
index a627c770..fa8bc250 100644
--- a/src/wallet/test/fuzz/scriptpubkeyman.cpp
+++ b/src/wallet/test/fuzz/scriptpubkeyman.cpp
@@ -205,7 +205,7 @@ FUZZ_TARGET(spkm_migration, .init = initialize_spkm_migration)
{
SeedRandomStateForTest(SeedRand::ZEROS);
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
- SetMockTime(ConsumeTime(fuzzed_data_provider));
+ NodeClockContext clock_ctx{ConsumeTime(fuzzed_data_provider)};
const auto& node{g_setup->m_node};
Chainstate& chainstate{node.chainman->ActiveChainstate()};
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.