diff --git a/crates/revm/src/db/states/account_status.rs b/crates/revm/src/db/states/account_status.rs index d077caf0d0..aaf0b5b48e 100644 --- a/crates/revm/src/db/states/account_status.rs +++ b/crates/revm/src/db/states/account_status.rs @@ -167,6 +167,8 @@ impl AccountStatus { /// Returns the next account status on selfdestruct. pub fn on_selfdestructed(&self) -> AccountStatus { match self { + // Non existing account can't be destroyed. + AccountStatus::LoadedNotExisting => AccountStatus::LoadedNotExisting, // If account is created and selfdestructed in the same block, mark it as destroyed again. // Note: there is no big difference between Destroyed and DestroyedAgain in this case, // but was added for clarity. diff --git a/crates/revm/src/db/states/cache_account.rs b/crates/revm/src/db/states/cache_account.rs index 2d6232766c..126ce2ffe7 100644 --- a/crates/revm/src/db/states/cache_account.rs +++ b/crates/revm/src/db/states/cache_account.rs @@ -179,8 +179,6 @@ impl CacheAccount { self.status = self.status.on_selfdestructed(); if previous_status == AccountStatus::LoadedNotExisting { - // transitions for account loaded as not existing. - self.status = AccountStatus::LoadedNotExisting; None } else { Some(TransitionAccount {