From ad750a49ac6211fb238f15bdb040fcc549fcb68d Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 29 Dec 2024 22:22:06 -0500 Subject: [PATCH 1/5] Comments, style. --- src/chasers/chaser_check.cpp | 1 - src/chasers/chaser_confirm.cpp | 14 +------------- src/chasers/chaser_validate.cpp | 5 +---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index ea102d61..a5fa49fe 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -381,7 +381,6 @@ size_t chaser_check::set_unassociated() NOEXCEPT << count << ") last (" << requested_ << ")."); - ////notify(error::success, chase::checking, requested_); return count; } diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 526dcc63..9a0a865f 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -86,7 +86,7 @@ bool chaser_confirm::handle_event(const code&, chase event_, return true; // An unconfirmable block height must not land here. - // These can come out of order, advance in order synchronously. + // These come out of order, advance in order synchronously. switch (event_) { ////case chase::blocks: @@ -127,14 +127,6 @@ bool chaser_confirm::handle_event(const code&, chase event_, break; } - ////case chase::checking: - ////{ - //// BC_ASSERT(std::holds_alternative(value)); - //// ////POST(do_checking, std::get(value)); - //// boost::asio::post(strand_, - //// BIND(do_checking, std::get(value))); - //// break; - ////} case chase::regressed: { BC_ASSERT(std::holds_alternative(value)); @@ -164,10 +156,6 @@ bool chaser_confirm::handle_event(const code&, chase event_, return true; } -////void chaser_confirm::do_checking(height_t height) NOEXCEPT -////{ -////} - void chaser_confirm::do_regressed(height_t branch_point) NOEXCEPT { BC_ASSERT(stranded()); diff --git a/src/chasers/chaser_validate.cpp b/src/chasers/chaser_validate.cpp index 8e72a1c3..84e48f71 100644 --- a/src/chasers/chaser_validate.cpp +++ b/src/chasers/chaser_validate.cpp @@ -241,8 +241,7 @@ void chaser_validate::validate_block(const header_link& link) NOEXCEPT block->populate(); if (!query.populate(*block)) { - // This could instead be a case of invalid milestone. - ////POST(complete_block, error::validate3, link, ctx.height); + ////POST(complete_block, error::validate3, link, ctx.height); boost::asio::post(strand_, BIND(complete_block, error::validate3, link, ctx.height)); return; @@ -253,9 +252,7 @@ void chaser_validate::validate_block(const header_link& link) NOEXCEPT ((ec = block->connect(ctx)))) { if (!query.set_block_unconfirmable(link)) - { ec = error::validate4; - } } else if (!query.set_block_valid(link)) { From ac640a4f66f94c21803b94410009c1b0faee3036 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 29 Dec 2024 22:22:40 -0500 Subject: [PATCH 2/5] Use high/normal threads for confirm. --- src/chasers/chaser_confirm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 9a0a865f..82210776 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -43,7 +43,7 @@ chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT : chaser(node), concurrent_(node.config().node.concurrent_confirmation), threadpool_(1_u32, node.config().node.priority_validation ? - network::thread_priority::highest : network::thread_priority::high), + network::thread_priority::high : network::thread_priority::normal), strand_(threadpool_.service().get_executor()) { } From f2ffb6b77aed567ce283d91f77678f0fd174162b Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 30 Dec 2024 17:12:42 -0500 Subject: [PATCH 3/5] Comment, add fall-through fault to confirmation chaser. --- src/chasers/chaser_confirm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 82210776..8aaa0792 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -212,6 +212,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT return; } + // Confirmation query. if ((ec = query.block_confirmable(link))) { if (ec == database::error::integrity) @@ -275,6 +276,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT // database::error::unknown_state [shouldn't be here] // database::error::unassociated [shouldn't be here] // database::error::unvalidated [shouldn't be here] + fault(error::confirm8); return; } From 6d425e6570dc9c2ec9b87a172afdc7583b49dc71 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 30 Dec 2024 17:21:01 -0500 Subject: [PATCH 4/5] Comments. --- src/chasers/chaser_confirm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 8aaa0792..8c1667d8 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -182,6 +182,9 @@ void chaser_confirm::do_validated(height_t height) NOEXCEPT do_bump(height); } +// TODO: This is a simplified variant of the full implementation below. +// This variant doesn't implement the relative work check and instead confirms +// one block at a time, just like validation. void chaser_confirm::do_bump(height_t) NOEXCEPT { BC_ASSERT(stranded()); From 2c50aaa1fa814f1664e9ba3487d8a5144e31ff34 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Wed, 1 Jan 2025 15:29:22 -0500 Subject: [PATCH 5/5] Rename to_tx_spends due to db change. --- console/executor_scans.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/executor_scans.cpp b/console/executor_scans.cpp index b1874012..5005932d 100644 --- a/console/executor_scans.cpp +++ b/console/executor_scans.cpp @@ -432,7 +432,7 @@ void executor::scan_collisions() const const auto transactions = query_.to_transactions(link); for (const auto& transaction: transactions) { - const auto inputs = query_.to_tx_spends(transaction); + const auto inputs = query_.to_spends(transaction); for (const auto& in: inputs) { ++total;