Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore set_block_confirmable. #736

Merged
merged 3 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/bitcoin/node/chasers/chaser_confirm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class BCN_API chaser_confirm

// These are thread safe.
network::asio::strand independent_strand_;
bool prevout_;
};

} // namespace node
Expand Down
30 changes: 10 additions & 20 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ using namespace std::placeholders;

BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)

// Single higher priority thread strand (base class strand uses network pool).
// Higher priority than validator ensures locality to validator reads.
// Independent threadpool and strand (base class strand uses network pool).
chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT
: chaser(node),
threadpool_(one, node.config().node.priority_()),
independent_strand_(threadpool_.service().get_executor()),
prevout_(node.archive().prevout_enabled())
independent_strand_(threadpool_.service().get_executor())
{
}

Expand Down Expand Up @@ -195,13 +193,6 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
}
else if (ec == database::error::block_valid)
{
// Set before if not using prevout table.
if (!prevout_ && !query.set_strong(link))
{
fault(error::confirm2);
return;
}

// Confirmation query.
if ((ec = query.block_confirmable(link)))
{
Expand All @@ -213,7 +204,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
}

// Unset from set before if not using prevout table.
if (!prevout_ && !query.set_unstrong(link))
if (!query.set_unstrong(link))
{
fault(error::confirm3);
return;
Expand All @@ -231,16 +222,15 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

// This is not necessary and may overflow the table link. Faster to
// never do it and redo a tiny number of blocks in case of reorg.
////if (!query.set_block_confirmable(link))
////{
//// fault(error::confirm5);
//// return;
////}
// Otherwise we will reconfirm entire chain on restart.
if (!query.set_block_confirmable(link))
{
fault(error::confirm5);
return;
}

// Set after if using prevout table.
if (prevout_ && !query.set_strong(link))
if (!query.set_strong(link))
{
fault(error::confirm6);
return;
Expand Down
3 changes: 1 addition & 2 deletions src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR)
BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED)
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)

// Multiple higher priority thread strand (base class strand uses network pool).
// Higher priority than downloader (net) ensures locality to downloader writes.
// Independent threadpool and strand (base class strand uses network pool).
chaser_validate::chaser_validate(full_node& node) NOEXCEPT
: chaser(node),
threadpool_(node.config().node.threads_(), node.config().node.priority_()),
Expand Down
4 changes: 2 additions & 2 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ parser::parser(system::chain::selection context) NOEXCEPT
// database (caches)

configured.database.prevout_buckets = 850'001;
configured.database.prevout_size = 2'600'000'000;
configured.database.prevout_size = 5'250'000'000;
configured.database.prevout_rate = 5;

configured.database.validated_tx_buckets = 0;
Expand Down Expand Up @@ -817,7 +817,7 @@ options_metadata parser::load_settings() THROWS
(
"database.prevout_size",
value<uint64_t>(&configured.database.prevout_size),
"The minimum allocation of the prevout table body, defaults to '2600000000'."
"The minimum allocation of the prevout table body, defaults to '5250000000'."
)
(
"database.prevout_rate",
Expand Down
Loading