Skip to content

Commit

Permalink
chore: reduce diff with upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Edison <[email protected]>
  • Loading branch information
greged93 committed Jan 9, 2025
1 parent d30fcf1 commit 9934d35
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ impl AppendableChain {

let provider = BundleStateProvider::new(state_provider, bundle_state_data_provider);

let executor = externals.executor_factory.executor(StateProviderDatabase::new(&provider));
let db = StateProviderDatabase::new(&provider);
let executor = externals.executor_factory.executor(db);
let block_hash = block.hash();
let block = block.unseal();

Expand Down
3 changes: 0 additions & 3 deletions crates/blockchain-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use reth_revm as _;
use reth_trie_parallel as _;

/// Re-export of the blockchain tree API.
pub use reth_blockchain_tree_api::*;

Expand Down
5 changes: 3 additions & 2 deletions crates/engine/invalid-block-hooks/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ where
let mut hashed_state = db.database.hashed_post_state(&bundle_state);
for (address, account) in db.cache.accounts {
let hashed_address = provider.hash_key(address.as_ref());
let hashed_account = account.account.as_ref().map(|a| a.info.clone().into());
hashed_state.accounts.insert(hashed_address, hashed_account);
hashed_state
.accounts
.insert(hashed_address, account.account.as_ref().map(|a| a.info.clone().into()));

let storage = hashed_state
.storages
Expand Down
6 changes: 5 additions & 1 deletion crates/revm/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ use alloy_primitives::{Address, B256, U256};
use core::ops::{Deref, DerefMut};
use reth_primitives::Account;
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use revm::{db::DatabaseRef, primitives::Bytecode, AccountInfo, Database};
use revm::{
db::DatabaseRef,
primitives::{AccountInfo, Bytecode},
Database,
};

/// A helper trait responsible for providing state necessary for EVM execution.
///
Expand Down
5 changes: 4 additions & 1 deletion crates/revm/src/either.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use alloy_primitives::{Address, B256, U256};
use revm::{primitives::Bytecode, AccountInfo, Database};
use revm::{
primitives::{AccountInfo, Bytecode},
Database,
};

/// An enum type that can hold either of two different [`Database`] implementations.
///
Expand Down
5 changes: 3 additions & 2 deletions crates/revm/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ impl ExecutionWitnessRecord {

for (address, account) in &statedb.cache.accounts {
let hashed_address = keccak256(address);
let hashed_account = account.account.as_ref().map(|a| a.info.clone().into());
self.hashed_state.accounts.insert(hashed_address, hashed_account);
self.hashed_state
.accounts
.insert(hashed_address, account.account.as_ref().map(|a| (&a.info).into()));

let storage = self
.hashed_state
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ where

self.eth_api()
.spawn_with_state_at_block(block.parent_hash().into(), move |state_provider| {
let block_executor =
this.inner.block_executor.executor(StateProviderDatabase::new(&state_provider));
let db = StateProviderDatabase::new(&state_provider);
let block_executor = this.inner.block_executor.executor(db);

let mut witness_record = ExecutionWitnessRecord::default();

Expand Down
4 changes: 2 additions & 2 deletions crates/trie/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ serde = [
"alloy-trie/serde",
"alloy-rpc-types-eth?/serde",
"reth-primitives-traits/serde",
"reth-codecs?/serde",
"reth-codecs?/serde"
]
reth-codec = [
"dep:reth-codecs",
Expand Down Expand Up @@ -117,7 +117,7 @@ arbitrary = [
"alloy-primitives/arbitrary",
"nybbles/arbitrary",
"reth-codecs/arbitrary",
"alloy-rpc-types-eth?/arbitrary",
"alloy-rpc-types-eth?/arbitrary"
]

[[bench]]
Expand Down
5 changes: 2 additions & 3 deletions crates/trie/trie/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,9 @@ mod tests {
use revm::{
db::{
states::{plain_account::PlainStorage, CacheAccount, StorageSlot},
BundleAccount, StorageWithOriginalValues,
BundleAccount, PlainAccount, StorageWithOriginalValues,
},
primitives::{AccountInfo, Bytecode},
PlainAccount,
};

#[test]
Expand Down Expand Up @@ -505,7 +504,7 @@ mod tests {
let address = Address::random();

// Create mock account info.
let account_info = revm::AccountInfo {
let account_info = AccountInfo {
balance: U256::from(500),
nonce: 5,
code_hash: B256::random(),
Expand Down

0 comments on commit 9934d35

Please sign in to comment.