-
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
Add support for changing the content of the finalizer safety info (fsi) file and loading older versions #492
Conversation
@@ -36,7 +36,8 @@ namespace eosio::chain { | |||
block_ref last_vote; | |||
block_ref lock; | |||
|
|||
static constexpr uint64_t magic = 0x5AFE11115AFE1111ull; | |||
static constexpr uint64_t magic_unversioned = 0x5AFE11115AFE1111ull; |
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 don't see any need to have the extra complexity of supporting the un-versioned file.
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.
Why not since people already have unversioned files? And it just a couple lines.
@@ -305,4 +323,16 @@ void my_finalizers_t::set_default_safety_information(const fsi_t& fsi) { | |||
default_fsi = fsi; | |||
} | |||
|
|||
bool my_finalizers_t::are_equivalent(uint32_t version, const fsi_map& old, const fsi_map& current) { | |||
assert(version < current_safety_file_version); // this function compares an older version with the current one | |||
switch(version) { |
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.
Why do we need version
, as it is hardcoded to 0
anyway?
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.
Why do we need
version
, as it is hardcoded to0
anyway?
Where is it hardcoded to zero? It can take all values less than current_safety_file_version
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 meant the case 0:
. OK, currently current_safety_file_version
is 1.
Note:start |
Resolves #463.
This adds a version number to the fsi file, while still allowing to load the old file format.
It also adds a testing infrastructure which verifies that all older file versions (currently there is only one) can successfuly be loaded.