diff --git a/crates/fbal/Cargo.toml b/crates/fbal/Cargo.toml index a5791625..bc1f4cda 100644 --- a/crates/fbal/Cargo.toml +++ b/crates/fbal/Cargo.toml @@ -14,19 +14,19 @@ workspace = true [dependencies] alloy-primitives.workspace = true alloy-eip7928 = {workspace = true, features = ["serde", "rlp"]} -reth-evm.workspace = true -reth-optimism-evm.workspace = true -reth-optimism-chainspec.workspace = true -alloy-consensus.workspace = true alloy-rlp = {workspace = true, features = ["derive"]} -alloy-sol-macro = { workspace = true, features = ["json"] } -alloy-sol-types.workspace = true -alloy-contract.workspace = true revm.workspace = true -op-revm.workspace = true serde.workspace = true -serde_json.workspace = true [dev-dependencies] +alloy-consensus.workspace = true +alloy-contract.workspace = true +alloy-sol-macro = { workspace = true, features = ["json"] } +alloy-sol-types.workspace = true +op-revm.workspace = true +reth-evm.workspace = true +reth-optimism-chainspec.workspace = true +reth-optimism-evm.workspace = true +serde_json.workspace = true diff --git a/crates/fbal/src/inspector.rs b/crates/fbal/src/inspector.rs index 99a0ed0a..25bc16d5 100644 --- a/crates/fbal/src/inspector.rs +++ b/crates/fbal/src/inspector.rs @@ -1,19 +1,19 @@ -use alloy_eip7928::{AccountChanges, BalanceChange, CodeChange, NonceChange}; -use alloy_primitives::{Address, FixedBytes, U256, map::foldhash::HashMap}; +use alloy_primitives::{Address, FixedBytes, map::foldhash::HashMap}; use revm::{ Inspector, bytecode::opcode, - context::{ContextTr, JournalTr, Transaction}, + context::ContextTr, inspector::JournalExt, interpreter::{ CallInputs, CallOutcome, CreateInputs, CreateOutcome, Interpreter, interpreter_types::{InputsTr, Jumps}, }, - primitives::StorageKey, }; +/// Inspector that tracks all accounts and storage slots touched during execution. #[derive(Debug, Default)] pub struct TouchedAccountsInspector { + /// Map of touched accounts to the storage slots accessed. pub touched_accounts: HashMap>>, // pub account_changes: HashMap, } diff --git a/crates/fbal/src/types.rs b/crates/fbal/src/types.rs index 84c29621..ee1be057 100644 --- a/crates/fbal/src/types.rs +++ b/crates/fbal/src/types.rs @@ -33,7 +33,7 @@ impl FlashblockAccessList { } } - if (!found) { + if !found { self.account_changes.push(new.clone()); } } diff --git a/crates/fbal/tests/builder.rs b/crates/fbal/tests/builder.rs index 0b3a6b59..7fb94a49 100644 --- a/crates/fbal/tests/builder.rs +++ b/crates/fbal/tests/builder.rs @@ -11,16 +11,14 @@ use alloy_primitives::{Address, B256, TxKind, U256}; use alloy_sol_macro::sol; use alloy_sol_types::SolCall; use base_fbal::{FlashblockAccessList, TouchedAccountsInspector}; -use op_revm::{DefaultOp, OpBuilder, OpContext, OpSpecId, OpTransaction}; +use op_revm::OpTransaction; use reth_evm::{ConfigureEvm, Evm}; -use reth_optimism_chainspec::{BASE_MAINNET, OpChainSpec}; -use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes}; +use reth_optimism_chainspec::OpChainSpec; +use reth_optimism_evm::OpEvmConfig; use revm::{ - Context, DatabaseCommit, DatabaseRef, ExecuteCommitEvm, ExecuteEvm, InspectEvm, MainBuilder, - MainContext, - context::{CfgEnv, ContextTr, TxEnv, result::ResultAndState, tx::TxEnvBuilder}, + DatabaseCommit, DatabaseRef, + context::{TxEnv, result::ResultAndState}, database::InMemoryDB, - inspector::JournalExt, interpreter::instructions::utility::IntoAddress, primitives::{KECCAK_EMPTY, ONE_ETHER}, state::{AccountInfo, Bytecode},