Skip to content

Commit

Permalink
chore: Rename PRAGUE_EOF to OSAKA (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita authored Dec 9, 2024
1 parent dff83c6 commit 7e7d048
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bins/revme/src/cmd/statetest/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down
2 changes: 1 addition & 1 deletion crates/handler/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions crates/handler/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 1 addition & 3 deletions crates/optimism/src/handler/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/specification/src/hardfork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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";
}

Expand All @@ -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,
}
Expand Down Expand Up @@ -124,7 +124,7 @@ impl From<SpecId> 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,
}
}
Expand Down

0 comments on commit 7e7d048

Please sign in to comment.