Skip to content

Commit

Permalink
compatible with optimims
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed Sep 5, 2024
1 parent e4db8da commit 2a51505
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use cfg_if::cfg_if;
use core::hash::Hash;
use once_cell::race::OnceBox;
use std::{boxed::Box, vec::Vec};
use revm_primitives::{ECOTONE, FJORD};

pub fn calc_linear_cost_u32(len: usize, base: u64, word: u64) -> u64 {
(len as u64 + 32 - 1) / 32 * word + base
Expand Down Expand Up @@ -485,15 +486,17 @@ impl PrecompileSpecId {
PRAGUE | PRAGUE_EOF => Self::PRAGUE,
#[cfg(feature = "optimism")]
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "opbnb")))]
ECOTONE | FJORD=> Self::CANCUN,
#[cfg(all(feature = "optimism", feature = "opbnb"))]
ECOTONE => Self::CANCUN,
#[cfg(feature = "opbnb")]
FERMAT => Self::FERMAT,
#[cfg(any(feature = "bsc", feature = "opbnb"))]
HABER => Self::HABER,
#[cfg(feature = "opbnb")]
WRIGHT => Self::HABER,
#[cfg(feature = "opbnb")]
#[cfg(all(feature = "optimism", feature = "opbnb"))]
FJORD => Self::HABER,
#[cfg(feature = "bsc")]
HABER_FIX => Self::HABER,
Expand Down

0 comments on commit 2a51505

Please sign in to comment.