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

Move LIB in commit block under normal conditions #408

Merged
merged 3 commits into from
Jul 25, 2024
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
21 changes: 9 additions & 12 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3288,12 +3288,12 @@ struct controller_impl {
chain_head = block_handle{cb.bsp};
emit( accepted_block, std::tie(chain_head.block(), chain_head.id()), __FILE__, __LINE__ );

if( s == controller::block_status::incomplete ) {
log_irreversible();
transition_to_savanna_if_needed();
}

if ( s == controller::block_status::incomplete || s == controller::block_status::complete || s == controller::block_status::validated ) {
if (!irreversible_mode()) {
log_irreversible();
transition_to_savanna_if_needed();
}

if (!my_finalizers.empty()) {
block_handle_accessor::apply_s<void>(chain_head, [&](const auto& head) {
if (head->is_recent() || my_finalizers.is_active()) {
Expand Down Expand Up @@ -4226,9 +4226,6 @@ struct controller_impl {
shutdown();
break;
}
log_irreversible();
transition_to_savanna_if_needed();

} catch ( const std::bad_alloc& ) {
throw;
} catch ( const boost::interprocess::bad_alloc& ) {
Expand Down Expand Up @@ -4276,11 +4273,11 @@ struct controller_impl {
ilog("successfully switched fork to new head ${new_head_id}, removed {${rm_ids}}, applied {${new_ids}}",
("new_head_id", new_head->id())("rm_ids", get_ids(branches.second))("new_ids", get_ids(branches.first)));
}
} else {
// irreversible can change even if block not applied to head, integrated qc can move LIB
log_irreversible();
transition_to_savanna_if_needed();
}

// irreversible can change even if block not applied to head, integrated qc can move LIB
log_irreversible();
transition_to_savanna_if_needed();
};

fork_db.apply<void>(do_maybe_switch_forks);
Expand Down
Loading
Loading