-
Notifications
You must be signed in to change notification settings - Fork 33
SC: Introduce chain_config_v2 and snapshot_v9 for max_sync_call_depth and max_sync_call_data_size #1257
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
Conversation
|
It looks like ship's ABI needs to have I think snapshot version should be increased to v9 too due to |
Thanks! Yes, snapshot version needs to be increased to v9. I will change ship and snapshot for now and create an issue for abieos so we won't forget. |
|
I noticed this will probably need to be changed to use chain_config_v1 spring/libraries/chain/include/eosio/chain/global_property_object.hpp Lines 59 to 73 in b929322
I'm guessing we're also going to need to create a |
V9 snapshot: 35cee9e |
Thanks. Done in the snapshot commit aa28ece. It seems the version numbers for Legacy snapshot_global_property_object grows sequentially. I named it |
…sync_call_data_size <= MAX_SIZE_OF_BYTE_ARRAYS
SHiP ABI update: 2ffd898 |
|
|
||
| friend inline bool operator != ( const chain_config_v2& lhs, const chain_config_v2& rhs ) { | ||
| return !(lhs == rhs); | ||
| } |
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.
operator!= should not be needed with c++20.
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.
operator!=should not be needed with c++20.
No need to define operator ==() either when = default; is the same thing.
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.
Thanks. Removed.
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.
Don't we need the = default still? I think this will skip equality check of v2 members as is
|
btw I realize now that AntelopeIO/leap#1770 introduces an inconsistency. The premise is that we shouldn't return I'm not sure what the right answer is.. we could potentially scrub the |
|
Also need to update this part of ship, spring/libraries/state_history/include/eosio/state_history/serialization.hpp Lines 332 to 333 in 2ffd898
|
…explicit copy_from_v0 function
| context.db.modify( context.control.get_global_properties(), | ||
| [&]( auto& gprops ) { | ||
| gprops.configuration = cfg; | ||
| gprops.configuration.copy_from_v0(cfg); |
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 you need an assignment operator from v0 that leaves v1 and v2 data alone?
This might be why. Does this change technically cause a consensus violation? The old code would leave max_action_return_value_size unchanged but this code will reset it to config::default_max_action_return_value_size. (I don't see any reason one can't call set_blockchain_parameters_packed() after activating ACTION_RETURN_VALUE)
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 catch! Will revert.
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 think you need to entirely revert but rather copy_from_v0() shouldn't stomp on v1 & v2 items.
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 think you need to entirely revert
(pending the style question in the other thread)
…ts of v1 fields with assignment operator
Thanks. Done. |
This part needs to be changed to 2,
(it's manually encoding the variant index). |
| // copy v0 fields | ||
| chain_config_v0::operator= (b); | ||
|
|
||
| // leave v1 and v2 fields alone as changing them might break cosensus |
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.
"consensus"
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 by 30d934c
I created #1289 to track this. |
| auto genesis = eosio::chain::block_log::extract_genesis_state(source_log_dir); | ||
| std::filesystem::create_directories(config.blocks_dir); | ||
| std::filesystem::copy(source_log_dir / "blocks.log", config.blocks_dir / "blocks.log"); | ||
| std::filesystem::copy(source_log_dir / "blocks.index", config.blocks_dir / "blocks.index"); |
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.
The abieos submodule update should be via a PR to abieos. I don't see one.
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.
As the changes were small and I'd to have a quick test, I went ahead making the abieos changes in the sync_call branch. I will make sure all the future changes will be done from a branch created out of the sync_call branch.
heifner
left a comment
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.
Make sure to update to merged abieos commit.
This PR introduces a new version of chain_config
chain_config_v2for sync call parameters:max_sync_call_depthandmax_sync_call_data_size. They are on chain parameters and require BP agreement for changes.A new version of snapshot (
snapshot_v9) is required to accommodatechain_config_v2.abieosneeds to be updated AntelopeIO/abieos#39Tests have been updated to verify the new parameters can be read and set.
Resolves #1256