-
Notifications
You must be signed in to change notification settings - Fork 72
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: Update finalizer safety information and rules for how a finalizer signs #2135
Conversation
Minor cleanups.
…le_block` In that case use `lib` block number and specify `weak`.
}; | ||
|
||
// ---------------------------------------------------------------------------------------- | ||
struct my_finalizers_t { |
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 thought this name again. It seems my_fianlizers
is more accurate, as we are talking about the finalizers on the local node. In configuration instructions to BPs, local finalizer sounds more natural than my finalizers. my
implies something at implementation level like a class or a file. @heifner @arhag ?
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.
This is a class name at the implementation level.
… for strong vote.
@@ -453,6 +454,7 @@ BOOST_AUTO_TEST_CASE(delayed_strong_weak_lost_vote) { try { | |||
|
|||
BOOST_REQUIRE(cluster.produce_blocks_and_verify_lib_advancing()); | |||
} FC_LOG_AND_RETHROW() } | |||
#endif |
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 believe in Boost unit tests, when safety file is the default, those simulated weak vote tests should have passed. Should come back to revisit those later.
resolves #2070.
This PR implements support for managing a set of stateful finalizers (the local finalizers that this node is running).
It is important that the safety information for each finalizer (last vote and proposal lock) is preserved across nodeos invocations, since incorrect voting can lead to finality violations.
The safety information for all finalizers is saved in a file named
safety.dat
, which is by default located in{data_dir}/finalizers
. This file preserves the safety information for not only the currently running finalizers, but for all thefinalizers who ever ran on this node with the same specified safety file location.The currently running finalizers are always the first ones stored in the file, followed by all the inactive ones. After each vote, only the information for the currently running finalizers is written to the file, which is then flushed. This file update occurs before the vote is propagated.
The way the finalizer safety information is initialized (if not found in the persistent
safety.dat
file) is important, and described here. The initial configuration must be such that it will prevent safety violations, while still allowing liveness to eventually happen, so the finalizer can vote.This specification may yet evolve, as the document is not 100% completed.
This PR also includes some other misceallenous changes:
fc/crypto
bls primitives to takestd::span
instead ofstd::vector
, so we don't have to do unnecessary copies.digest_type
, a custom typeweak_digest_t
was defined.tester.cpp
into a new filebls_utils.hpp
, so that they can be reused in boost tests.