-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
A-dbRelated to the databaseRelated to the databaseC-enhancementNew feature or requestNew feature or request
Description
Describe the feature
Right now we use a raw tx to access storage changesets:
reth/crates/storage/provider/src/providers/state/historical.rs
Lines 411 to 420 in 24fa984
| self.tx() | |
| .cursor_dup_read::<tables::StorageChangeSets>()? | |
| .seek_by_key_subkey((changeset_block_number, address).into(), storage_key)? | |
| .filter(|entry| entry.key == storage_key) | |
| .ok_or_else(|| ProviderError::StorageChangesetNotFound { | |
| block_number: changeset_block_number, | |
| address, | |
| storage_key: Box::new(storage_key), | |
| })? | |
| .value, |
We should create trait methods and use them wherever we fetch storage changesets with a tx, like we did for account changesets:
reth/crates/storage/provider/src/providers/state/historical.rs
Lines 252 to 259 in 24fa984
| // Use ChangeSetReader trait method to get the account from changesets | |
| self.provider | |
| .get_account_before_block(changeset_block_number, *address)? | |
| .ok_or(ProviderError::AccountChangesetNotFound { | |
| block_number: changeset_block_number, | |
| address: *address, | |
| }) | |
| .map(|account_before| account_before.info) |
ref #18983
Additional context
No response
Metadata
Metadata
Assignees
Labels
A-dbRelated to the databaseRelated to the databaseC-enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog