-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
…e_directories such that local headers can be included using <>; use #include <finality_test_cluster.hpp> in block_state_tests.cpp
unittests/block_state_tests.cpp
Outdated
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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.
unittests/block_state_tests.cpp
Outdated
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Note:start |
SHiP
finality_data
should only include the finalizer policy when it goes from proposed to pending. This PR renames the existing fieldfinality_data_t::proposed_finalizer_policy
tofinality_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 pendingAdds 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