-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consensus parameters storage #124
Conversation
Updated to move the index to body. TODO: change the serialization method |
friend bool operator==(const BlockBody&, const BlockBody&); | ||
}; | ||
|
||
struct Block : public BlockBody { | ||
BlockHeader header; | ||
|
||
bool irreversible{false}; | ||
std::optional<eosevm::ConsensusParameters> consensus_parameters_cache; |
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.
Do we need to have this cache here?
I thought it will be local to the function that prepares the execution of the 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.
This is because we are currently only passing block around: from block_conversion_plugin to blockchain_plugin, from blockchain_plugin to the executor
It will be safer to copy and pass this piece of information with block. otherwise we will have to let executor read the new parameters from somewhere, and that will start to encounter thread safety issues.
This approach might not be ideal, Feel free to suggest other approaches.
1 Add a way to store general consensus parameters, indexed by active block number.
2 currently it holds 5 gas fee parameters and the gas price
3 may subject to changes
Should be reviewed and merged together with other related changes in node.
Resolve #121