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

Provide finalizer policy in SHiP finality_data only when it gets promoted to pending #322

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Jun 27, 2024

SHiP finality_data should only include the finalizer policy when it goes from proposed to pending. This PR renames 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, and changes the logic to include the finalizer policy only when it goes from proposed to pending

Adds a test to check pending_finalizer_policy in finality_data.

AntelopeIO/abieos#32 is created in abieos repo for corresponding SHiP protocol changes.

Resolves #320

unittests/block_state_tests.cpp Outdated Show resolved Hide resolved
libraries/chain/block_state.cpp Outdated Show resolved Hide resolved
libraries/chain/include/eosio/chain/block_state.hpp Outdated Show resolved Hide resolved
unittests/block_state_tests.cpp Outdated Show resolved Hide resolved
…e_directories such that local headers can be included using <>; use #include <finality_test_cluster.hpp> in block_state_tests.cpp
// Produce one more block. The proposed finalizer policy is promoted to pending in this block.
// We should see pending_finalizer_policy in finality_data
produce_and_push_block();
process_votes(1, num_nodes - 1); // all non-producing nodes (staring from node1) vote
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
process_votes(1, num_nodes - 1); // all non-producing nodes (staring from node1) vote
process_votes(1, num_nodes - 1); // all non-producing nodes (starting from node1) vote

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry I missed those two. Thanks. Fixed.

// Produce another block. We should not see pending_finalizer_policy as
// no proposed finalizer policy is promoted to pending in this block
produce_and_push_block();
process_votes(1, num_nodes - 1); // all non-producing nodes (staring from node1) vote
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
process_votes(1, num_nodes - 1); // all non-producing nodes (staring from node1) vote
process_votes(1, num_nodes - 1); // all non-producing nodes (starting from node1) vote

@linh2931 linh2931 merged commit 630246a into main Jun 27, 2024
36 checks passed
@linh2931 linh2931 deleted the ship_pending_fin_pol branch June 27, 2024 18:01
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Improve accuracy of state history by selectively including finalizer policy.
Note:end

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.

Provide finalizer policy in SHiP finality_data only when it gets promoted to pending
4 participants