-
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
IF: Use finalizer diffs in instant_finality_extension #118
Conversation
…ad of a full list of finalizers
Note:start |
I think |
This comment was marked as resolved.
This comment was marked as resolved.
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.
I started to wonder if it is worthy the trouble (time to diff and apply_diff, and more code) to pack diff only in the extension. Another side effect is one cannot just look at the extension to see the finalizers; previous extensions need to be checked.
libraries/chain/include/eosio/chain/finality/finalizer_policy.hpp
Outdated
Show resolved
Hide resolved
|
||
namespace eosio::chain { | ||
|
||
static_assert(std::numeric_limits<uint16_t>::max() <= config::max_finalizers); |
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.
should be static_assert(config::max_finalizers <= std::numeric_limits<uint16_t>::max() + 1)
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.
Yes, already had that in my changes for the next PR. Note you can't use max() + 1
because that overflows. So max_finalizers - 1
.
unittests/finalizer_update_tests.cpp
Outdated
@@ -71,6 +71,18 @@ BOOST_AUTO_TEST_CASE(savanna_set_finalizer_multiple_test) { try { | |||
size_t num_keys = 50u; | |||
size_t finset_size = 21u; | |||
|
|||
auto verify_block_finality_generation = [](const signed_block_ptr& block, uint32_t gen, const bls_public_key& key) { |
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.
Good check!
No big deal, but I think this is a more accurate name.
auto verify_block_finality_generation = [](const signed_block_ptr& block, uint32_t gen, const bls_public_key& key) { | |
auto verify_block_finality_policy_diff = [](const signed_block_ptr& block, uint32_t gen, const bls_public_key& key) { |
Instead of placing the entire finalizer set in the
instant_finality_extension
, only put a diff of the active finalizer policy in the extension.