You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new EntityRead::read_temp methods drop the StorageError from underlying calls and always return an Option, so any I/O or deserialization failure in s.temp.read_* will be swallowed without logging. This hides temporary‐storage errors and makes debugging read failures impossible.
fnread_temp(s:&StratusStorage,key:Self::Key) -> Option<Self>;/// Reads from permanent storage at the resolved mined point.fnread_perm(s:&StratusStorage,key:Self::Key,point:MinedPointInTime<'_>) -> Result<Self,StorageError>;/// Caches the value as a latest (mined tip) entry, if not already cached.fncache_latest_if_missing(s:&StratusStorage,key:Self::Key,value:Self);}implEntityReadforAccount{typeKey = Address;fnread_temp(s:&StratusStorage,address:Address) -> Option<Self>{
tracing::debug!(storage = %label::TEMP, %address,"reading account");timed(|| s.temp.read_account(address)).with(|m| {if m.result.is_some(){
metrics::inc_storage_read_account(m.elapsed, label::TEMP,PointInTime::Pending,true);}})}
The cache decision should be based on the point-in-time rather than the full ExecutionKind so that RPC reads and call reads are handled correctly. Match on kind.point_in_time() to distinguish Pending vs Latest reads when deciding to cache.
-match (kind, found_at) {- (ExecutionKind::Transaction, _) => (),- // A pending read that hit perm (i.e. not in any cache/temp) is already mined, so cache latest.- // OR A mined read that hit perm is the latest state, so populate the latest cache.- (_, FoundAt::PermLatest) => {+match (kind.point_in_time(), found_at) {+ (PointInTime::Pending, FoundAt::PermLatest)+ | (PointInTime::Latest, FoundAt::PermLatest) => {
E::cache_latest_if_missing(self, key, value.clone());
}
- // Cache / Historical / (Mined, Temp): nothing to cache.+ _ => {}
}
Suggestion importance[1-10]: 5
__
Why: Matching on kind.point_in_time() instead of the full ExecutionKind can prevent unintended caching for historical reads, but the proposed change may not fully align with the existing Resolve logic and needs further validation.
Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Tests
Description
Introduce generic State
replacing Changes everywhereRefactor storage & cache layers to use new State API
Remove call-specific temporary storage & simplify EntityRead
Update transaction execution & EVM output to use State
Adjust tests to new State and TransactionExecutionResult
File Walkthrough
18 files
Refactor StratusStorage to use StateAdd Change trait and value wrappersUpdate TransactionExecutionOutput with State fieldSimplify Resolve logic and rename variantsPass state into save_execution callsIn-memory temp storage uses StateRocks state uses State and account updateIntroduce Stateand stage markersMiner.save_execution accepts StateSimplify cache, remove slot/account temp cacheRemove call_storage, unify temp storageRename fields to input/output with StateUse output.logs instead of result.logsMap TransactionExecutionResult fields in rocks typesFetcher returns State nowrpc_call returns CallExecutionOutputAdd is_success helper for call outputsave_block uses State instead of Changes1 files
Use State in importer tests1 files
Skip ignored accounts in RevmSession21 files