-
Notifications
You must be signed in to change notification settings - Fork 689
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
fix: create FlatStorageState inside RuntimeAdapter #7710
Conversation
Could you explain this a bit? |
It's not the case. Flat storage is an independent structure, It is done so because flat storage can be modified outside of |
@@ -629,13 +629,11 @@ impl Chain { | |||
// set up flat storage | |||
#[cfg(feature = "protocol_feature_flat_state")] | |||
for shard_id in 0..runtime_adapter.num_shards(&block_head.epoch_id)? { | |||
let flat_storage_state = FlatStorageState::new( | |||
store.store().clone(), | |||
runtime_adapter.create_flat_storage_state_for_shard( |
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.
Maybe remove the feature flag here and add another implementation of create_flat_storage_state_for_shard when the feature is not enabled? I think this creates less code that's gated by the feature.
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.
It doesn't help much, because ChainAccessForFlatStorage
needs to be gated.
We create FlatStorageState on Chain creation, but it currently happens for any RuntimeAdapter impl. Because KeyValueRuntime doesn't and shouldn't support flat storage, it leads to tests failures. Here we move FSS creation inside RuntimeAdapter impl. ## Testing https://buildkite.com/nearprotocol/nearcore-flat-state/builds/60#018383c5-7838-4e5b-86f1-da2baa381789 - number of failing tests drops from 77 to 4 - which are failing due to other reasons
We create FlatStorageState on Chain creation, but it currently happens for any RuntimeAdapter impl. Because KeyValueRuntime doesn't and shouldn't support flat storage, it leads to tests failures. Here we move FSS creation inside RuntimeAdapter impl. ## Testing https://buildkite.com/nearprotocol/nearcore-flat-state/builds/60#018383c5-7838-4e5b-86f1-da2baa381789 - number of failing tests drops from 77 to 4 - which are failing due to other reasons
We create FlatStorageState on Chain creation, but it currently happens for any RuntimeAdapter impl. Because KeyValueRuntime doesn't and shouldn't support flat storage, it leads to tests failures.
Here we move FSS creation inside RuntimeAdapter impl.
Testing
https://buildkite.com/nearprotocol/nearcore-flat-state/builds/60#018383c5-7838-4e5b-86f1-da2baa381789 - number of failing tests drops from 77 to 4 - which are failing due to other reasons