-
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
Use 2-chain for finality #389
Conversation
…sts for number of chains required for a block to become final
…new_finality_digest
Note:start |
unittests/finality_tests.cpp
Outdated
// ------------------------------------------------------------------------------- | ||
for (size_t i=0; i<3; ++i) { | ||
for (size_t i=0; i<(num_chains_to_final - 1); ++i) { |
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.
If we need a 2-chain, why num_chains_to_final - 1
. Also the comment at line 733 above is incorrect, we won't have three pending policies at the same time.
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.
Fixed it by c1feb76
Thanks.
t.check_head_finalizer_policy(1u, pubkeys0); // one 3-chain - new policy still should not be active | ||
|
||
t.produce_blocks(2); | ||
t.produce_blocks(num_chains_to_final-1); | ||
t.check_head_finalizer_policy(1u, pubkeys0); // one 3-chain + 2 blocks - new policy still should not be active |
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.
comment is wrong, it should be + 1 block
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.
It's decided the comments in the remaining files to be fixed later. Tracked by #398
@@ -101,8 +101,8 @@ BOOST_AUTO_TEST_CASE(savanna_set_finalizer_multiple_test) { try { | |||
auto pubkeys2 = fin_keys.set_finalizer_policy(2u).pubkeys; | |||
t.produce_block(); | |||
t.check_head_finalizer_policy(1u, pubkeys0); // new policy should only be active until after two 3-chains |
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.
many comments in this file still mention 3-chains
. Some in other files as well.
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.
To be fixed by #398
b = t.produce_block(); // pending: pubkeys5, proposed: pubkeysr6, pubkeys7, pubkeys8, pubkeys9 | ||
verify_block_finality_policy_diff(b, 9, pubkeys9.back()); | ||
auto pubkeys10 = fin_keys.set_finalizer_policy(10u).pubkeys; | ||
t.check_head_finalizer_policy(3u, pubkeys3); // 7 blocks after pubkeys4, pubkeys4 should still be active | ||
t.check_head_finalizer_policy(5u, pubkeys5); // 7 blocks after pubkeys4, pubkeys4 should still be active |
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.
comment is clearly incorrect.
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.
To be fixed by #398
finality_core
to use two-chain for finality.get_new_block_numbers()
.Resolves #384