Skip to content

Commit

Permalink
perf: more caching friendly with sorted storage keys
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Aug 23, 2024
1 parent 6807a71 commit ef5fd3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/executor/host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -121,10 +122,11 @@ impl<T: Transport + Clone, P: Provider<T> + Clone> HostExecutor<T, P> {
);

// 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);
}
Expand Down

0 comments on commit ef5fd3c

Please sign in to comment.