Skip to content

Conversation

@shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Dec 23, 2025

// 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.
if account.was_destroyed() && !spec.is_enabled_in(revm_primitives::hardfork::CANCUN) {

This opens the path to using caches that can't do invalidation in bulk, such as fixed-cache.

@shekhirin shekhirin requested a review from mattsse as a code owner December 23, 2025 16:27
@shekhirin shekhirin added the C-perf A change motivated by improving speed, memory usage or disk footprint label Dec 23, 2025
@shekhirin shekhirin added the A-engine Related to the engine implementation label Dec 23, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Dec 23, 2025
@shekhirin shekhirin force-pushed the alexey/execution-cache-selfdestruct branch from a7de103 to cc59318 Compare December 23, 2025 16:31
@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Dec 23, 2025
@shekhirin shekhirin added this pull request to the merge queue Dec 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 23, 2025
@shekhirin shekhirin added this pull request to the merge queue 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,
);
Copy link
Collaborator

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(
Copy link
Collaborator

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

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.
Copy link
Collaborator

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

@shekhirin shekhirin removed this pull request from the merge queue due to a manual request Dec 23, 2025
@shekhirin shekhirin marked this pull request as draft December 23, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-engine Related to the engine implementation C-perf A change motivated by improving speed, memory usage or disk footprint

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants