File tree Expand file tree Collapse file tree 8 files changed +56
-23
lines changed Expand file tree Collapse file tree 8 files changed +56
-23
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,15 @@ signet-rpc = { version = "0.12", path = "crates/rpc" }
4646
4747init4-bin-base = { version = " 0.13.1" , features = [" alloy" ] }
4848
49- signet-bundle = " 0.13 "
50- signet-constants = " 0.13 "
51- signet-evm = " 0.13 "
52- signet-extract = " 0.13 "
53- signet-test-utils = " 0.13 "
54- signet-tx-cache = " 0.13 "
55- signet-types = " 0.13 "
56- signet-zenith = " 0.13 "
57- signet-journal = " 0.13 "
49+ signet-bundle = " 0.14 "
50+ signet-constants = " 0.14 "
51+ signet-evm = " 0.14 "
52+ signet-extract = " 0.14 "
53+ signet-test-utils = " 0.14 "
54+ signet-tx-cache = " 0.14 "
55+ signet-types = " 0.14 "
56+ signet-zenith = " 0.14 "
57+ signet-journal = " 0.14 "
5858
5959# ajj
6060ajj = { version = " 0.3.4" }
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ pub(crate) mod metrics;
1616mod alias;
1717pub use alias:: { AliasOracle , AliasOracleFactory } ;
1818
19+ mod utils;
20+ pub use utils:: revm_spec;
21+
1922mod v1;
2023pub use v1:: SignetBlockProcessor as SignetBlockProcessorV1 ;
2124
Original file line number Diff line number Diff line change 1+ use reth:: revm:: primitives:: hardfork:: SpecId ;
2+ use reth_chainspec:: EthereumHardforks ;
3+
4+ /// Equivalent to [`reth_evm_ethereum::revm_spec`], however, always starts at
5+ /// [`SpecId::PRAGUE`] and transitions to [`SpecId::OSAKA`].
6+ pub fn revm_spec ( chain_spec : & reth:: chainspec:: ChainSpec , timestamp : u64 ) -> SpecId {
7+ if chain_spec. is_osaka_active_at_timestamp ( timestamp) { SpecId :: OSAKA } else { SpecId :: PRAGUE }
8+ }
9+
10+ /// This is simply a compile-time assertion to ensure that all SpecIds are
11+ /// covered in the match. When this fails to compile, it indicates that a new
12+ /// hardfork has been added and [`revm_spec`] needs to be updated.
13+ #[ allow( dead_code) ]
14+ const fn assert_in_range ( spec_id : SpecId ) {
15+ match spec_id {
16+ SpecId :: FRONTIER
17+ | SpecId :: FRONTIER_THAWING
18+ | SpecId :: HOMESTEAD
19+ | SpecId :: DAO_FORK
20+ | SpecId :: TANGERINE
21+ | SpecId :: SPURIOUS_DRAGON
22+ | SpecId :: BYZANTIUM
23+ | SpecId :: CONSTANTINOPLE
24+ | SpecId :: PETERSBURG
25+ | SpecId :: ISTANBUL
26+ | SpecId :: MUIR_GLACIER
27+ | SpecId :: BERLIN
28+ | SpecId :: LONDON
29+ | SpecId :: ARROW_GLACIER
30+ | SpecId :: GRAY_GLACIER
31+ | SpecId :: MERGE
32+ | SpecId :: SHANGHAI
33+ | SpecId :: CANCUN
34+ | SpecId :: PRAGUE
35+ | SpecId :: OSAKA => { }
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ use reth::{
1414 } ,
1515 revm:: { database:: StateProviderDatabase , db:: StateBuilder } ,
1616} ;
17- use reth_chainspec:: { ChainSpec , EthereumHardforks } ;
17+ use reth_chainspec:: ChainSpec ;
1818use reth_node_api:: { FullNodeComponents , NodeTypes } ;
1919use signet_blobber:: { CacheHandle , ExtractableChainShim } ;
2020use signet_constants:: SignetSystemConstants ;
8080
8181 /// Get the active spec id at the given timestamp.
8282 fn spec_id ( & self , timestamp : u64 ) -> SpecId {
83- if self . chain_spec . is_prague_active_at_timestamp ( timestamp) {
84- SpecId :: PRAGUE
85- } else {
86- SpecId :: CANCUN
87- }
83+ crate :: revm_spec ( & self . chain_spec , timestamp)
8884 }
8985
9086 /// Make a [`StateProviderDatabase`] from the read-write provider, suitable
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ serde.workspace = true
2828tracing.workspace = true
2929trevm.workspace = true
3030signet-genesis.workspace = true
31+ signet-block-processor.workspace = true
3132
3233[features ]
3334test_utils = [" dep:reth-db" , " reth-db/test-utils" ]
Original file line number Diff line number Diff line change 11use alloy:: genesis:: Genesis ;
22use init4_bin_base:: utils:: { calc:: SlotCalculator , from_env:: FromEnv } ;
33use reth:: providers:: providers:: StaticFileProvider ;
4- use reth_chainspec:: { ChainSpec , EthereumHardforks } ;
4+ use reth_chainspec:: ChainSpec ;
55use reth_node_api:: NodePrimitives ;
66use signet_blobber:: BlobFetcherConfig ;
77use signet_genesis:: GenesisSpec ;
@@ -215,11 +215,7 @@ impl SignetNodeConfig {
215215
216216 /// Get the current spec id for the Signet Node chain.
217217 pub fn spec_id ( & self , timestamp : u64 ) -> SpecId {
218- if self . chain_spec ( ) . is_prague_active_at_timestamp ( timestamp) {
219- SpecId :: PRAGUE
220- } else {
221- SpecId :: CANCUN
222- }
218+ signet_block_processor:: revm_spec ( self . chain_spec ( ) , timestamp)
223219 }
224220}
225221
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ reth.workspace = true
2727reth-chainspec.workspace = true
2828reth-db.workspace = true
2929reth-db-common.workspace = true
30- reth-evm-ethereum.workspace = true
3130reth-node-api.workspace = true
3231reth-rpc-eth-api.workspace = true
3332
@@ -45,6 +44,7 @@ tracing.workspace = true
4544serde_json.workspace = true
4645futures-util = " 0.3.31"
4746itertools.workspace = true
47+ signet-block-processor.workspace = true
4848
4949[dev-dependencies ]
5050signet-zenith.workspace = true
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ where
173173
174174 /// Get the EVM spec ID for a given block.
175175 pub fn evm_spec_id ( & self , header : & Header ) -> SpecId {
176- reth_evm_ethereum :: revm_spec ( & self . chain_spec ( ) , header)
176+ signet_block_processor :: revm_spec ( & self . chain_spec ( ) , header. timestamp ( ) )
177177 }
178178
179179 /// Access the subscription manager.
You can’t perform that action at this time.
0 commit comments