From 56b35c26bad8589421f21888e3f118b53c43e38d Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 29 Nov 2026 21:16:16 -0500 Subject: [PATCH 1/4] Rename store prune to trim. --- include/bitcoin/node/chase.hpp | 10 +++---- include/bitcoin/node/chasers/chaser.hpp | 4 +-- .../bitcoin/node/chasers/chaser_snapshot.hpp | 4 +-- .../node/chasers/chaser_transaction.hpp | 4 +-- include/bitcoin/node/error.hpp | 2 +- include/bitcoin/node/events.hpp | 2 +- include/bitcoin/node/full_node.hpp | 4 +-- src/chasers/chaser.cpp | 4 +-- src/chasers/chaser_snapshot.cpp | 28 +++++++++---------- src/chasers/chaser_transaction.cpp | 8 +++--- src/error.cpp | 2 +- src/full_node.cpp | 10 +++---- test/chasers/chaser_transaction_query.cpp | 4 +-- test/error.cpp | 6 ++-- test/full_node.cpp | 10 +++---- test/functional/p2p_compact.cpp | 2 +- test/functional/p2p_setup_fixture.hpp | 2 +- 17 files changed, 53 insertions(+), 53 deletions(-) diff --git a/include/bitcoin/node/chase.hpp b/include/bitcoin/node/chase.hpp index 58081638d..464da3e50 100644 --- a/include/bitcoin/node/chase.hpp +++ b/include/bitcoin/node/chase.hpp @@ -158,9 +158,9 @@ enum class chase /// Issued by 'transaction' and handled by 'snapshot'. block_settled, - /// Store has been pruned (once, following first settled block). + /// Store has been trimmed (once, following first settled block). /// Issued by 'snapshot' and handled by 'transaction'. - pruned, + trimmed, /// Confirmed chain is no longer current. /// Issued by 'confirm' and handled by 'protocol_transaction_out'. @@ -344,9 +344,9 @@ struct block_settled header_t link; }; -struct pruned +struct trimmed { - static constexpr chase id{ chase::pruned }; + static constexpr chase id{ chase::trimmed }; header_t link; }; @@ -421,7 +421,7 @@ using event_value = std::variant chases::unconfirmable, chases::block, chases::block_settled, - chases::pruned, + chases::trimmed, chases::stale, chases::organized, chases::reorganized, diff --git a/include/bitcoin/node/chasers/chaser.hpp b/include/bitcoin/node/chasers/chaser.hpp index 76996692f..dba6457a3 100644 --- a/include/bitcoin/node/chasers/chaser.hpp +++ b/include/bitcoin/node/chasers/chaser.hpp @@ -85,8 +85,8 @@ class BCN_API chaser /// Resume all network connections. virtual void resume() NOEXCEPT; - /// Prune the store, suspends and resumes network. - virtual code prune(const store::event_handler& handler) NOEXCEPT; + /// Trim the store, suspends and resumes network. + virtual code trim(const store::event_handler& handler) NOEXCEPT; /// Snapshot the store, suspends and resumes network. virtual code snapshot(const store::event_handler& handler) NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_snapshot.hpp b/include/bitcoin/node/chasers/chaser_snapshot.hpp index 0333e5c72..3711ca761 100644 --- a/include/bitcoin/node/chasers/chaser_snapshot.hpp +++ b/include/bitcoin/node/chasers/chaser_snapshot.hpp @@ -40,7 +40,7 @@ class BCN_API chaser_snapshot code start() NOEXCEPT override; protected: - virtual void do_prune(header_t link) NOEXCEPT; + virtual void do_trim(header_t link) NOEXCEPT; virtual void do_snap(size_t height) NOEXCEPT; ////virtual void do_archive(height_t height) NOEXCEPT; ////virtual void do_valid(height_t height) NOEXCEPT; @@ -67,7 +67,7 @@ class BCN_API chaser_snapshot ////size_t valid_{}; ////size_t confirm_{}; ////bool recent_{}; - std::atomic_bool pruned_{}; + std::atomic_bool trimmed_{}; }; } // namespace node diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp index 954cff7bb..c11fa6359 100644 --- a/include/bitcoin/node/chasers/chaser_transaction.hpp +++ b/include/bitcoin/node/chasers/chaser_transaction.hpp @@ -181,8 +181,8 @@ class BCN_API chaser_transaction /// Apply the reorganized block to the pool index and pool its unpooled txs. virtual void do_reorganized(header_t link) NOEXCEPT; - /// Raise the arrivals floor above the pruned block. - virtual void do_pruned(header_t link) NOEXCEPT; + /// Raise the arrivals floor above the block of the trim. + virtual void do_trimmed(header_t link) NOEXCEPT; /// Map scan starts from the confirmed top (scan threadpool). virtual void do_scan(const database::header_link& top, size_t bound, diff --git a/include/bitcoin/node/error.hpp b/include/bitcoin/node/error.hpp index 9d942aa2c..1b0ab843a 100644 --- a/include/bitcoin/node/error.hpp +++ b/include/bitcoin/node/error.hpp @@ -42,7 +42,7 @@ enum error_t : uint8_t /// database store_uninitialized, store_reload, - store_prune, + store_trim, store_snapshot, /// network diff --git a/include/bitcoin/node/events.hpp b/include/bitcoin/node/events.hpp index 00cfe9b40..92ed9b996 100644 --- a/include/bitcoin/node/events.hpp +++ b/include/bitcoin/node/events.hpp @@ -55,7 +55,7 @@ enum events : uint8_t /// Timespans. snapshot_secs, // snapshot timespan in seconds. - prune_msecs, // prune timespan in milliseconds. + trim_msecs, // trim timespan in milliseconds. reload_msecs, // store reload timespan in milliseconds. block_usecs, // getblock timespan in microseconds. ancestry_msecs, // getancestry timespan in milliseconds. diff --git a/include/bitcoin/node/full_node.hpp b/include/bitcoin/node/full_node.hpp index f75fc1089..31fd0fd12 100644 --- a/include/bitcoin/node/full_node.hpp +++ b/include/bitcoin/node/full_node.hpp @@ -183,8 +183,8 @@ class BCN_API full_node /// Handle a fault that has occurred. virtual void fault(const code& ec) NOEXCEPT; - /// Prune the store, suspends and resumes network. - virtual code prune(const store::event_handler& handler) NOEXCEPT; + /// Trim the store, suspends and resumes network. + virtual code trim(const store::event_handler& handler) NOEXCEPT; /// Snapshot the store, suspends and resumes network. virtual code snapshot(const store::event_handler& handler) NOEXCEPT; diff --git a/src/chasers/chaser.cpp b/src/chasers/chaser.cpp index 324a3aa25..7b405a1fc 100644 --- a/src/chasers/chaser.cpp +++ b/src/chasers/chaser.cpp @@ -80,9 +80,9 @@ uint64_t chaser::pool_generation() const NOEXCEPT return node_.pool_generation(); } -code chaser::prune(const store::event_handler& handler) NOEXCEPT +code chaser::trim(const store::event_handler& handler) NOEXCEPT { - return node_.prune(handler); + return node_.trim(handler); } code chaser::snapshot(const store::event_handler& handler) NOEXCEPT diff --git a/src/chasers/chaser_snapshot.cpp b/src/chasers/chaser_snapshot.cpp index fe4bb2edd..782be542d 100644 --- a/src/chasers/chaser_snapshot.cpp +++ b/src/chasers/chaser_snapshot.cpp @@ -114,10 +114,10 @@ bool chaser_snapshot::handle_chase(const code&, event_value value) NOEXCEPT ////} case chase::block_settled: { - if (pruned_.load(std::memory_order_relaxed)) + if (trimmed_.load(std::memory_order_relaxed)) break; - POST(do_prune, to_payload(value).link); + POST(do_trim, to_payload(value).link); break; } case chase::snap: @@ -137,44 +137,44 @@ bool chaser_snapshot::handle_chase(const code&, event_value value) NOEXCEPT // events // ---------------------------------------------------------------------------- -void chaser_snapshot::do_prune(header_t link) NOEXCEPT +void chaser_snapshot::do_trim(header_t link) NOEXCEPT { BC_ASSERT(stranded()); - if (pruned_.load(std::memory_order_relaxed) || + if (trimmed_.load(std::memory_order_relaxed) || closed() || !archive().is_coalesced()) return; const auto running = !suspended(); LOG_ONLY(const auto start = logger::now();) - if (const auto ec = prune([this](auto LOG_ONLY(event_), + if (const auto ec = trim([this](auto LOG_ONLY(event_), auto LOG_ONLY(table)) NOEXCEPT { - // prune internally logs the prune event, otherwise is a snapshot. + // trim internally logs the trim event, otherwise is a snapshot. LOGN("snapshot::" << full_node::store::events.at(event_) << "(" << full_node::store::tables.at(table) << ")"); })) { - // Prune may fail due to chain not coalesced following suspend, in which - // case pruning is attempted on announce until success. - LOGF("Prune deferred, " << ec.message()); + // Trim may fail due to chain not coalesced following suspend, in which + // case trimming is attempted on announce until success. + LOGF("Trim deferred, " << ec.message()); if (running && ec == database::error::not_coalesced) resume(); } else { - // The resumption is observable, so the prune is marked before it. - pruned_.store(true, std::memory_order_relaxed); - notify(error::success, chases::pruned{ link }); + // The resumption is observable, so the trim is marked before it. + trimmed_.store(true, std::memory_order_relaxed); + notify(error::success, chases::trimmed{ link }); - // Could become full before prune start (and it could still succeed). + // Could become full before trim start (and it could still succeed). if (running && !archive().is_full()) resume(); LOG_ONLY(const auto time = logger::now() - start;) LOG_ONLY(const auto span = duration_cast(time);) - LOGN("Pruned prevout cache at height [" << archive().get_top_confirmed() + LOGN("Trimmed prevout cache at height [" << archive().get_top_confirmed() << "] complete in " << span.count() << " msecs."); } } diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index 58b8519e8..0f5ac2dcd 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -159,9 +159,9 @@ bool chaser_transaction::handle_chase(const code&, event_value value) NOEXCEPT POST(do_reorganized, to_payload(value).link); break; } - case chase::pruned: + case chase::trimmed: { - POST(do_pruned, to_payload(value).link); + POST(do_trimmed, to_payload(value).link); break; } case chase::stop: @@ -242,8 +242,8 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT fault(error::transaction11); } -// Rows confirmed by the pruned block are not retained by the prune. -void chaser_transaction::do_pruned(header_t link) NOEXCEPT +// Rows confirmed by the block of the trim are not retained by the trim. +void chaser_transaction::do_trimmed(header_t link) NOEXCEPT { BC_ASSERT(stranded()); if (closed()) diff --git a/src/error.cpp b/src/error.cpp index 31d28dde2..c7ba5259c 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -32,7 +32,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error) // database { store_uninitialized, "store not initialized" }, { store_reload, "store reload" }, - { store_prune, "store prune" }, + { store_trim, "store trim" }, { store_snapshot, "store snapshot" }, // network diff --git a/src/full_node.cpp b/src/full_node.cpp index 76e534959..a1d7a415c 100644 --- a/src/full_node.cpp +++ b/src/full_node.cpp @@ -441,23 +441,23 @@ void full_node::fault(const code& ec) NOEXCEPT } // Leaves network suspended, caller may want to resume upon success. -code full_node::prune(const store::event_handler& handler) NOEXCEPT +code full_node::trim(const store::event_handler& handler) NOEXCEPT { if (query_.is_fault()) return query_.get_code(); const auto start = logger::now(); - suspend(error::store_prune); - const auto ec = query_.prune([&](auto event, auto table) NOEXCEPT + suspend(error::store_trim); + const auto ec = query_.trim([&](auto event, auto table) NOEXCEPT { // Suspend channels that missed previous suspend events. if (event == database::event_t::wait_lock) - suspend(error::store_prune); + suspend(error::store_trim); handler(event, table); }); - net::span(events::prune_msecs, start); + net::span(events::trim_msecs, start); return ec; } diff --git a/test/chasers/chaser_transaction_query.cpp b/test/chasers/chaser_transaction_query.cpp index 6da7489a8..7fa77e8f8 100644 --- a/test/chasers/chaser_transaction_query.cpp +++ b/test/chasers/chaser_transaction_query.cpp @@ -399,7 +399,7 @@ BC_FIXTURE_TEST_CASE(chaser_transaction__estimate__geometric_after_block__arriva BC_REQUIRE_EQUAL(rate, 16'394u); } -BC_FIXTURE_TEST_CASE(chaser_transaction__pruned__arrivals_below_floor__not_counted, chaser_transaction_single_setup_fixture) +BC_FIXTURE_TEST_CASE(chaser_transaction__trimmed__arrivals_below_floor__not_counted, chaser_transaction_single_setup_fixture) { const auto first = spend(parent_value - 1'000); const auto second = spend(first->hash(false), parent_value - 3'000); @@ -407,7 +407,7 @@ BC_FIXTURE_TEST_CASE(chaser_transaction__pruned__arrivals_below_floor__not_count const auto link = confirm(); const auto current = bumped(3); const auto counted = estimate(1, node::estimate_mode::economical); - node_.notify(node::error::success, chases::pruned{ link }); + node_.notify(node::error::success, chases::trimmed{ link }); BC_REQUIRE_EQUAL(result.first, node::error::success); BC_REQUIRE(current); BC_REQUIRE_EQUAL(counted.second, 16'394u); diff --git a/test/error.cpp b/test/error.cpp index b4e6a0d9a..64b0c6609 100644 --- a/test/error.cpp +++ b/test/error.cpp @@ -54,13 +54,13 @@ BC_AUTO_TEST_CASE(error_t__code__store_reload__true_expected_message) BC_REQUIRE_EQUAL(ec.message(), "store reload"); } -BC_AUTO_TEST_CASE(error_t__code__store_prune__true_expected_message) +BC_AUTO_TEST_CASE(error_t__code__store_trim__true_expected_message) { - constexpr auto value = error::store_prune; + constexpr auto value = error::store_trim; const auto ec = code(value); BC_REQUIRE(ec); BC_REQUIRE(ec == value); - BC_REQUIRE_EQUAL(ec.message(), "store prune"); + BC_REQUIRE_EQUAL(ec.message(), "store trim"); } BC_AUTO_TEST_CASE(error_t__code__store_snapshot__true_expected_message) diff --git a/test/full_node.cpp b/test/full_node.cpp index b6fd6d412..ae9afdd2a 100644 --- a/test/full_node.cpp +++ b/test/full_node.cpp @@ -401,18 +401,18 @@ BC_AUTO_TEST_CASE(full_node__notify__snap__resumed) BC_REQUIRE_EQUAL(future.get(), error::success); } -BC_AUTO_TEST_CASE(full_node__notify__block__pruned) +BC_AUTO_TEST_CASE(full_node__notify__block__trimmed) { BC_REQUIRE(initialize()); BC_REQUIRE(!start()); BC_REQUIRE(!run()); - auto pruned = subscribe(chase::pruned); + auto trimmed = subscribe(chase::trimmed); node_.notify(error::success, chases::block{ 0 }); - BC_REQUIRE(ready(pruned)); - BC_REQUIRE_EQUAL(pruned.get(), error::success); + BC_REQUIRE(ready(trimmed)); + BC_REQUIRE_EQUAL(trimmed.get(), error::success); } -BC_AUTO_TEST_CASE(full_node__notify__block_after_prune__not_suspended) +BC_AUTO_TEST_CASE(full_node__notify__block_after_trim__not_suspended) { BC_REQUIRE(initialize()); BC_REQUIRE(!start()); diff --git a/test/functional/p2p_compact.cpp b/test/functional/p2p_compact.cpp index b55153847..03712a377 100644 --- a/test/functional/p2p_compact.cpp +++ b/test/functional/p2p_compact.cpp @@ -327,7 +327,7 @@ BC_AUTO_TEST_CASE(functional_p2p_compact__compact_block__short_id_mismatch__stop // Unidentified fill leaves evidence, resolved against archived block. // Block 2 remains unassociated candidate, so chain never coalesces -// (which would prune store, suspending network). +// (which would trim store, suspending network). BC_FIXTURE_TEST_CASE(functional_p2p_compact__compact_block__unidentified_then_archived__stopped, p2p_compact_candidate_setup_fixture) { BC_REQUIRE(handshake(full_node)); diff --git a/test/functional/p2p_setup_fixture.hpp b/test/functional/p2p_setup_fixture.hpp index 196562c4b..35b3717b2 100644 --- a/test/functional/p2p_setup_fixture.hpp +++ b/test/functional/p2p_setup_fixture.hpp @@ -253,7 +253,7 @@ struct p2p_unassociated_setup_fixture }; // Node with compact blocks enabled and chain always current. Candidate above -// confirmed top precludes store prune, which suspends network (dropping test +// confirmed top precludes store trim, which suspends network (dropping test // peer) when chain coalesces. struct p2p_compact_setup_fixture : p2p_setup_fixture From aa4a8153224cd1c747c24abed16cfb631b879067 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 29 Nov 2026 21:44:47 -0500 Subject: [PATCH 2/4] Remove trimmed event and its arrivals floor, as trim leaves the pool. --- include/bitcoin/node/chase.hpp | 11 --------- .../bitcoin/node/chasers/chaser_snapshot.hpp | 2 +- .../node/chasers/chaser_transaction.hpp | 3 --- src/chasers/chaser_snapshot.cpp | 5 ++-- src/chasers/chaser_transaction.cpp | 23 ------------------- test/chasers/chaser_transaction_query.cpp | 15 ------------ .../chaser_transaction_setup_fixture.hpp | 17 -------------- test/full_node.cpp | 11 --------- 8 files changed, 3 insertions(+), 84 deletions(-) diff --git a/include/bitcoin/node/chase.hpp b/include/bitcoin/node/chase.hpp index 464da3e50..3e8120c67 100644 --- a/include/bitcoin/node/chase.hpp +++ b/include/bitcoin/node/chase.hpp @@ -158,10 +158,6 @@ enum class chase /// Issued by 'transaction' and handled by 'snapshot'. block_settled, - /// Store has been trimmed (once, following first settled block). - /// Issued by 'snapshot' and handled by 'transaction'. - trimmed, - /// Confirmed chain is no longer current. /// Issued by 'confirm' and handled by 'protocol_transaction_out'. stale, @@ -344,12 +340,6 @@ struct block_settled header_t link; }; -struct trimmed -{ - static constexpr chase id{ chase::trimmed }; - header_t link; -}; - struct stale { static constexpr chase id{ chase::stale }; @@ -421,7 +411,6 @@ using event_value = std::variant chases::unconfirmable, chases::block, chases::block_settled, - chases::trimmed, chases::stale, chases::organized, chases::reorganized, diff --git a/include/bitcoin/node/chasers/chaser_snapshot.hpp b/include/bitcoin/node/chasers/chaser_snapshot.hpp index 3711ca761..f7208181e 100644 --- a/include/bitcoin/node/chasers/chaser_snapshot.hpp +++ b/include/bitcoin/node/chasers/chaser_snapshot.hpp @@ -40,7 +40,7 @@ class BCN_API chaser_snapshot code start() NOEXCEPT override; protected: - virtual void do_trim(header_t link) NOEXCEPT; + virtual void do_trim() NOEXCEPT; virtual void do_snap(size_t height) NOEXCEPT; ////virtual void do_archive(height_t height) NOEXCEPT; ////virtual void do_valid(height_t height) NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp index c11fa6359..d60c266c1 100644 --- a/include/bitcoin/node/chasers/chaser_transaction.hpp +++ b/include/bitcoin/node/chasers/chaser_transaction.hpp @@ -181,9 +181,6 @@ class BCN_API chaser_transaction /// Apply the reorganized block to the pool index and pool its unpooled txs. virtual void do_reorganized(header_t link) NOEXCEPT; - /// Raise the arrivals floor above the block of the trim. - virtual void do_trimmed(header_t link) NOEXCEPT; - /// Map scan starts from the confirmed top (scan threadpool). virtual void do_scan(const database::header_link& top, size_t bound, bool remap) NOEXCEPT; diff --git a/src/chasers/chaser_snapshot.cpp b/src/chasers/chaser_snapshot.cpp index 782be542d..477fc2558 100644 --- a/src/chasers/chaser_snapshot.cpp +++ b/src/chasers/chaser_snapshot.cpp @@ -117,7 +117,7 @@ bool chaser_snapshot::handle_chase(const code&, event_value value) NOEXCEPT if (trimmed_.load(std::memory_order_relaxed)) break; - POST(do_trim, to_payload(value).link); + POST(do_trim); break; } case chase::snap: @@ -137,7 +137,7 @@ bool chaser_snapshot::handle_chase(const code&, event_value value) NOEXCEPT // events // ---------------------------------------------------------------------------- -void chaser_snapshot::do_trim(header_t link) NOEXCEPT +void chaser_snapshot::do_trim() NOEXCEPT { BC_ASSERT(stranded()); if (trimmed_.load(std::memory_order_relaxed) || @@ -166,7 +166,6 @@ void chaser_snapshot::do_trim(header_t link) NOEXCEPT { // The resumption is observable, so the trim is marked before it. trimmed_.store(true, std::memory_order_relaxed); - notify(error::success, chases::trimmed{ link }); // Could become full before trim start (and it could still succeed). if (running && !archive().is_full()) diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index 0f5ac2dcd..6d782be89 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -159,11 +159,6 @@ bool chaser_transaction::handle_chase(const code&, event_value value) NOEXCEPT POST(do_reorganized, to_payload(value).link); break; } - case chase::trimmed: - { - POST(do_trimmed, to_payload(value).link); - break; - } case chase::stop: { return false; @@ -242,24 +237,6 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT fault(error::transaction11); } -// Rows confirmed by the block of the trim are not retained by the trim. -void chaser_transaction::do_trimmed(header_t link) NOEXCEPT -{ - BC_ASSERT(stranded()); - if (closed()) - return; - - size_t height{}; - if (!archive().get_height(height, link)) - { - fault(error::transaction9); - return; - } - - context_.floor = std::max(context_.floor, add1(height)); - estimate_.estimating = false; -} - // utility // ---------------------------------------------------------------------------- diff --git a/test/chasers/chaser_transaction_query.cpp b/test/chasers/chaser_transaction_query.cpp index 7fa77e8f8..56341dc0f 100644 --- a/test/chasers/chaser_transaction_query.cpp +++ b/test/chasers/chaser_transaction_query.cpp @@ -399,19 +399,4 @@ BC_FIXTURE_TEST_CASE(chaser_transaction__estimate__geometric_after_block__arriva BC_REQUIRE_EQUAL(rate, 16'394u); } -BC_FIXTURE_TEST_CASE(chaser_transaction__trimmed__arrivals_below_floor__not_counted, chaser_transaction_single_setup_fixture) -{ - const auto first = spend(parent_value - 1'000); - const auto second = spend(first->hash(false), parent_value - 3'000); - const auto result = submit(package({ first, second })); - const auto link = confirm(); - const auto current = bumped(3); - const auto counted = estimate(1, node::estimate_mode::economical); - node_.notify(node::error::success, chases::trimmed{ link }); - BC_REQUIRE_EQUAL(result.first, node::error::success); - BC_REQUIRE(current); - BC_REQUIRE_EQUAL(counted.second, 16'394u); - BC_REQUIRE(estimated_at(1, node::estimate_mode::economical, 0)); -} - BC_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_transaction_setup_fixture.hpp b/test/chasers/chaser_transaction_setup_fixture.hpp index dabbccc5d..28066a924 100644 --- a/test/chasers/chaser_transaction_setup_fixture.hpp +++ b/test/chasers/chaser_transaction_setup_fixture.hpp @@ -622,23 +622,6 @@ struct chaser_transaction_setup_fixture return false; } - // True once the estimate is the rate. - bool estimated_at(size_t target, node::estimate_mode mode, uint64_t rate) - { - using namespace std::chrono; - const auto deadline = steady_clock::now() + seconds(10); - while (steady_clock::now() < deadline) - { - const auto result = estimate(target, mode); - if (!result.first && result.second == rate) - return true; - - std::this_thread::sleep_for(milliseconds(10)); - } - - return false; - } - bool suspended() { using namespace std::chrono; diff --git a/test/full_node.cpp b/test/full_node.cpp index ae9afdd2a..c45b2a5c4 100644 --- a/test/full_node.cpp +++ b/test/full_node.cpp @@ -401,17 +401,6 @@ BC_AUTO_TEST_CASE(full_node__notify__snap__resumed) BC_REQUIRE_EQUAL(future.get(), error::success); } -BC_AUTO_TEST_CASE(full_node__notify__block__trimmed) -{ - BC_REQUIRE(initialize()); - BC_REQUIRE(!start()); - BC_REQUIRE(!run()); - auto trimmed = subscribe(chase::trimmed); - node_.notify(error::success, chases::block{ 0 }); - BC_REQUIRE(ready(trimmed)); - BC_REQUIRE_EQUAL(trimmed.get(), error::success); -} - BC_AUTO_TEST_CASE(full_node__notify__block_after_trim__not_suspended) { BC_REQUIRE(initialize()); From b1f040f16837342ab9272d5c736d2c4245097b77 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Mon, 30 Nov 2026 00:52:17 -0500 Subject: [PATCH 3/4] Regenerate artifacts (delinting). --- .github/workflows/ci-expanded.yml | 10 +++++----- .github/workflows/ci.yml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-expanded.yml b/.github/workflows/ci-expanded.yml index 6fd335756..08fdb84e6 100644 --- a/.github/workflows/ci-expanded.yml +++ b/.github/workflows/ci-expanded.yml @@ -598,7 +598,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -822,7 +822,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -1374,7 +1374,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -1849,7 +1849,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -2112,7 +2112,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe6db3565..fbf145591 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -330,7 +330,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -589,7 +589,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -852,7 +852,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" @@ -1066,7 +1066,7 @@ jobs: shell: bash run: | cat > "$RUNNER_TEMP/warning-matcher.json" << 'EOF' - {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?)(?:\\s+\\[(-W[^\\]]+)\\])?$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} + {"problemMatcher":[{"owner":"gcc-warning","severity":"warning","pattern":[{"regexp":"^([^\\s:(][^:(]*):(\\d+):(\\d+):\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]},{"owner":"msvc-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning\\s+(C\\d+)\\s*:\\s*(.*?)(?:\\s+\\[[^\\]]+\\])?$","file":1,"line":2,"column":3,"code":4,"message":5}]},{"owner":"clang-cl-warning","severity":"warning","pattern":[{"regexp":"^\\s*(?:\\d+>)?([^\\s(][^(]*)\\((\\d+)(?:,(\\d+))?\\)\\s*:\\s+warning:\\s+(.*?(?:\\s+\\[(-W[^\\]]+)\\])?)$","file":1,"line":2,"column":3,"message":4,"code":5}]}]} EOF echo "::add-matcher::$RUNNER_TEMP/warning-matcher.json" From 12e47a1abc28e8e84d11d6c1c70d08b0f4715a64 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 29 Nov 2026 23:31:38 -0500 Subject: [PATCH 4/4] Skip prevout cache for a confirmable block. --- src/chasers/chaser_validate_parallel.cpp | 5 +++-- test/chasers/chaser_confirm.cpp | 2 ++ test/chasers/chaser_validate.cpp | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/chasers/chaser_validate_parallel.cpp b/src/chasers/chaser_validate_parallel.cpp index 8bdb841b2..35712f299 100644 --- a/src/chasers/chaser_validate_parallel.cpp +++ b/src/chasers/chaser_validate_parallel.cpp @@ -325,10 +325,11 @@ code chaser_validate::validate(bool& batched, bool& capturing, return ec; // Prevouts optimize confirmation. - if (!query.set_prevouts(link, spends, conflicts)) + const auto state = query.get_block_state(link); + if (!database::is_confirmable(state) && + !query.set_prevouts(link, spends, conflicts)) return error::validate7; - const auto state = query.get_block_state(link); if (!database::is_filtered(state) && !query.set_filter_body(link, block)) return error::validate8; diff --git a/test/chasers/chaser_confirm.cpp b/test/chasers/chaser_confirm.cpp index 87baaf513..75be024cd 100644 --- a/test/chasers/chaser_confirm.cpp +++ b/test/chasers/chaser_confirm.cpp @@ -262,6 +262,7 @@ static bool confirm_confirmable(node::query& query) { return confirm_candidate(query, confirm_d1(), 1) && confirm_filtered(query, confirm_d1()) && + query.set_block_valid(query.to_header(confirm_d1().hash())) && query.set_block_confirmable(query.to_header(confirm_d1().hash())); } @@ -270,6 +271,7 @@ static bool confirm_confirmables(node::query& query) return confirm_confirmable(query) && confirm_candidate(query, confirm_d2(), 2) && confirm_filtered(query, confirm_d2()) && + query.set_block_valid(query.to_header(confirm_d2().hash())) && query.set_block_confirmable(query.to_header(confirm_d2().hash())); } diff --git a/test/chasers/chaser_validate.cpp b/test/chasers/chaser_validate.cpp index d4c08861c..490773f0c 100644 --- a/test/chasers/chaser_validate.cpp +++ b/test/chasers/chaser_validate.cpp @@ -388,6 +388,13 @@ static bool validate_matured_scanned(node::query& query) query.set_block_scanned(query.to_header(top.hash())); } +static bool validate_matured_confirmable(node::query& query) +{ + const auto& top = validate_matured().back(); + return validate_matured_candidates(query) && + query.set_block_confirmable(query.to_header(top.hash())); +} + static bool validate_silent_candidates(node::query& query) { return validate_silent_store(query, validate_a1(), 1) && @@ -745,6 +752,15 @@ struct validate_scanned_fixture } }; +struct validate_confirmable_fixture + : validate_setup_fixture +{ + validate_confirmable_fixture() + : validate_setup_fixture(validate_matured_confirmable, validate_silent) + { + } +}; + static void validate_silent_bypass(configuration& config) { validate_silent_batched(config); @@ -894,6 +910,13 @@ BC_FIXTURE_TEST_CASE(chaser_validate__start__scanned_silent_spend__no_scan_recor BC_REQUIRE(is_zero(query_.scan_records())); } +BC_FIXTURE_TEST_CASE(chaser_validate__start__confirmable_not_valid__validated_without_prevouts, validate_confirmable_fixture) +{ + BC_REQUIRE(confirmed(101)); + BC_REQUIRE(stated(validate_matured().back(), database::is_validated)); + BC_REQUIRE(!query_.is_cached_prevouts(query_.to_header(validate_matured().back().hash()))); +} + BC_FIXTURE_TEST_CASE(chaser_validate__process_batch__residual_commit_during_drain__drained, validate_noncandidates_fixture) { const auto first = query_.to_header(validate_x1().hash());