diff --git a/crates/chain-state/src/in_memory.rs b/crates/chain-state/src/in_memory.rs index 3f8fa8a5a88e..1e300539e2e4 100644 --- a/crates/chain-state/src/in_memory.rs +++ b/crates/chain-state/src/in_memory.rs @@ -1019,7 +1019,7 @@ mod tests { } impl AccountReader for MockStateProvider { - fn basic_account(&self, _address: Address) -> ProviderResult> { + fn basic_account(&self, _address: &Address) -> ProviderResult> { Ok(None) } } diff --git a/crates/chain-state/src/memory_overlay.rs b/crates/chain-state/src/memory_overlay.rs index 2f54d1f37968..7365a4b09c13 100644 --- a/crates/chain-state/src/memory_overlay.rs +++ b/crates/chain-state/src/memory_overlay.rs @@ -96,9 +96,9 @@ impl BlockHashReader for MemoryOverlayStateProviderRef<'_, N> } impl AccountReader for MemoryOverlayStateProviderRef<'_, N> { - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { for block in &self.in_memory { - if let Some(account) = block.execution_output.account(&address) { + if let Some(account) = block.execution_output.account(address) { return Ok(account); } } diff --git a/crates/consensus/common/src/validation.rs b/crates/consensus/common/src/validation.rs index 1666979b3d31..7546b4976c52 100644 --- a/crates/consensus/common/src/validation.rs +++ b/crates/consensus/common/src/validation.rs @@ -396,7 +396,7 @@ mod tests { } impl AccountReader for Provider { - fn basic_account(&self, _address: Address) -> ProviderResult> { + fn basic_account(&self, _address: &Address) -> ProviderResult> { Ok(self.account) } } diff --git a/crates/engine/tree/benches/state_root_task.rs b/crates/engine/tree/benches/state_root_task.rs index b88c8578c5db..72770e726852 100644 --- a/crates/engine/tree/benches/state_root_task.rs +++ b/crates/engine/tree/benches/state_root_task.rs @@ -119,7 +119,7 @@ fn setup_provider( // other updates let should_process = match account.status { AccountStatus::SelfDestructed => { - provider_rw.basic_account(*address).ok().flatten().is_some() + provider_rw.basic_account(address).ok().flatten().is_some() } _ => true, }; diff --git a/crates/revm/src/database.rs b/crates/revm/src/database.rs index 682aca6cf379..e8f527e58ec9 100644 --- a/crates/revm/src/database.rs +++ b/crates/revm/src/database.rs @@ -16,7 +16,7 @@ pub trait EvmStateProvider: Send + Sync { /// Get basic account information. /// /// Returns [`None`] if the account doesn't exist. - fn basic_account(&self, address: Address) -> ProviderResult>; + fn basic_account(&self, address: &Address) -> ProviderResult>; /// Get the hash of the block with the given number. Returns [`None`] if no block with this /// number exists. @@ -38,7 +38,7 @@ pub trait EvmStateProvider: Send + Sync { // Blanket implementation of EvmStateProvider for any type that implements StateProvider. impl EvmStateProvider for T { - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { ::basic_account(self, address) } @@ -141,7 +141,7 @@ impl DatabaseRef for StateProviderDatabase { /// Returns `Ok` with `Some(AccountInfo)` if the account exists, /// `None` if it doesn't, or an error if encountered. fn basic_ref(&self, address: Address) -> Result, Self::Error> { - Ok(self.basic_account(address)?.map(Into::into)) + Ok(self.basic_account(&address)?.map(Into::into)) } /// Retrieves the bytecode associated with a given code hash. diff --git a/crates/revm/src/test_utils.rs b/crates/revm/src/test_utils.rs index 7779d1ca8b07..8349750fb900 100644 --- a/crates/revm/src/test_utils.rs +++ b/crates/revm/src/test_utils.rs @@ -47,8 +47,8 @@ impl StateProviderTest { } impl AccountReader for StateProviderTest { - fn basic_account(&self, address: Address) -> ProviderResult> { - Ok(self.accounts.get(&address).map(|(_, acc)| *acc)) + fn basic_account(&self, address: &Address) -> ProviderResult> { + Ok(self.accounts.get(address).map(|(_, acc)| *acc)) } } diff --git a/crates/rpc/rpc-eth-api/src/helpers/estimate.rs b/crates/rpc/rpc-eth-api/src/helpers/estimate.rs index cdbb2b97460e..fe2fa482d54d 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/estimate.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/estimate.rs @@ -87,7 +87,7 @@ pub trait EstimateCall: Call { // Optimize for simple transfer transactions, potentially reducing the gas estimate. if env.tx.data.is_empty() { if let TransactTo::Call(to) = env.tx.transact_to { - if let Ok(code) = db.db.account_code(to) { + if let Ok(code) = db.db.account_code(&to) { let no_code_callee = code.map(|code| code.is_empty()).unwrap_or(true); if no_code_callee { // If the tx is a simple transfer (call to an account with no code) we can diff --git a/crates/rpc/rpc-eth-api/src/helpers/state.rs b/crates/rpc/rpc-eth-api/src/helpers/state.rs index 9173b5e3460d..fe068ec4d1e6 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/state.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/state.rs @@ -53,7 +53,7 @@ pub trait EthState: LoadState + SpawnBlocking { self.spawn_blocking_io(move |this| { Ok(this .state_at_block_id_or_latest(block_id)? - .account_balance(address) + .account_balance(&address) .map_err(Self::Error::from_eth_err)? .unwrap_or_default()) }) @@ -131,7 +131,7 @@ pub trait EthState: LoadState + SpawnBlocking { ) -> impl Future, Self::Error>> + Send { self.spawn_blocking_io(move |this| { let state = this.state_at_block_id(block_id)?; - let account = state.basic_account(address).map_err(Self::Error::from_eth_err)?; + let account = state.basic_account(&address).map_err(Self::Error::from_eth_err)?; let Some(account) = account else { return Ok(None) }; // Check whether the distance to the block exceeds the maximum configured proof window. @@ -252,7 +252,7 @@ pub trait LoadState: // first fetch the on chain nonce of the account let on_chain_account_nonce = this .latest_state()? - .account_nonce(address) + .account_nonce(&address) .map_err(Self::Error::from_eth_err)? .unwrap_or_default(); @@ -290,7 +290,7 @@ pub trait LoadState: // first fetch the on chain nonce of the account let on_chain_account_nonce = this .state_at_block_id_or_latest(block_id)? - .account_nonce(address) + .account_nonce(&address) .map_err(Self::Error::from_eth_err)? .unwrap_or_default(); @@ -333,7 +333,7 @@ pub trait LoadState: self.spawn_blocking_io(move |this| { Ok(this .state_at_block_id_or_latest(block_id)? - .account_code(address) + .account_code(&address) .map_err(Self::Error::from_eth_err)? .unwrap_or_default() .original_bytes()) diff --git a/crates/rpc/rpc-eth-types/src/cache/db.rs b/crates/rpc/rpc-eth-types/src/cache/db.rs index bea496166580..80d1114f530c 100644 --- a/crates/rpc/rpc-eth-types/src/cache/db.rs +++ b/crates/rpc/rpc-eth-types/src/cache/db.rs @@ -106,7 +106,7 @@ impl reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'_> { impl reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'_> { fn basic_account( &self, - address: revm_primitives::Address, + address: &revm_primitives::Address, ) -> reth_errors::ProviderResult> { self.0.basic_account(address) } @@ -163,21 +163,21 @@ impl StateProvider for StateProviderTraitObjWrapper<'_> { fn account_code( &self, - addr: revm_primitives::Address, + addr: &revm_primitives::Address, ) -> reth_errors::ProviderResult> { self.0.account_code(addr) } fn account_balance( &self, - addr: revm_primitives::Address, + addr: &revm_primitives::Address, ) -> reth_errors::ProviderResult> { self.0.account_balance(addr) } fn account_nonce( &self, - addr: revm_primitives::Address, + addr: &revm_primitives::Address, ) -> reth_errors::ProviderResult> { self.0.account_nonce(addr) } diff --git a/crates/rpc/rpc/src/reth.rs b/crates/rpc/rpc/src/reth.rs index c33f97f5301d..dbd6398465f0 100644 --- a/crates/rpc/rpc/src/reth.rs +++ b/crates/rpc/rpc/src/reth.rs @@ -73,7 +73,7 @@ where let hash_map = accounts_before.iter().try_fold( HashMap::default(), |mut hash_map, account_before| -> RethResult<_> { - let current_balance = state.account_balance(account_before.address)?; + let current_balance = state.account_balance(&account_before.address)?; let prev_balance = account_before.info.map(|info| info.balance); if current_balance != prev_balance { hash_map.insert(account_before.address, current_balance.unwrap_or_default()); diff --git a/crates/stages/stages/src/stages/execution.rs b/crates/stages/stages/src/stages/execution.rs index e2d2addf7d74..65f91d25c06f 100644 --- a/crates/stages/stages/src/stages/execution.rs +++ b/crates/stages/stages/src/stages/execution.rs @@ -939,17 +939,17 @@ mod tests { // assert accounts assert_eq!( - provider.basic_account(account1), + provider.basic_account(&account1), Ok(Some(account1_info)), "Post changed of a account" ); assert_eq!( - provider.basic_account(account2), + provider.basic_account(&account2), Ok(Some(account2_info)), "Post changed of a account" ); assert_eq!( - provider.basic_account(account3), + provider.basic_account(&account3), Ok(Some(account3_info)), "Post changed of a account" ); @@ -1075,19 +1075,19 @@ mod tests { // assert unwind stage assert_eq!( - provider.basic_account(acc1), + provider.basic_account(&acc1), Ok(Some(acc1_info)), "Pre changed of a account" ); assert_eq!( - provider.basic_account(acc2), + provider.basic_account(&acc2), Ok(Some(acc2_info)), "Post changed of a account" ); let miner_acc = address!("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"); assert_eq!( - provider.basic_account(miner_acc), + provider.basic_account(&miner_acc), Ok(None), "Third account should be unwound" ); @@ -1173,7 +1173,7 @@ mod tests { // assert unwind stage let provider = test_db.factory.database_provider_rw().unwrap(); - assert_eq!(provider.basic_account(destroyed_address), Ok(None), "Account was destroyed"); + assert_eq!(provider.basic_account(&destroyed_address), Ok(None), "Account was destroyed"); assert_eq!( provider.tx_ref().get::(destroyed_address), diff --git a/crates/storage/provider/src/providers/blockchain_provider.rs b/crates/storage/provider/src/providers/blockchain_provider.rs index fbf485826528..16657952111e 100644 --- a/crates/storage/provider/src/providers/blockchain_provider.rs +++ b/crates/storage/provider/src/providers/blockchain_provider.rs @@ -748,7 +748,7 @@ impl ChangeSetReader for BlockchainProvider2 { impl AccountReader for BlockchainProvider2 { /// Get basic account information. - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { self.consistent_provider()?.basic_account(address) } } diff --git a/crates/storage/provider/src/providers/bundle_state_provider.rs b/crates/storage/provider/src/providers/bundle_state_provider.rs index 16cd64ca2293..9edb2763928d 100644 --- a/crates/storage/provider/src/providers/bundle_state_provider.rs +++ b/crates/storage/provider/src/providers/bundle_state_provider.rs @@ -68,9 +68,9 @@ impl BlockHashReader } impl AccountReader for BundleStateProvider { - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { if let Some(account) = - self.block_execution_data_provider.execution_outcome().account(&address) + self.block_execution_data_provider.execution_outcome().account(address) { Ok(account) } else { diff --git a/crates/storage/provider/src/providers/consistent.rs b/crates/storage/provider/src/providers/consistent.rs index 1cb90a3409d3..41ae385289dd 100644 --- a/crates/storage/provider/src/providers/consistent.rs +++ b/crates/storage/provider/src/providers/consistent.rs @@ -234,7 +234,7 @@ impl ConsistentProvider { let AccountBeforeTx { info: old_info, address } = account_before; match state.entry(address) { hash_map::Entry::Vacant(entry) => { - let new_info = state_provider.basic_account(address)?; + let new_info = state_provider.basic_account(&address)?; entry.insert((old_info, new_info, HashMap::new())); } hash_map::Entry::Occupied(mut entry) => { @@ -252,7 +252,7 @@ impl ConsistentProvider { // get account state or insert from plain state. let account_state = match state.entry(address) { hash_map::Entry::Vacant(entry) => { - let present_info = state_provider.basic_account(address)?; + let present_info = state_provider.basic_account(&address)?; entry.insert((present_info, present_info, HashMap::new())) } hash_map::Entry::Occupied(entry) => entry.into_mut(), @@ -1441,7 +1441,7 @@ impl ChangeSetReader for ConsistentProvider { impl AccountReader for ConsistentProvider { /// Get basic account information. - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { // use latest state provider let state_provider = self.latest_ref()?; state_provider.basic_account(address) diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index e4973653c7a1..5d0491f519f1 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -862,8 +862,8 @@ impl DatabaseProvider { } impl AccountReader for DatabaseProvider { - fn basic_account(&self, address: Address) -> ProviderResult> { - Ok(self.tx.get::(address)?) + fn basic_account(&self, address: &Address) -> ProviderResult> { + Ok(self.tx.get_by_encoded_key::(address)?) } } diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index 20539b70194a..25a5df9096d9 100644 --- a/crates/storage/provider/src/providers/mod.rs +++ b/crates/storage/provider/src/providers/mod.rs @@ -949,7 +949,7 @@ impl ChangeSetReader for BlockchainProvider { impl AccountReader for BlockchainProvider { /// Get basic account information. - fn basic_account(&self, address: Address) -> ProviderResult> { + fn basic_account(&self, address: &Address) -> ProviderResult> { self.database.provider()?.basic_account(address) } } diff --git a/crates/storage/provider/src/providers/state/historical.rs b/crates/storage/provider/src/providers/state/historical.rs index be5c3b5041e9..180a1aa3f5e9 100644 --- a/crates/storage/provider/src/providers/state/historical.rs +++ b/crates/storage/provider/src/providers/state/historical.rs @@ -249,21 +249,21 @@ impl AccountRea for HistoricalStateProviderRef<'_, Provider> { /// Get basic account information. - fn basic_account(&self, address: Address) -> ProviderResult> { - match self.account_history_lookup(address)? { + fn basic_account(&self, address: &Address) -> ProviderResult> { + match self.account_history_lookup(*address)? { HistoryInfo::NotYetWritten => Ok(None), HistoryInfo::InChangeset(changeset_block_number) => Ok(self .tx() .cursor_dup_read::()? - .seek_by_key_subkey(changeset_block_number, address)? - .filter(|acc| acc.address == address) + .seek_by_key_subkey(changeset_block_number, *address)? + .filter(|acc| &acc.address == address) .ok_or(ProviderError::AccountChangesetNotFound { block_number: changeset_block_number, - address, + address: *address, })? .info), HistoryInfo::InPlainState | HistoryInfo::MaybeInPlainState => { - Ok(self.tx().get::(address)?) + Ok(self.tx().get_by_encoded_key::(address)?) } } } @@ -633,43 +633,46 @@ mod tests { let db = factory.provider().unwrap(); // run - assert_eq!(HistoricalStateProviderRef::new(&db, 1).basic_account(ADDRESS), Ok(None)); + assert_eq!(HistoricalStateProviderRef::new(&db, 1).basic_account(&ADDRESS), Ok(None)); assert_eq!( - HistoricalStateProviderRef::new(&db, 2).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 2).basic_account(&ADDRESS), Ok(Some(acc_at3)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 3).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 3).basic_account(&ADDRESS), Ok(Some(acc_at3)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 4).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 4).basic_account(&ADDRESS), Ok(Some(acc_at7)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 7).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 7).basic_account(&ADDRESS), Ok(Some(acc_at7)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 9).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 9).basic_account(&ADDRESS), Ok(Some(acc_at10)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 10).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 10).basic_account(&ADDRESS), Ok(Some(acc_at10)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 11).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 11).basic_account(&ADDRESS), Ok(Some(acc_at15)) ); assert_eq!( - HistoricalStateProviderRef::new(&db, 16).basic_account(ADDRESS), + HistoricalStateProviderRef::new(&db, 16).basic_account(&ADDRESS), Ok(Some(acc_plain)) ); - assert_eq!(HistoricalStateProviderRef::new(&db, 1).basic_account(HIGHER_ADDRESS), Ok(None)); assert_eq!( - HistoricalStateProviderRef::new(&db, 1000).basic_account(HIGHER_ADDRESS), + HistoricalStateProviderRef::new(&db, 1).basic_account(&HIGHER_ADDRESS), + Ok(None) + ); + assert_eq!( + HistoricalStateProviderRef::new(&db, 1000).basic_account(&HIGHER_ADDRESS), Ok(Some(higher_acc_plain)) ); } diff --git a/crates/storage/provider/src/providers/state/latest.rs b/crates/storage/provider/src/providers/state/latest.rs index abbab7259060..100637657840 100644 --- a/crates/storage/provider/src/providers/state/latest.rs +++ b/crates/storage/provider/src/providers/state/latest.rs @@ -43,8 +43,8 @@ impl<'b, Provider: DBProvider> LatestStateProviderRef<'b, Provider> { impl AccountReader for LatestStateProviderRef<'_, Provider> { /// Get basic account information. - fn basic_account(&self, address: Address) -> ProviderResult> { - self.tx().get::(address).map_err(Into::into) + fn basic_account(&self, address: &Address) -> ProviderResult> { + self.tx().get_by_encoded_key::(address).map_err(Into::into) } } diff --git a/crates/storage/provider/src/providers/state/macros.rs b/crates/storage/provider/src/providers/state/macros.rs index da7507df8a1d..85cfd9053dfb 100644 --- a/crates/storage/provider/src/providers/state/macros.rs +++ b/crates/storage/provider/src/providers/state/macros.rs @@ -31,7 +31,7 @@ macro_rules! delegate_provider_impls { $crate::providers::state::macros::delegate_impls_to_as_ref!( for $target => AccountReader $(where [$($generics)*])? { - fn basic_account(&self, address: alloy_primitives::Address) -> reth_storage_errors::provider::ProviderResult>; + fn basic_account(&self, address: &alloy_primitives::Address) -> reth_storage_errors::provider::ProviderResult>; } BlockHashReader $(where [$($generics)*])? { fn block_hash(&self, number: u64) -> reth_storage_errors::provider::ProviderResult>; diff --git a/crates/storage/provider/src/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index 94ae411076ea..dbaa90acc6a2 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -577,8 +577,8 @@ impl BlockReaderIdExt for MockEthProvider { } impl AccountReader for MockEthProvider { - fn basic_account(&self, address: Address) -> ProviderResult> { - Ok(self.accounts.lock().get(&address).cloned().map(|a| a.account)) + fn basic_account(&self, address: &Address) -> ProviderResult> { + Ok(self.accounts.lock().get(address).cloned().map(|a| a.account)) } } diff --git a/crates/storage/provider/src/writer/mod.rs b/crates/storage/provider/src/writer/mod.rs index 7ab6499cc3e2..f507afabba21 100644 --- a/crates/storage/provider/src/writer/mod.rs +++ b/crates/storage/provider/src/writer/mod.rs @@ -361,12 +361,12 @@ mod tests { // Check plain state assert_eq!( - provider.basic_account(address_a).expect("Could not read account state"), + provider.basic_account(&address_a).expect("Could not read account state"), Some(reth_account_a), "Account A state is wrong" ); assert_eq!( - provider.basic_account(address_b).expect("Could not read account state"), + provider.basic_account(&address_b).expect("Could not read account state"), Some(reth_account_b_changed), "Account B state is wrong" ); @@ -422,7 +422,7 @@ mod tests { // Check new plain state for account B assert_eq!( - provider.basic_account(address_b).expect("Could not read account state"), + provider.basic_account(&address_b).expect("Could not read account state"), None, "Account B should be deleted" ); diff --git a/crates/storage/storage-api/src/account.rs b/crates/storage/storage-api/src/account.rs index 1c8c9e42462f..abcb289a29f5 100644 --- a/crates/storage/storage-api/src/account.rs +++ b/crates/storage/storage-api/src/account.rs @@ -14,7 +14,7 @@ pub trait AccountReader: Send + Sync { /// Get basic account information. /// /// Returns `None` if the account doesn't exist. - fn basic_account(&self, address: Address) -> ProviderResult>; + fn basic_account(&self, address: &Address) -> ProviderResult>; } /// Account reader diff --git a/crates/storage/storage-api/src/noop.rs b/crates/storage/storage-api/src/noop.rs index e19776c7d964..d7c8350c9fba 100644 --- a/crates/storage/storage-api/src/noop.rs +++ b/crates/storage/storage-api/src/noop.rs @@ -357,7 +357,7 @@ impl HeaderProvider for NoopProvider { } impl AccountReader for NoopProvider { - fn basic_account(&self, _address: Address) -> ProviderResult> { + fn basic_account(&self, _address: &Address) -> ProviderResult> { Ok(None) } } diff --git a/crates/storage/storage-api/src/state.rs b/crates/storage/storage-api/src/state.rs index 015bd7fcc808..66dba83c453c 100644 --- a/crates/storage/storage-api/src/state.rs +++ b/crates/storage/storage-api/src/state.rs @@ -40,7 +40,7 @@ pub trait StateProvider: /// Get account code by its address. /// /// Returns `None` if the account doesn't exist or account is not a contract - fn account_code(&self, addr: Address) -> ProviderResult> { + fn account_code(&self, addr: &Address) -> ProviderResult> { // Get basic account information // Returns None if acc doesn't exist let acc = match self.basic_account(addr)? { @@ -63,7 +63,7 @@ pub trait StateProvider: /// Get account balance by its address. /// /// Returns `None` if the account doesn't exist - fn account_balance(&self, addr: Address) -> ProviderResult> { + fn account_balance(&self, addr: &Address) -> ProviderResult> { // Get basic account information // Returns None if acc doesn't exist match self.basic_account(addr)? { @@ -75,7 +75,7 @@ pub trait StateProvider: /// Get account nonce by its address. /// /// Returns `None` if the account doesn't exist - fn account_nonce(&self, addr: Address) -> ProviderResult> { + fn account_nonce(&self, addr: &Address) -> ProviderResult> { // Get basic account information // Returns None if acc doesn't exist match self.basic_account(addr)? { diff --git a/crates/transaction-pool/src/maintain.rs b/crates/transaction-pool/src/maintain.rs index dfcd22fd68bd..86fce879294e 100644 --- a/crates/transaction-pool/src/maintain.rs +++ b/crates/transaction-pool/src/maintain.rs @@ -535,7 +535,7 @@ where Err(err) => return Err(Box::new((addresses.collect(), err))), }; for addr in addresses { - if let Ok(maybe_acc) = state.basic_account(addr) { + if let Ok(maybe_acc) = state.basic_account(&addr) { let acc = maybe_acc .map(|acc| ChangedAccount { address: addr, nonce: acc.nonce, balance: acc.balance }) .unwrap_or_else(|| ChangedAccount::empty(addr)); diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index d40f0f897589..ea09d61b219a 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -367,7 +367,7 @@ where let state = maybe_state.as_deref().expect("provider is set"); // Use provider to get account info - let account = match state.basic_account(transaction.sender()) { + let account = match state.basic_account(transaction.sender_ref()) { Ok(account) => account.unwrap_or_default(), Err(err) => { return TransactionValidationOutcome::Error(*transaction.hash(), Box::new(err)) diff --git a/examples/db-access/src/main.rs b/examples/db-access/src/main.rs index 727bd1bfff3c..4c4aaa25704e 100644 --- a/examples/db-access/src/main.rs +++ b/examples/db-access/src/main.rs @@ -234,8 +234,8 @@ fn state_provider_example(provider: T) -> eyre let storage_key = B256::random(); // Can get account / storage state with simple point queries - let _account = provider.basic_account(address)?; - let _code = provider.account_code(address)?; + let _account = provider.basic_account(&address)?; + let _code = provider.account_code(&address)?; let _storage = provider.storage(address, storage_key)?; // TODO: unimplemented. // let _proof = provider.proof(address, &[])?;