You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new struct proposed_finalizer_policy that is identical to the current finalizer_policy except that it does not have the generation number in it.
There should not be any way to calculate a digest of proposed_finalizer_policy. Only finalizer_policy should have a member function digest to calculate the digest of the finalizer policy which includes the generation number.
A finalizer_policy can be constructed from a proposed_finalizer_policy and the generation number to use in the constructed finalizer_policy.
Diff calculation is only necessary from a finalizer_policy to a finalizer_policy.
transaction_context::set_proposed_finalizers should take a proposed_finalizer_policy as a parameter.
The changes in #292 will have changed block_header_state::finalizer_policies to block_header_state::proposed_finalizer_policies which will now only include proposed finalizer policies. But with the changes in this PR, the type of that field can further be changed to:
Now when we promote a proposed finalizer policy to pending, we set its generation number to 1 plus the generation number of the prior active finalizer_policy (which may have just become active within the same next function). When this promotion happens, we include the diff between these two policies in the block header.
Additionally, for the block in which the proposed finalizer policy gets promoted to pending (the one that includes a diff), we should include the new pending finalizer policy in the SHiP finality_data_t associated to that block. That means renaming the existing field finality_data_t::proposed_finalizer_policy to finality_data_t::pending_finalizer_policy (but keeping the same type std::optional<finalizer_policy>) to capture the semantic change.
The text was updated successfully, but these errors were encountered:
Depends on #292.
Add a new struct
proposed_finalizer_policy
that is identical to the currentfinalizer_policy
except that it does not have thegeneration
number in it.There should not be any way to calculate a digest of
proposed_finalizer_policy
. Onlyfinalizer_policy
should have a member functiondigest
to calculate the digest of the finalizer policy which includes thegeneration
number.A
finalizer_policy
can be constructed from aproposed_finalizer_policy
and the generation number to use in the constructedfinalizer_policy
.Diff calculation is only necessary from a
finalizer_policy
to afinalizer_policy
.transaction_context::set_proposed_finalizers
should take aproposed_finalizer_policy
as a parameter.The changes in #292 will have changed
block_header_state::finalizer_policies
toblock_header_state::proposed_finalizer_policies
which will now only include proposed finalizer policies. But with the changes in this PR, the type of that field can further be changed to:Now when we promote a proposed finalizer policy to pending, we set its generation number to 1 plus the generation number of the prior active
finalizer_policy
(which may have just become active within the samenext
function). When this promotion happens, we include the diff between these two policies in the block header.Additionally, for the block in which the proposed finalizer policy gets promoted to pending (the one that includes a diff), we should include the new pending finalizer policy in the SHiP
finality_data_t
associated to that block. That means renaming the existing fieldfinality_data_t::proposed_finalizer_policy
tofinality_data_t::pending_finalizer_policy
(but keeping the same typestd::optional<finalizer_policy>
) to capture the semantic change.The text was updated successfully, but these errors were encountered: