perf(engine): do not invalidate accounts in cache post Cancun#20619
Closed
perf(engine): do not invalidate accounts in cache post Cancun#20619
Conversation
a7de103 to
cc59318
Compare
klkvr
approved these changes
Dec 23, 2025
mediocregopher
approved these changes
Dec 23, 2025
mattsse
reviewed
Dec 23, 2025
Comment on lines
+397
to
+401
| let spec_id = alloy_evm::spec_by_timestamp_and_block_number( | ||
| &provider_builder.provider_factory.chain_spec(), | ||
| input.timestamp(), | ||
| input.num_hash().number, | ||
| ); |
Collaborator
There was a problem hiding this comment.
not really a fan of is this because this is super eth specific
but this should work as long as everyone implements the eth fork activations correctly
| /// Returns an error if the state updates are inconsistent and should be discarded. | ||
| #[instrument(level = "debug", target = "engine::caching", skip_all)] | ||
| pub(crate) fn insert_state(&self, state_updates: &BundleState) -> Result<(), ()> { | ||
| pub(crate) fn insert_state( |
Collaborator
There was a problem hiding this comment.
this needs doc updates why this needs an evm specid
Comment on lines
+476
to
+479
| // Post-cancun when EIP-6780 is live, an account can be destroyed only when it's created | ||
| // in the same transaction. This guarantees that we will not have such accounts | ||
| // and storage slots in our cache, because Revm doesn't go through the | ||
| // Database for freshly created accounts. Hence we can safely ignore invalidating them. |
Collaborator
There was a problem hiding this comment.
this doesnt mention state, can we elaborate why this is okay to not invalidate state
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
reth/crates/engine/tree/src/tree/cached_state.rs
Lines 476 to 480 in 0585c84
This opens the path to using caches that can't do invalidation in bulk, such as fixed-cache.