-
Notifications
You must be signed in to change notification settings - Fork 2.2k
perf(engine): do not invalidate accounts in cache post Cancun #20619
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
base: main
Are you sure you want to change the base?
Conversation
a7de103 to
cc59318
Compare
| let spec_id = alloy_evm::spec_by_timestamp_and_block_number( | ||
| &provider_builder.provider_factory.chain_spec(), | ||
| input.timestamp(), | ||
| input.num_hash().number, | ||
| ); |
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 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( |
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.
this needs doc updates why this needs an evm specid
| // 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. |
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.
this doesnt mention state, can we elaborate why this is okay to not invalidate state
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.