Skip to content
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
155 changes: 89 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

35 changes: 21 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,12 @@ reth-trie-parallel = { path = "crates/trie-parallel" }
revm = { version = "9.0.0", features = [
"std",
"secp256k1",
"blst",
], default-features = false }
revm-primitives = { version = "4.0.0", features = [
"std",
], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "5a4fd5e" }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "ed5450e" }

# eth
alloy-chains = "0.1.15"
Expand All @@ -320,21 +321,21 @@ alloy-dyn-abi = "0.7.2"
alloy-sol-types = "0.7.2"
alloy-rlp = "0.3.4"
alloy-trie = "0.4"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b", default-features = false, features = [
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117", default-features = false, features = [
"reqwest",
] }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "64feb9b" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "bd39117" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "bd39117" }

# misc
auto_impl = "1"
Expand Down Expand Up @@ -434,3 +435,9 @@ proptest-derive = "0.4"
serial_test = "3"
similar-asserts = "1.5.0"
test-fuzz = "5"

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
8 changes: 6 additions & 2 deletions crates/optimism/evm/src/l1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ impl RethL1BlockInfo for L1BlockInfo {
return Ok(U256::ZERO)
}

let spec_id = if chain_spec.is_fork_active_at_timestamp(Hardfork::Ecotone, timestamp) {
let spec_id = if chain_spec.is_fork_active_at_timestamp(Hardfork::Fjord, timestamp) {
SpecId::FJORD
} else if chain_spec.is_fork_active_at_timestamp(Hardfork::Ecotone, timestamp) {
SpecId::ECOTONE
} else if chain_spec.is_fork_active_at_timestamp(Hardfork::Regolith, timestamp) {
SpecId::REGOLITH
Expand All @@ -211,7 +213,9 @@ impl RethL1BlockInfo for L1BlockInfo {
timestamp: u64,
input: &[u8],
) -> Result<U256, BlockExecutionError> {
let spec_id = if chain_spec.is_fork_active_at_timestamp(Hardfork::Regolith, timestamp) {
let spec_id = if chain_spec.is_fork_active_at_timestamp(Hardfork::Fjord, timestamp) {
SpecId::FJORD
} else if chain_spec.is_fork_active_at_timestamp(Hardfork::Regolith, timestamp) {
SpecId::REGOLITH
} else if chain_spec.is_fork_active_at_timestamp(Hardfork::Bedrock, timestamp) {
SpecId::BEDROCK
Expand Down
4 changes: 1 addition & 3 deletions crates/primitives/src/revm/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,5 @@ pub fn calculate_intrinsic_gas_after_merge(
is_shanghai: bool,
) -> u64 {
let spec_id = if is_shanghai { SpecId::SHANGHAI } else { SpecId::MERGE };
// TODO(EOF)
let initcodes = &[];
validate_initial_tx_gas(spec_id, input, kind.is_create(), access_list, initcodes)
validate_initial_tx_gas(spec_id, input, kind.is_create(), access_list)
}
3 changes: 0 additions & 3 deletions crates/primitives/src/revm/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ pub fn fill_tx_env_with_beacon_root_contract_call(env: &mut Env, parent_beacon_b
// enveloped tx size.
enveloped_tx: Some(Bytes::default()),
},
// TODO(EOF)
eof_initcodes: vec![],
eof_initcodes_hashed: Default::default(),
};

// ensure the block gas limit is >= the tx
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-testing-util/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ mod tests {
let url = parse_env_url("RETH_RPC_TEST_NODE_URL").unwrap();
let client = HttpClientBuilder::default().build(url).unwrap();

let opts =
GethDebugTracingOptions::default().call_config(CallConfig::default().only_top_call());
let opts = GethDebugTracingOptions::default()
.with_call_config(CallConfig::default().only_top_call());

let mut stream = client.debug_trace_transactions_in_block(block, opts).await.unwrap();
while let Some(res) = stream.next().await {
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ where
env: EnvWithHandlerCfg,
db: &mut CacheDB<StateProviderDatabase<StateProviderBox>>,
transaction_context: Option<TransactionContext>,
) -> EthResult<(GethTrace, revm_primitives::State)> {
) -> EthResult<(GethTrace, revm_primitives::EvmState)> {
let GethDebugTracingOptions { config, tracer, tracer_config, .. } = opts;

if let Some(tracer) = tracer {
Expand Down
16 changes: 8 additions & 8 deletions crates/rpc/rpc/src/eth/api/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ use reth_transaction_pool::{TransactionOrigin, TransactionPool};
use revm::{
db::CacheDB,
primitives::{
db::DatabaseCommit, BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult,
ResultAndState, SpecId, State,
db::DatabaseCommit, BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, EvmState,
ExecutionResult, ResultAndState, SpecId,
},
GetInspector, Inspector,
};
Expand Down Expand Up @@ -425,7 +425,7 @@ pub trait EthTransactions: Send + Sync {
TransactionInfo,
TracingInspector,
ExecutionResult,
&'a State,
&'a EvmState,
&'a StateCacheDB,
) -> EthResult<R>
+ Send
Expand All @@ -443,7 +443,7 @@ pub trait EthTransactions: Send + Sync {
/// 2. configures the EVM evn
/// 3. loops over all transactions and executes them
/// 4. calls the callback with the transaction info, the execution result, the changed state
/// _after_ the transaction [State] and the database that points to the state
/// _after_ the transaction [EvmState] and the database that points to the state
/// right _before_ the transaction, in other words the state the transaction was
/// executed on: `changed_state = tx(cached_state)`
///
Expand All @@ -462,7 +462,7 @@ pub trait EthTransactions: Send + Sync {
TransactionInfo,
Insp,
ExecutionResult,
&'a State,
&'a EvmState,
&'a StateCacheDB,
) -> EthResult<R>
+ Send
Expand Down Expand Up @@ -491,7 +491,7 @@ pub trait EthTransactions: Send + Sync {
TransactionInfo,
TracingInspector,
ExecutionResult,
&'a State,
&'a EvmState,
&'a StateCacheDB,
) -> EthResult<R>
+ Send
Expand Down Expand Up @@ -529,7 +529,7 @@ pub trait EthTransactions: Send + Sync {
TransactionInfo,
Insp,
ExecutionResult,
&'a State,
&'a EvmState,
&'a StateCacheDB,
) -> EthResult<R>
+ Send
Expand Down Expand Up @@ -1278,7 +1278,7 @@ where
TransactionInfo,
Insp,
ExecutionResult,
&'a State,
&'a EvmState,
&'a StateCacheDB,
) -> EthResult<R>
+ Send
Expand Down
3 changes: 0 additions & 3 deletions crates/rpc/rpc/src/eth/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,6 @@ impl From<revm::primitives::InvalidTransaction> for RpcInvalidTransactionError {
OptimismInvalidTransactionError::HaltedDepositPostRegolith,
),
// TODO(EOF)
InvalidTransaction::EofInitcodesNotSupported => todo!("EOF"),
InvalidTransaction::EofInitcodesNumberLimit => todo!("EOF"),
InvalidTransaction::EofInitcodesSizeLimit => todo!("EOF"),
InvalidTransaction::EofCrateShouldHaveToAddress => todo!("EOF"),
}
}
Expand Down
13 changes: 8 additions & 5 deletions crates/rpc/rpc/src/eth/revm_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ pub(crate) fn create_txn_env(
max_fee_per_blob_gas,
#[cfg(feature = "optimism")]
optimism: OptimismFields { enveloped_tx: Some(Bytes::new()), ..Default::default() },
// TODO(EOF)
eof_initcodes: Default::default(),
eof_initcodes_hashed: Default::default(),
};

Ok(env)
Expand Down Expand Up @@ -540,13 +537,19 @@ where
account,
new_account_state
.into_iter()
.map(|(slot, value)| (U256::from_be_bytes(slot.0), value))
.map(|(slot, value)| {
(U256::from_be_bytes(slot.0), U256::from_be_bytes(value.0))
})
.collect(),
)?;
}
(None, Some(account_state_diff)) => {
for (slot, value) in account_state_diff {
db.insert_account_storage(account, U256::from_be_bytes(slot.0), value)?;
db.insert_account_storage(
account,
U256::from_be_bytes(slot.0),
U256::from_be_bytes(value.0),
)?;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ mod tests {
BundleState, EmptyDB,
},
primitives::{
Account as RevmAccount, AccountInfo as RevmAccountInfo, AccountStatus, StorageSlot,
Account as RevmAccount, AccountInfo as RevmAccountInfo, AccountStatus, EvmStorageSlot,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not super happy with this rename tbh

},
DatabaseCommit, State,
};
Expand Down Expand Up @@ -260,11 +260,11 @@ mod tests {
storage: HashMap::from([
(
U256::from(0),
StorageSlot { present_value: U256::from(1), ..Default::default() },
EvmStorageSlot { present_value: U256::from(1), ..Default::default() },
),
(
U256::from(1),
StorageSlot { present_value: U256::from(2), ..Default::default() },
EvmStorageSlot { present_value: U256::from(2), ..Default::default() },
),
]),
},
Expand All @@ -277,9 +277,9 @@ mod tests {
// 0x01 => 1 => 2
storage: HashMap::from([(
U256::from(1),
StorageSlot {
EvmStorageSlot {
present_value: U256::from(2),
previous_or_original_value: U256::from(1),
original_value: U256::from(1),
},
)]),
},
Expand Down Expand Up @@ -440,11 +440,11 @@ mod tests {
storage: HashMap::from([
(
U256::ZERO,
StorageSlot { present_value: U256::from(1), ..Default::default() },
EvmStorageSlot { present_value: U256::from(1), ..Default::default() },
),
(
U256::from(1),
StorageSlot { present_value: U256::from(2), ..Default::default() },
EvmStorageSlot { present_value: U256::from(2), ..Default::default() },
),
]),
},
Expand All @@ -470,10 +470,7 @@ mod tests {
// 0x00 => 1 => 2
storage: HashMap::from([(
U256::ZERO,
StorageSlot {
previous_or_original_value: U256::from(1),
present_value: U256::from(2),
},
EvmStorageSlot { original_value: U256::from(1), present_value: U256::from(2) },
)]),
},
)]));
Expand Down Expand Up @@ -513,15 +510,15 @@ mod tests {
storage: HashMap::from([
(
U256::ZERO,
StorageSlot { present_value: U256::from(2), ..Default::default() },
EvmStorageSlot { present_value: U256::from(2), ..Default::default() },
),
(
U256::from(2),
StorageSlot { present_value: U256::from(4), ..Default::default() },
EvmStorageSlot { present_value: U256::from(4), ..Default::default() },
),
(
U256::from(6),
StorageSlot { present_value: U256::from(6), ..Default::default() },
EvmStorageSlot { present_value: U256::from(6), ..Default::default() },
),
]),
},
Expand Down Expand Up @@ -556,7 +553,7 @@ mod tests {
// 0x00 => 0 => 2
storage: HashMap::from([(
U256::ZERO,
StorageSlot { present_value: U256::from(2), ..Default::default() },
EvmStorageSlot { present_value: U256::from(2), ..Default::default() },
)]),
},
)]));
Expand Down Expand Up @@ -587,7 +584,7 @@ mod tests {
// 0x00 => 0 => 9
storage: HashMap::from([(
U256::ZERO,
StorageSlot { present_value: U256::from(9), ..Default::default() },
EvmStorageSlot { present_value: U256::from(9), ..Default::default() },
)]),
},
)]));
Expand Down Expand Up @@ -748,11 +745,11 @@ mod tests {
storage: HashMap::from([
(
U256::ZERO,
StorageSlot { present_value: U256::from(1), ..Default::default() },
EvmStorageSlot { present_value: U256::from(1), ..Default::default() },
),
(
U256::from(1),
StorageSlot { present_value: U256::from(2), ..Default::default() },
EvmStorageSlot { present_value: U256::from(2), ..Default::default() },
),
]),
},
Expand Down Expand Up @@ -796,7 +793,7 @@ mod tests {
// 0x01 => 0 => 5
storage: HashMap::from([(
U256::from(1),
StorageSlot { present_value: U256::from(5), ..Default::default() },
EvmStorageSlot { present_value: U256::from(5), ..Default::default() },
)]),
},
)]));
Expand Down Expand Up @@ -949,7 +946,7 @@ mod tests {
info: into_revm_acc(account2.0),
storage: HashMap::from_iter([(
slot2,
StorageSlot::new_changed(account2_slot2_old_value, account2_slot2_new_value),
EvmStorageSlot::new_changed(account2_slot2_old_value, account2_slot2_new_value),
)]),
},
)]));
Expand Down Expand Up @@ -1017,7 +1014,7 @@ mod tests {
info: into_revm_acc(account1_new),
storage: HashMap::from_iter([(
slot20,
StorageSlot::new_changed(U256::ZERO, account1_slot20_value),
EvmStorageSlot::new_changed(U256::ZERO, account1_slot20_value),
)]),
},
)]));
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ allow-git = [
# TODO: remove, see ./Cargo.toml
"https://github.com/alloy-rs/alloy",
"https://github.com/foundry-rs/block-explorers",
"https://github.com/bluealloy/revm",
"https://github.com/paradigmxyz/evm-inspectors",
"https://github.com/sigp/discv5",
]