mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: use SealedHeader in ChainSpec (#14514)
This commit is contained in:
@ -23,4 +23,5 @@ tokio-stream.workspace = true
|
||||
|
||||
serde_json.workspace = true
|
||||
|
||||
alloy-genesis.workspace = true
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
@ -1,33 +1,14 @@
|
||||
use alloy_primitives::{b256, B256};
|
||||
use reth_chainspec::{
|
||||
once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork,
|
||||
ForkCondition, Hardfork,
|
||||
};
|
||||
use alloy_genesis::Genesis;
|
||||
use reth_chainspec::ChainSpec;
|
||||
use reth_network_peers::NodeRecord;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
pub const SHANGHAI_TIME: u64 = 1705996800;
|
||||
|
||||
pub(crate) fn bsc_chain_spec() -> Arc<ChainSpec> {
|
||||
const GENESIS: B256 = b256!("0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b");
|
||||
|
||||
ChainSpec {
|
||||
chain: Chain::from_id(56),
|
||||
genesis: serde_json::from_str(include_str!("./genesis.json")).expect("deserialize genesis"),
|
||||
genesis_hash: once_cell_set(GENESIS),
|
||||
genesis_header: Default::default(),
|
||||
paris_block_and_final_difficulty: None,
|
||||
hardforks: ChainHardforks::new(vec![(
|
||||
EthereumHardfork::Shanghai.boxed(),
|
||||
ForkCondition::Timestamp(SHANGHAI_TIME),
|
||||
)]),
|
||||
deposit_contract: None,
|
||||
base_fee_params: reth_chainspec::BaseFeeParamsKind::Constant(BaseFeeParams::ethereum()),
|
||||
prune_delete_limit: 0,
|
||||
blob_params: Default::default(),
|
||||
}
|
||||
.into()
|
||||
let genesis: Genesis =
|
||||
serde_json::from_str(include_str!("./genesis.json")).expect("deserialize genesis");
|
||||
Arc::new(genesis.into())
|
||||
}
|
||||
|
||||
/// BSC mainnet bootnodes <https://github.com/bnb-chain/bsc/blob/master/params/bootnodes.go#L23>
|
||||
|
||||
@ -19,3 +19,4 @@ reth-tracing.workspace = true
|
||||
tokio-stream.workspace = true
|
||||
reth-discv4 = { workspace = true, features = ["test-utils"] }
|
||||
alloy-primitives.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
use alloy_primitives::{b256, B256};
|
||||
use reth_chainspec::{
|
||||
once_cell_set, BaseFeeParams, Chain, ChainHardforks, ChainSpec, EthereumHardfork,
|
||||
ForkCondition, Hardfork,
|
||||
};
|
||||
use alloy_genesis::Genesis;
|
||||
use reth_chainspec::ChainSpec;
|
||||
use reth_discv4::NodeRecord;
|
||||
use reth_primitives::Head;
|
||||
|
||||
@ -11,29 +8,9 @@ use std::sync::Arc;
|
||||
const SHANGHAI_BLOCK: u64 = 50523000;
|
||||
|
||||
pub(crate) fn polygon_chain_spec() -> Arc<ChainSpec> {
|
||||
const GENESIS: B256 = b256!("a9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b");
|
||||
|
||||
ChainSpec {
|
||||
chain: Chain::from_id(137),
|
||||
// <https://github.com/maticnetwork/bor/blob/d521b8e266b97efe9c8fdce8167e9dd77b04637d/builder/files/genesis-mainnet-v1.json>
|
||||
genesis: serde_json::from_str(include_str!("./genesis.json")).expect("deserialize genesis"),
|
||||
genesis_hash: once_cell_set(GENESIS),
|
||||
genesis_header: Default::default(),
|
||||
paris_block_and_final_difficulty: None,
|
||||
hardforks: ChainHardforks::new(vec![
|
||||
(EthereumHardfork::Petersburg.boxed(), ForkCondition::Block(0)),
|
||||
(EthereumHardfork::Istanbul.boxed(), ForkCondition::Block(3395000)),
|
||||
(EthereumHardfork::MuirGlacier.boxed(), ForkCondition::Block(3395000)),
|
||||
(EthereumHardfork::Berlin.boxed(), ForkCondition::Block(14750000)),
|
||||
(EthereumHardfork::London.boxed(), ForkCondition::Block(23850000)),
|
||||
(EthereumHardfork::Shanghai.boxed(), ForkCondition::Block(SHANGHAI_BLOCK)),
|
||||
]),
|
||||
deposit_contract: None,
|
||||
base_fee_params: reth_chainspec::BaseFeeParamsKind::Constant(BaseFeeParams::ethereum()),
|
||||
prune_delete_limit: 0,
|
||||
blob_params: Default::default(),
|
||||
}
|
||||
.into()
|
||||
let genesis: Genesis =
|
||||
serde_json::from_str(include_str!("./genesis.json")).expect("deserialize genesis");
|
||||
Arc::new(genesis.into())
|
||||
}
|
||||
|
||||
/// Polygon mainnet boot nodes <https://github.com/maticnetwork/bor/blob/master/params/bootnodes.go#L79>
|
||||
|
||||
Reference in New Issue
Block a user