Skip to content

Commit 6998949

Browse files
committed
IBD Booster: check that booster muhash is empty at final block
1 parent 801e0f4 commit 6998949

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/validation.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,18 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
27582758
UpdateCoinsIBDBooster(tx, view, pindex->nHeight);
27592759
}
27602760
}
2761+
2762+
if (pindex->nHeight == g_ibd_booster_hints.GetFinalBlockHeight()) {
2763+
if (g_ibd_booster_muhash.IsEmptySet()) {
2764+
LogInfo("*** IBD Booster: MuHash check at block height %d succeeded. ***\n", pindex->nHeight);
2765+
} else {
2766+
// TODO: find a proper way to signal this error; strictly speaking it's not a
2767+
// block validation error, most likely the given hints data file was invalid
2768+
state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "ibd-booster-muhash-not-empty-at-final-block",
2769+
"fails the IBD-Booster-MuHash check (should be an empty set!)");
2770+
}
2771+
}
2772+
27612773
const auto time_3{SteadyClock::now()};
27622774
m_chainman.time_connect += time_3 - time_2;
27632775
LogDebug(BCLog::BENCH, " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs (%.2fms/blk)]\n", (unsigned)block.vtx.size(),

0 commit comments

Comments
 (0)