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: Implement finalizer policy change at appropriate time #19

Merged
merged 21 commits into from
Apr 18, 2024
Merged

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Apr 10, 2024

Resolves #1618.

This initial implementation requires two 3-chains for a new finalizer_policy to become active.

This updates the finalizer_policies flat_map to store a state [proposed, pending] and a finalizer_policy associated to a block_number:

block_num => state, finalizer_policy

When state == proposed, the block_num identifies the block in which the new policy was proposed via set_finalizers.
when that block becomes final, according to the block_header_state's finality_core,

  1. the policy becomes pending
  2. its key block_num, in the proposer_policies map, is the current block

When this current block itself becomes final, the policy becomes active.

@greg7mdp greg7mdp changed the base branch from main to savanna April 10, 2024 19:25
@greg7mdp greg7mdp changed the title Gh 1618 IF: Implement finalizer policy change at appropriate time Apr 10, 2024
libraries/chain/block_header_state.cpp Outdated Show resolved Hide resolved
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: INTERNALS
summary: Improve logic for activation of finalization policy. Now it activates the finalizer policy only after critical blocks become final.
Note:end

unittests/api_tests.cpp Outdated Show resolved Hide resolved
@greg7mdp greg7mdp removed the request for review from linh2931 April 18, 2024 04:27
@greg7mdp greg7mdp requested a review from linh2931 April 18, 2024 04:27
@greg7mdp greg7mdp merged commit 3a80e26 into savanna Apr 18, 2024
36 checks passed
@greg7mdp greg7mdp deleted the gh_1618 branch April 18, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IF: Implement finalizer policy change at appropriate time
4 participants