diff --git a/crates/executor/host/src/lib.rs b/crates/executor/host/src/lib.rs index 0f982a4..dec5c37 100644 --- a/crates/executor/host/src/lib.rs +++ b/crates/executor/host/src/lib.rs @@ -3,6 +3,7 @@ use std::marker::PhantomData; use alloy_provider::Provider; use alloy_transport::Transport; use eyre::{eyre, Ok}; +use itertools::Itertools; use reth_execution_types::ExecutionOutcome; use reth_primitives::{proofs, Block, Bloom, Receipts, B256}; use revm::db::CacheDB; @@ -121,10 +122,11 @@ impl + Clone> HostExecutor { ); // For every account we touched, fetch the storage proofs for all the slots we touched. + tracing::info!("fetching modified storage proofs"); let mut dirty_storage_proofs = Vec::new(); for (address, account) in executor_outcome.bundle_accounts_iter() { let mut storage_keys = Vec::new(); - for key in account.storage.keys() { + for key in account.storage.keys().sorted() { let slot = B256::new(key.to_be_bytes()); storage_keys.push(slot); } diff --git a/crates/storage/rpc-db/src/lib.rs b/crates/storage/rpc-db/src/lib.rs index 1deec24..41f422d 100644 --- a/crates/storage/rpc-db/src/lib.rs +++ b/crates/storage/rpc-db/src/lib.rs @@ -175,10 +175,11 @@ impl + Clone> RpcDb { .into_iter() .map(|address| { // Get all of the storage keys for the address. - let storage_keys_for_address: Vec = storage + let mut storage_keys_for_address: Vec = storage .get(&address) .map(|storage_map| storage_map.keys().map(|k| (*k).into()).collect()) .unwrap_or_default(); + storage_keys_for_address.sort(); // Fetch the proof for the address + storage keys. async move {