11//! This file implements the [`trevm::Cfg`] and [`trevm::Block`] traits for Signet and host networks.
22
33use alloy_chains:: NamedChain ;
4+ use reth_chainspec:: ChainSpec ;
45use signet_block_processor:: revm_spec;
56use signet_constants:: pecorino;
7+ use signet_genesis:: PECORINO_GENESIS ;
8+ use std:: sync:: LazyLock ;
69use trevm:: revm:: { context:: CfgEnv , primitives:: hardfork:: SpecId } ;
710
11+ /// The RU Pecorino [`ChainSpec`].
12+ static PECORINO_SPEC : LazyLock < ChainSpec > =
13+ LazyLock :: new ( || ChainSpec :: from_genesis ( PECORINO_GENESIS . to_owned ( ) ) ) ;
14+
815/// [`SignetCfgEnv`] holds network-level configuration values.
916#[ derive( Debug , Clone , Copy ) ]
1017pub struct SignetCfgEnv {
@@ -23,12 +30,9 @@ impl SignetCfgEnv {
2330 fn spec_id ( & self ) -> SpecId {
2431 match self . chain_id {
2532 // Pecorino
26- pecorino:: HOST_CHAIN_ID | pecorino:: RU_CHAIN_ID => revm_spec (
27- & reth_chainspec:: ChainSpec :: from_genesis (
28- signet_genesis:: PECORINO_GENESIS . to_owned ( ) ,
29- ) ,
30- self . timestamp ,
31- ) ,
33+ pecorino:: HOST_CHAIN_ID | pecorino:: RU_CHAIN_ID => {
34+ revm_spec ( & PECORINO_SPEC , self . timestamp )
35+ }
3236 // Host Mainnet
3337 id if id == NamedChain :: Mainnet as u64 => {
3438 revm_spec ( & reth_chainspec:: MAINNET , self . timestamp )
0 commit comments