Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reduce diff with upstream #128

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -633,8 +633,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
Loading