From 7e7d04834e0aca06cd4375ca33cce629b6cab978 Mon Sep 17 00:00:00 2001 From: rakita Date: Mon, 9 Dec 2024 12:40:03 +0100 Subject: [PATCH] chore: Rename PRAGUE_EOF to OSAKA (#1903) --- bins/revme/src/cmd/statetest/runner.rs | 2 +- crates/handler/src/execution.rs | 2 +- crates/handler/src/frame.rs | 4 ++-- crates/optimism/src/handler/precompiles.rs | 4 +--- crates/precompile/src/lib.rs | 2 +- crates/specification/src/hardfork.rs | 8 ++++---- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bins/revme/src/cmd/statetest/runner.rs b/bins/revme/src/cmd/statetest/runner.rs index e484cefa06..eeb3e026a3 100644 --- a/bins/revme/src/cmd/statetest/runner.rs +++ b/bins/revme/src/cmd/statetest/runner.rs @@ -337,7 +337,7 @@ pub fn execute_test_suite( // Enable EOF in Prague tests. cfg.spec = if spec_name == SpecName::Prague { - SpecId::PRAGUE_EOF + SpecId::OSAKA } else { spec_name.to_spec_id() }; diff --git a/crates/handler/src/execution.rs b/crates/handler/src/execution.rs index c66daa10cb..0238feabed 100644 --- a/crates/handler/src/execution.rs +++ b/crates/handler/src/execution.rs @@ -66,7 +66,7 @@ where })), TxKind::Create => { // if first byte of data is magic 0xEF00, then it is EOFCreate. - if spec.is_enabled_in(SpecId::PRAGUE_EOF) && input.starts_with(&EOF_MAGIC_BYTES) { + if spec.is_enabled_in(SpecId::OSAKA) && input.starts_with(&EOF_MAGIC_BYTES) { FrameInput::EOFCreate(Box::new(EOFCreateInputs::new( tx.common_fields().caller(), tx.common_fields().value(), diff --git a/crates/handler/src/frame.rs b/crates/handler/src/frame.rs index 4952bfe6d4..739cb27ef9 100644 --- a/crates/handler/src/frame.rs +++ b/crates/handler/src/frame.rs @@ -20,7 +20,7 @@ use precompile::PrecompileErrors; use primitives::{keccak256, Address, Bytes, B256, U256}; use specification::{ constants::CALL_STACK_LIMIT, - hardfork::SpecId::{self, HOMESTEAD, LONDON, PRAGUE_EOF, SPURIOUS_DRAGON}, + hardfork::SpecId::{self, HOMESTEAD, LONDON, OSAKA, SPURIOUS_DRAGON}, }; use state::Bytecode; use std::borrow::ToOwned; @@ -233,7 +233,7 @@ where } // Prague EOF - if spec.is_enabled_in(PRAGUE_EOF) && inputs.init_code.starts_with(&EOF_MAGIC_BYTES) { + if spec.is_enabled_in(OSAKA) && inputs.init_code.starts_with(&EOF_MAGIC_BYTES) { return return_error(InstructionResult::CreateInitCodeStartingEF00); } diff --git a/crates/optimism/src/handler/precompiles.rs b/crates/optimism/src/handler/precompiles.rs index de4a018342..8629b13b20 100644 --- a/crates/optimism/src/handler/precompiles.rs +++ b/crates/optimism/src/handler/precompiles.rs @@ -91,9 +91,7 @@ where )) => Self::new(Precompiles::new(spec.into_eth_spec().into())), OpSpec::Op(OpSpecId::FJORD) => Self::new(fjord()), OpSpec::Op(OpSpecId::GRANITE) - | OpSpec::Eth(SpecId::PRAGUE | SpecId::PRAGUE_EOF | SpecId::LATEST) => { - Self::new(granite()) - } + | OpSpec::Eth(SpecId::PRAGUE | SpecId::OSAKA | SpecId::LATEST) => Self::new(granite()), } } diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index f069f5a9cb..2f7c232bfe 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -295,7 +295,7 @@ impl PrecompileSpecId { ISTANBUL | MUIR_GLACIER => Self::ISTANBUL, BERLIN | LONDON | ARROW_GLACIER | GRAY_GLACIER | MERGE | SHANGHAI => Self::BERLIN, CANCUN => Self::CANCUN, - PRAGUE | PRAGUE_EOF => Self::PRAGUE, + PRAGUE | OSAKA => Self::PRAGUE, LATEST => Self::LATEST, } } diff --git a/crates/specification/src/hardfork.rs b/crates/specification/src/hardfork.rs index 2363a355b8..f7d58a4c1b 100644 --- a/crates/specification/src/hardfork.rs +++ b/crates/specification/src/hardfork.rs @@ -29,7 +29,7 @@ pub enum SpecId { SHANGHAI, // Shanghai 17034870 (Timestamp: 1681338455) CANCUN, // Cancun 19426587 (Timestamp: 1710338135) PRAGUE, // Prague TBD - PRAGUE_EOF, // Prague+EOF TBD + OSAKA, // Osaka TBD #[default] LATEST = u8::MAX, } @@ -69,7 +69,7 @@ pub mod name { pub const SHANGHAI: &str = "Shanghai"; pub const CANCUN: &str = "Cancun"; pub const PRAGUE: &str = "Prague"; - pub const PRAGUE_EOF: &str = "PragueEOF"; + pub const OSAKA: &str = "PragueEOF"; pub const LATEST: &str = "Latest"; } @@ -95,7 +95,7 @@ impl From<&str> for SpecId { name::SHANGHAI => Self::SHANGHAI, name::CANCUN => Self::CANCUN, name::PRAGUE => Self::PRAGUE, - name::PRAGUE_EOF => Self::PRAGUE_EOF, + name::OSAKA => Self::OSAKA, name::LATEST => Self::LATEST, _ => Self::LATEST, } @@ -124,7 +124,7 @@ impl From for &'static str { SpecId::SHANGHAI => name::SHANGHAI, SpecId::CANCUN => name::CANCUN, SpecId::PRAGUE => name::PRAGUE, - SpecId::PRAGUE_EOF => name::PRAGUE_EOF, + SpecId::OSAKA => name::OSAKA, SpecId::LATEST => name::LATEST, } }