From abb919b5b155fffd8657bac36a5eb18172161c51 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 28 Nov 2024 10:43:09 +0100 Subject: [PATCH 1/2] fix: use precompile const --- crates/node/src/evm.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index df9d8bc..d58e7f9 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -27,10 +27,17 @@ use reth_revm::{ }, ContextPrecompiles, Database, Evm, EvmBuilder, GetInspector, }; -use revm_precompile::secp256r1; -use revm_primitives::{CfgEnvWithHandlerCfg, TxEnv}; +use revm_precompile::{secp256r1::p256_verify, u64_to_address, PrecompileWithAddress}; +use revm_primitives::{CfgEnvWithHandlerCfg, Precompile, TxEnv}; use std::sync::Arc; +/// P256 verify precompile address. +pub const P256VERIFY_ADDRESS: u64 = 0x14; + +/// [EIP-7212](https://eips.ethereum.org/EIPS/eip-7212#specification) secp256r1 precompile. +pub const P256VERIFY: PrecompileWithAddress = + PrecompileWithAddress(u64_to_address(P256VERIFY_ADDRESS), Precompile::Standard(p256_verify)); + /// Custom EVM configuration #[derive(Debug, Clone)] pub struct OdysseyEvmConfig { @@ -43,6 +50,10 @@ impl OdysseyEvmConfig { Self { chain_spec } } + fn precompiles() -> impl Iterator { + [P256VERIFY].into_iter() + } + /// Sets the precompiles to the EVM handler /// /// This will be invoked when the EVM is created via [`ConfigureEvm::evm`] or @@ -61,7 +72,7 @@ impl OdysseyEvmConfig { let mut loaded_precompiles: ContextPrecompiles = ContextPrecompiles::new(PrecompileSpecId::from_spec_id(spec_id)); - loaded_precompiles.extend(secp256r1::precompiles()); + loaded_precompiles.extend(Self::precompiles()); loaded_precompiles }); From d76a5818a8dd12ba221e1d0b36f6e160f40a61a9 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 28 Nov 2024 10:47:59 +0100 Subject: [PATCH 2/2] chore: no-tests warn --- .github/workflows/integration.yml | 3 ++- .github/workflows/unit.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 55d5a39..95db778 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -37,7 +37,8 @@ jobs: cargo nextest run \ --locked \ --workspace \ - -E 'kind(test)' + -E 'kind(test)' \ + --no-tests=warn integration-success: name: integration success diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 8dc60e2..c2c59d0 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -34,7 +34,8 @@ jobs: cargo nextest run \ --locked \ --workspace \ - -E "(kind(lib) | kind(bin) | kind(proc-macro)) & !package(odyssey-e2e-tests)" + -E "(kind(lib) | kind(bin) | kind(proc-macro)) & !package(odyssey-e2e-tests)" \ + --no-tests=warn doc: name: doc tests