From 7d5225f8be88ddebea6a0798e2147a01fadaa96b Mon Sep 17 00:00:00 2001 From: rakita Date: Mon, 29 Sep 2025 15:58:07 +0200 Subject: [PATCH 1/2] fix(revme): Insert block hashes in State --- bins/revme/src/cmd/blockchaintest.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bins/revme/src/cmd/blockchaintest.rs b/bins/revme/src/cmd/blockchaintest.rs index cba7267361..d7f06c20fe 100644 --- a/bins/revme/src/cmd/blockchaintest.rs +++ b/bins/revme/src/cmd/blockchaintest.rs @@ -673,6 +673,11 @@ fn execute_blockchain_test( state.insert_account_with_storage(address, account_info, account.storage); } + // insert genesis hash + state + .block_hashes + .insert(0, test_case.genesis_block_header.hash); + // Setup configuration based on fork let spec_id = fork_to_spec_id(test_case.network); let mut cfg = CfgEnv::default(); @@ -916,6 +921,11 @@ fn execute_blockchain_test( spec_id, ); + // insert present block hash. + state + .block_hashes + .insert(block_env.number.to::(), block_hash.unwrap()); + parent_block_hash = block_hash; if let Some(excess_blob_gas) = this_excess_blob_gas { parent_excess_blob_gas = excess_blob_gas; From b77040a667e13b59e186aa1c2ad1cac107d8daa8 Mon Sep 17 00:00:00 2001 From: rakita Date: Mon, 29 Sep 2025 18:02:49 +0200 Subject: [PATCH 2/2] unwrap_or_default --- bins/revme/src/cmd/blockchaintest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bins/revme/src/cmd/blockchaintest.rs b/bins/revme/src/cmd/blockchaintest.rs index d7f06c20fe..9a5d52b747 100644 --- a/bins/revme/src/cmd/blockchaintest.rs +++ b/bins/revme/src/cmd/blockchaintest.rs @@ -924,7 +924,7 @@ fn execute_blockchain_test( // insert present block hash. state .block_hashes - .insert(block_env.number.to::(), block_hash.unwrap()); + .insert(block_env.number.to::(), block_hash.unwrap_or_default()); parent_block_hash = block_hash; if let Some(excess_blob_gas) = this_excess_blob_gas {