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

IF: Support replay over instant finality transition #2287

Merged
merged 7 commits into from
Mar 7, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Mar 6, 2024

  • Delay opening fork database until after replay of the block log.
  • Change complete_block to hold a block_handle. This removes duplicate code and allows access to block_handle methods like id() without using fork database variant.

Resolves #2141

@heifner heifner added the OCI Work exclusive to OCI team label Mar 6, 2024
@heifner heifner linked an issue Mar 6, 2024 that may be closed by this pull request
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: INTERNALS
summary: Support replay over instant finality transition by delaying consumption of the fork database until after all blocks are replayed.
Note:end

libraries/chain/block_header_state_legacy.cpp Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
@@ -666,15 +670,15 @@ namespace eosio::chain {

template<class BSP>
BSP fork_database_t<BSP>::get_block(const block_id_type& id,
check_root_t check_root /* = check_root_t::no */) const {
include_root_t include_root /* = include_root_t::no */) const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the /* = include_root_t::no */

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It provides doc on what the default is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought include_root was not a parameter with a default value. Don't make any changes for this PR. In general, should we stay away from default parameters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I'm not a fan of default parameters. Here I was just changing the name.

}

template<class BSP>
BSP fork_database_impl<BSP>::get_block_impl(const block_id_type& id,
check_root_t check_root /* = check_root_t::no */) const {
if( check_root == check_root_t::yes && root->id() == id ) {
include_root_t include_root /* = include_root_t::no */) const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the /* = include_root_t::no */

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It provides doc on what the default is.

@heifner heifner merged commit 321aaa7 into hotstuff_integration Mar 7, 2024
30 checks passed
@heifner heifner deleted the GH-2141-replay branch March 7, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IF: replay from before instant-finality transition
4 participants