-
Notifications
You must be signed in to change notification settings - Fork 664
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
feat(client): Read snapshots for state #3092
Conversation
Make all reads from state use a read snapshot. Refactor RuntimeAdapter: methods that touch state now require creating a RuntimeStateAdapter. For now client and gc run in the same thread, so nothing should change for client. For view client it will be impossible to get storage errors if reading storage root succeeds. Test plan --------- Existing tests. Small sanity test.
fn apply_transactions_with_optional_storage_proof( | ||
/// Validate state part that expected to be given state root with provided data. | ||
/// Returns false if the resulting part doesn't match the expected one. | ||
fn validate_state_part( |
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 is this part of RuntimeAdapter
but not RuntimeStateAdapter
?
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.
doesn't need state to validate
/// 3. Store does not use snapshots, so data can disappear between reads. | ||
store: Store, |
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 is this safe?
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.
Not really safe, but maybe not terrible. Need to review all storage uses
|
||
pub struct RocksDBOwningSnapshot { | ||
db: Pin<Arc<RocksDB>>, | ||
snapshot: Snapshot<'static>, |
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 do this instead of having a lifetime parameter?
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.
just to do less refactoring
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.
@SkidanovAlex should we put this on hold?
Please, revisit this PR and merge, close, or convert into a draft, so it is easier to see which PRs awaiting reviews. |
Make all reads from state use a read snapshot.
Refactor RuntimeAdapter: methods that touch state now require creating a
RuntimeStateAdapter.
For now client and gc run in the same thread, so nothing should change
for client. For view client it will be impossible to get storage errors
if reading storage root succeeds.
Test plan
Existing tests.
Small sanity test.