From 8bc9594ea3377102009ed11726171544ef9623d6 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sat, 14 Nov 2026 14:50:52 +0700 Subject: [PATCH] test: do not tie the MNHF signal snapshot test to the number of deployments mnhf_signals_outnumbering_deployments_are_valid built four signals and required that to exceed MAX_VERSION_BITS_DEPLOYMENTS, so it fails as soon as a fourth deployment is added. EvoSnapshot::Validate() bounds the map by VERSIONBITS_NUM_BITS only. Fill every version bit instead, which is the largest valid map whatever the number of deployments is. --- src/test/evo_snapshot_tests.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/evo_snapshot_tests.cpp b/src/test/evo_snapshot_tests.cpp index 4ec96ff76702..356127bee4db 100644 --- a/src/test/evo_snapshot_tests.cpp +++ b/src/test/evo_snapshot_tests.cpp @@ -1192,11 +1192,13 @@ BOOST_FIXTURE_TEST_CASE(mnhf_signal_wire_order_is_canonical, BasicTestingSetup) BOOST_FIXTURE_TEST_CASE(mnhf_signals_outnumbering_deployments_are_valid, BasicTestingSetup) { // CMNHFManager drops a signal only when a current deployment reuses its - // bit, so signals of buried EHF forks (bits 10, 11 and 12) stay in the - // map alongside V24's bit 13. + // bit, so signals of buried EHF forks stay in the map and only the + // number of version bits bounds it. auto snapshot{SyntheticSnapshot()}; - snapshot.mnhf_signals = {{10, 100}, {11, 200}, {12, 300}, {13, 400}}; - BOOST_REQUIRE_GT(snapshot.mnhf_signals.size(), size_t{Consensus::MAX_VERSION_BITS_DEPLOYMENTS}); + snapshot.mnhf_signals.clear(); + for (int bit = 0; bit < VERSIONBITS_NUM_BITS; ++bit) { + snapshot.mnhf_signals.emplace(bit, bit); + } BOOST_CHECK_NO_THROW(snapshot.Validate()); BOOST_CHECK_NO_THROW(GetEvoSnapshotHash(snapshot));