chore(deps): bump revm 10.0, un-git revm-inspectors (#8997)

This commit is contained in:
DaniPopes
2024-06-20 20:45:12 +02:00
committed by GitHub
parent 27d26ac10d
commit 4fcf26c5ae
6 changed files with 35 additions and 46 deletions

23
Cargo.lock generated
View File

@ -8395,8 +8395,9 @@ dependencies = [
[[package]]
name = "revm"
version = "9.0.0"
source = "git+https://github.com/bluealloy/revm.git?rev=41e2f7f#41e2f7f9740c0fb70c5ba888a36453712b6de39c"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "355bde4e21578c241f9379fbb344a73d254969b5007239115e094dda1511cd34"
dependencies = [
"auto_impl",
"cfg-if",
@ -8410,7 +8411,8 @@ dependencies = [
[[package]]
name = "revm-inspectors"
version = "0.1.0"
source = "git+https://github.com/paradigmxyz/revm-inspectors?rev=4fe17f0#4fe17f08797450d9d5df315e724d14c9f3749b3f"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eba2e187811b160463663fd71881b4e5d653720ba00be0f1e85962d4db60341c"
dependencies = [
"alloy-primitives",
"alloy-rpc-types",
@ -8426,8 +8428,9 @@ dependencies = [
[[package]]
name = "revm-interpreter"
version = "5.0.0"
source = "git+https://github.com/bluealloy/revm.git?rev=41e2f7f#41e2f7f9740c0fb70c5ba888a36453712b6de39c"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23dfd24faa3cbbd96e0976103d1e174d6559b8036730f70415488ee21870d578"
dependencies = [
"revm-primitives",
"serde",
@ -8435,8 +8438,9 @@ dependencies = [
[[package]]
name = "revm-precompile"
version = "7.0.0"
source = "git+https://github.com/bluealloy/revm.git?rev=41e2f7f#41e2f7f9740c0fb70c5ba888a36453712b6de39c"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c669c9b105dbb41133c17bf7f34d29368e358a7fee8fcc289e90dbfb024dfc4"
dependencies = [
"aurora-engine-modexp",
"blst",
@ -8453,8 +8457,9 @@ dependencies = [
[[package]]
name = "revm-primitives"
version = "4.0.0"
source = "git+https://github.com/bluealloy/revm.git?rev=41e2f7f#41e2f7f9740c0fb70c5ba888a36453712b6de39c"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "902184a7a781550858d4b96707098da357429f1e4545806fd5b589f455555cf2"
dependencies = [
"alloy-primitives",
"auto_impl",

View File

@ -339,15 +339,15 @@ reth-trie-common = { path = "crates/trie/common" }
reth-trie-parallel = { path = "crates/trie/parallel" }
# revm
revm = { version = "9.0.0", features = [
revm = { version = "10.0.0", features = [
"std",
"secp256k1",
"blst",
], default-features = false }
revm-primitives = { version = "4.0.0", features = [
revm-primitives = { version = "5.0.0", features = [
"std",
], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "4fe17f0" }
revm-inspectors = "0.1"
# eth
alloy-chains = "0.1.15"
@ -495,9 +495,3 @@ serial_test = "3"
similar-asserts = "1.5.0"
test-fuzz = "5"
iai-callgrind = "0.11"
[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm.git", rev = "41e2f7f" }
revm-interpreter = { git = "https://github.com/bluealloy/revm.git", rev = "41e2f7f" }
revm-precompile = { git = "https://github.com/bluealloy/revm.git", rev = "41e2f7f" }
revm-primitives = { git = "https://github.com/bluealloy/revm.git", rev = "41e2f7f" }

View File

@ -1,6 +1,6 @@
use crate::{
recover_signer_unchecked,
revm_primitives::{BlockEnv, Env, TransactTo, TxEnv},
revm_primitives::{BlockEnv, Env, TxEnv},
Address, Bytes, Header, Transaction, TransactionSignedEcRecovered, TxKind, B256, U256,
};
use reth_chainspec::{Chain, ChainSpec};
@ -182,7 +182,7 @@ fn fill_tx_env_with_system_contract_call(
) {
env.tx = TxEnv {
caller,
transact_to: TransactTo::Call(contract),
transact_to: TxKind::Call(contract),
// Explicitly set nonce to None so revm does not do any nonce checks
nonce: None,
gas_limit: 30_000_000,
@ -246,8 +246,8 @@ where
tx_env.gas_price = U256::from(tx.gas_price);
tx_env.gas_priority_fee = None;
tx_env.transact_to = match tx.to {
TxKind::Call(to) => TransactTo::Call(to),
TxKind::Create => TransactTo::create(),
TxKind::Call(to) => TxKind::Call(to),
TxKind::Create => TxKind::Create,
};
tx_env.value = tx.value;
tx_env.data = tx.input.clone();
@ -262,8 +262,8 @@ where
tx_env.gas_price = U256::from(tx.gas_price);
tx_env.gas_priority_fee = None;
tx_env.transact_to = match tx.to {
TxKind::Call(to) => TransactTo::Call(to),
TxKind::Create => TransactTo::create(),
TxKind::Call(to) => TxKind::Call(to),
TxKind::Create => TxKind::Create,
};
tx_env.value = tx.value;
tx_env.data = tx.input.clone();
@ -285,8 +285,8 @@ where
tx_env.gas_price = U256::from(tx.max_fee_per_gas);
tx_env.gas_priority_fee = Some(U256::from(tx.max_priority_fee_per_gas));
tx_env.transact_to = match tx.to {
TxKind::Call(to) => TransactTo::Call(to),
TxKind::Create => TransactTo::create(),
TxKind::Call(to) => TxKind::Call(to),
TxKind::Create => TxKind::Create,
};
tx_env.value = tx.value;
tx_env.data = tx.input.clone();
@ -307,7 +307,7 @@ where
tx_env.gas_limit = tx.gas_limit;
tx_env.gas_price = U256::from(tx.max_fee_per_gas);
tx_env.gas_priority_fee = Some(U256::from(tx.max_priority_fee_per_gas));
tx_env.transact_to = TransactTo::Call(tx.to);
tx_env.transact_to = TxKind::Call(tx.to);
tx_env.value = tx.value;
tx_env.data = tx.input.clone();
tx_env.chain_id = Some(tx.chain_id);
@ -329,10 +329,7 @@ where
tx_env.gas_limit = tx.gas_limit;
tx_env.gas_price = U256::ZERO;
tx_env.gas_priority_fee = None;
match tx.to {
TxKind::Call(to) => tx_env.transact_to = TransactTo::Call(to),
TxKind::Create => tx_env.transact_to = TransactTo::create(),
}
tx_env.transact_to = tx.to;
tx_env.value = tx.value;
tx_env.data = tx.input.clone();
tx_env.chain_id = None;

View File

@ -25,9 +25,7 @@ use reth_rpc_types::{
use reth_transaction_pool::TransactionPool;
use revm::{
db::{CacheDB, DatabaseRef},
primitives::{
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HaltReason, TransactTo,
},
primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HaltReason},
DatabaseCommit,
};
use revm_inspectors::access_list::AccessListInspector;
@ -219,7 +217,7 @@ where
// 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 TxKind::Call(to) = env.tx.transact_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 {
@ -509,7 +507,7 @@ fn update_estimated_gas_range(
}
ExecutionResult::Halt { reason, .. } => {
match reason {
HaltReason::OutOfGas(_) | HaltReason::InvalidFEOpcode => {
HaltReason::OutOfGas(_) | HaltReason::InvalidEFOpcode => {
// Both `OutOfGas` and `InvalidFEOpcode` can occur dynamically if the gas left
// is too low. Treat this as an out of gas condition,
// knowing that the call succeeds with a higher gas limit.

View File

@ -19,8 +19,7 @@ use revm::{
db::CacheDB,
precompile::{PrecompileSpecId, Precompiles},
primitives::{
db::DatabaseRef, BlockEnv, Bytecode, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, SpecId,
TransactTo, TxEnv,
db::DatabaseRef, BlockEnv, Bytecode, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, SpecId, TxEnv,
},
Database,
};
@ -211,17 +210,13 @@ pub fn create_txn_env(block_env: &BlockEnv, request: TransactionRequest) -> EthR
)?;
let gas_limit = gas.unwrap_or_else(|| block_env.gas_limit.min(U256::from(u64::MAX)).to());
let transact_to = match to {
Some(TxKind::Call(to)) => TransactTo::call(to),
_ => TransactTo::create(),
};
let env = TxEnv {
gas_limit: gas_limit.try_into().map_err(|_| RpcInvalidTransactionError::GasUintOverflow)?,
nonce,
caller: from.unwrap_or_default(),
gas_price,
gas_priority_fee: max_priority_fee_per_gas,
transact_to,
transact_to: to.unwrap_or(TxKind::Create),
value: value.unwrap_or_default(),
data: input.try_into_unique_input()?.unwrap_or_default(),
chain_id,

View File

@ -277,7 +277,7 @@ mod tests {
bytes,
constants::ETH_TO_WEI,
keccak256, public_key_to_address,
revm_primitives::{AccountInfo, ExecutionResult, Output, TransactTo, TxEnv},
revm_primitives::{AccountInfo, ExecutionResult, Output, TxEnv},
BlockNumber, Receipt, SealedBlockWithSenders, Transaction, TxEip2930, TxKind, U256,
};
use reth_revm::Evm;
@ -383,7 +383,7 @@ mod tests {
.with_tx_env(TxEnv {
caller: sender_address,
gas_limit: 50_000_000,
transact_to: TransactTo::Call(weth_address),
transact_to: TxKind::Call(weth_address),
data: WETH::balanceOfCall::new((sender_address,)).abi_encode().into(),
..Default::default()
})
@ -408,7 +408,7 @@ mod tests {
.with_tx_env(TxEnv {
caller: sender_address,
gas_limit: 50_000_000,
transact_to: TransactTo::Call(weth_address),
transact_to: TxKind::Call(weth_address),
data: WETH::balanceOfCall::new((sender_address,)).abi_encode().into(),
..Default::default()
})