perf: improve genesis handling (#10878)

This commit is contained in:
DaniPopes
2024-09-13 19:48:44 +02:00
committed by GitHub
parent 75c6295d29
commit b23bb7e8bc
24 changed files with 121 additions and 120 deletions

View File

@ -1,5 +1,5 @@
use reth_chainspec::{
BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition,
once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork, ForkCondition,
};
use reth_network_peers::NodeRecord;
use reth_primitives::{b256, B256};
@ -14,7 +14,8 @@ pub(crate) fn bsc_chain_spec() -> Arc<ChainSpec> {
ChainSpec {
chain: Chain::from_id(56),
genesis: serde_json::from_str(include_str!("./genesis.json")).expect("deserialize genesis"),
genesis_hash: Some(GENESIS),
genesis_hash: once_cell_set(GENESIS),
genesis_header: Default::default(),
paris_block_and_final_difficulty: None,
hardforks: ChainHardforks::new(vec![(
EthereumHardfork::Shanghai.boxed(),