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

[4.0] Signal accepted_block after it is marked valid #1769

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Oct 13, 2023

Backport of #1386

As indicated in #1275, produced blocks were signaled to plugins after being marked valid and placed in the forkdb but signaled before being marked valid and placed in the forkdb for validated blocks. This PR makes sure that the block is marked valid before being signaled for both produced blocks and validated blocks. Also refactors location of updating head for applied blocks, consolidating it in commit_block.

This also fixes #1694 as head is updated consistently before accepted_block is signaled which is what state_history_plugin SHiP is using for reporting head in get_status_result_v0 messages.

Resolves #1275
Resolves #1694

@heifner heifner added the OCI Work exclusive to OCI team label Oct 13, 2023
unittests/chain_tests.cpp Show resolved Hide resolved
unittests/chain_tests.cpp Outdated Show resolved Hide resolved
@greg7mdp
Copy link
Contributor

Not related to this issue, but I just noticed that functions like extract_trx_metas() should use std::visit to access the block_stage variant.

@heifner heifner merged commit bef5b63 into release/4.0 Oct 16, 2023
16 checks passed
@heifner heifner deleted the GH-1694-ship-head-4.0 branch October 16, 2023 12:53
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.

ship in 4.0.4: head.block_num is 2 blocks behind trace_end_block and chain_state_end_block
3 participants