From eb8dd1a92c254088f418595e68ef338c68f83c66 Mon Sep 17 00:00:00 2001 From: Renato Dinhani <101204870+dinhani-cw@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:55:06 -0300 Subject: [PATCH] chore: upgrade revm dependency (#1074) --- Cargo.lock | 25 +++++++++++++------------ Cargo.toml | 4 ++-- src/eth/evm/revm.rs | 5 ++--- src/eth/primitives/bytes.rs | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8161bb138..fd9f2fd90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4178,9 +4178,9 @@ dependencies = [ [[package]] name = "revm" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a454c1c650b2b2e23f0c461af09e6c31e1d15e1cbebe905a701c46b8a50afc" +checksum = "3a2c336f9921588e50871c00024feb51a521eca50ce6d01494bb9c50f837c8ed" dependencies = [ "auto_impl", "cfg-if", @@ -4193,9 +4193,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d322f2730cd300e99d271a1704a2dfb8973d832428f5aa282aaa40e2473b5eec" +checksum = "a58182c7454179826f9dad2ca577661963092ce9d0fd0c9d682c1e9215a72e70" dependencies = [ "revm-primitives", "serde", @@ -4203,11 +4203,12 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931f692f3f4fc72ec39d5d270f8e9d208c4a6008de7590ee96cf948e3b6d3f8d" +checksum = "dc8af9aa737eef0509a50d9f3cc1a631557a00ef2e70a3aa8a75d9ee0ed275bb" dependencies = [ "aurora-engine-modexp", + "blst", "c-kzg", "k256", "once_cell", @@ -4220,9 +4221,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbbc9640790cebcb731289afb7a7d96d16ad94afeb64b5d0b66443bd151e79d6" +checksum = "b9bf5d465e64b697da6a111cb19e798b5b2ebb18e5faf2ad48e9e8d47c64add2" dependencies = [ "alloy-primitives", "auto_impl", @@ -4655,9 +4656,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "rand", "secp256k1-sys", @@ -4665,9 +4666,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" dependencies = [ "cc", ] diff --git a/Cargo.toml b/Cargo.toml index e703220fe..a1f620e70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,10 +109,10 @@ petgraph = "=0.6.5" # ------------------------------------------------------------------------------ [target.'cfg(not(all(target_arch = "aarch64", target_os = "linux")))'.dependencies] -revm = { version = "=8.0.0", features = ["asm-keccak"]} +revm = { version = "=9.0.0", features = ["asm-keccak"]} [target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies] -revm = { version = "=8.0.0" } +revm = { version = "=9.0.0" } # ------------------------------------------------------------------------------ # Patches diff --git a/src/eth/evm/revm.rs b/src/eth/evm/revm.rs index 8bb2f7cf3..b515aa0c5 100644 --- a/src/eth/evm/revm.rs +++ b/src/eth/evm/revm.rs @@ -16,7 +16,6 @@ use itertools::Itertools; use revm::primitives::AccountInfo; use revm::primitives::Address as RevmAddress; use revm::primitives::Bytecode as RevmBytecode; -use revm::primitives::CreateScheme; use revm::primitives::ExecutionResult as RevmExecutionResult; use revm::primitives::ResultAndState as RevmResultAndState; use revm::primitives::SpecId; @@ -83,7 +82,7 @@ impl Revm { }); // handler custom instructions - let instructions = handler.take_instruction_table().unwrap(); + let instructions = handler.take_instruction_table(); handler.set_instruction_table(instructions); // configure revm @@ -130,7 +129,7 @@ impl Evm for Revm { tx_env.caller = input.from.into(); tx_env.transact_to = match input.to { Some(contract) => TransactTo::Call(contract.into()), - None => TransactTo::Create(CreateScheme::Create), + None => TransactTo::Create, }; tx_env.gas_limit = min(input.gas_limit.into(), GAS_MAX_LIMIT); tx_env.gas_price = input.gas_price.into(); diff --git a/src/eth/primitives/bytes.rs b/src/eth/primitives/bytes.rs index 153a17111..75ac6c2b9 100644 --- a/src/eth/primitives/bytes.rs +++ b/src/eth/primitives/bytes.rs @@ -81,7 +81,7 @@ impl From for Bytes { impl From for Bytes { fn from(value: RevmBytecode) -> Self { - Self(value.bytecode.0.into()) + Self(value.bytecode().clone().into()) } }