From ab2fc7e17a22ca87b9af37ae0bf6da24fb34f6b5 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 5 Jul 2023 12:32:28 +0200 Subject: [PATCH] fix: use DatabaseRef impl when fetching overriden account (#3589) Co-authored-by: Roman Krasiuk --- crates/rpc/rpc/src/eth/revm_utils.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/rpc/rpc/src/eth/revm_utils.rs b/crates/rpc/rpc/src/eth/revm_utils.rs index cd552b398a..fbfe93e53a 100644 --- a/crates/rpc/rpc/src/eth/revm_utils.rs +++ b/crates/rpc/rpc/src/eth/revm_utils.rs @@ -459,7 +459,9 @@ where DB: DatabaseRef, EthApiError: From<::Error>, { - let mut account_info = db.basic(account)?.unwrap_or_default(); + // we need to fetch the account via the `DatabaseRef` to not update the state of the account, + // which is modified via `Database::basic` + let mut account_info = DatabaseRef::basic(db, account)?.unwrap_or_default(); if let Some(nonce) = account_override.nonce { account_info.nonce = nonce.as_u64();