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: Unification: Implement block_header_state_core and new algorithm to support transitions of that core #1912

Closed
Tracked by #1508
arhag opened this issue Nov 16, 2023 · 0 comments · Fixed by #1923
Closed
Tracked by #1508
Assignees

Comments

@arhag
Copy link
Member

arhag commented Nov 16, 2023

The proposal needs to reference a block it builds off of. This will be be referenced by the previous field in the block header. Other essential information to include in the proposal:

  • last_qc_block_height: The block height of the most recent ancestor block that has a QC.
  • is_last_qc_strong: This is a boolean that determines if the QC justification for the block referenced by last QC block height is strong or weak.

For now, we will not have all necessary information since the block header will not have a header extension (that is covered by #1911). So to make progress with this issue, use the following values:

  • last_qc_block_height: For now, assume this is the height of the previous block. No need yet for validated that you have a QC for it since there is no QC in the block extension (that is covered by a later issue).
  • is_last_qc_strong: For now, always assume it is strong.

The qc_chain will eventually need to be replaced with something like the fork database which evolves the block header state based on block header. The block header state will have to track the core information; this core information is represented by a block_header_state_core data structure which is associated with each block:

  • last_final_block_height: This is the block height of the last irreversible (final) block.
  • final_on_strong_qc_block_height: This is the block height of the block that would become irreversible if the associated block header was to achieve a strong QC.
  • last_qc_block_height: This is the same as the last QC block height extract from the associated block.

Implement a state transition for the block_header_state_core. The transition will require as input last_qc_block_height and is_last_qc_strong and works as follows:

  1. If input last_qc_block_height is the same as the old last_qc_block_height then the new block_header_state_core should be the same as the old one, and there is no need to consider the items below.
  2. New last_qc_block_height is always the input last_qc_block_height.
  3. If is_last_qc_strong == true, then the new final_on_strong_qc_block_height is the old last_qc_block_height assuming it was present. Otherwise, the new final_on_strong_qc_block_height should not be present.
  4. If is_last_qc_strong == true, then the new last_final_block_height is the old final_on_strong_qc_block_height assuming it was present. Otherwise, the new last_final_block_height is the same as the old last_final_block_height.
@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Nov 16, 2023
@arhag arhag added 👍 lgtm and removed triage labels Nov 16, 2023
@arhag arhag assigned heifner and linh2931 and unassigned heifner Nov 16, 2023
@BenjaminGormanPMP BenjaminGormanPMP moved this from Todo to In Progress in Team Backlog Nov 20, 2023
@arhag arhag linked a pull request Nov 27, 2023 that will close this issue
@arhag arhag changed the title IF: Unification: Modify qc_chain to support core of new algorithm IF: Unification: Implement block_header_state_core and new algorithm to support transitions of that core Nov 30, 2023
@arhag arhag closed this as completed Nov 30, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Team Backlog Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants