feat: update genesis for holesky (#4773)

This commit is contained in:
Dan Cline
2023-09-25 16:33:15 -04:00
committed by GitHub
parent 272f06216a
commit 1f33cb5e1b
3 changed files with 25 additions and 15 deletions

View File

@ -10,14 +10,9 @@ use std::{
/// Constructs a string to be used as a path for configuration and db paths. /// Constructs a string to be used as a path for configuration and db paths.
pub fn config_path_prefix(chain: Chain) -> String { pub fn config_path_prefix(chain: Chain) -> String {
if chain == Chain::mainnet() { match chain {
"mainnet".to_string() Chain::Named(name) => name.to_string(),
} else if chain == Chain::goerli() { Chain::Id(id) => id.to_string(),
"goerli".to_string()
} else if chain == Chain::sepolia() {
"sepolia".to_string()
} else {
chain.id().to_string()
} }
} }
@ -325,4 +320,19 @@ mod tests {
let path = path.unwrap_or_chain_default(Chain::mainnet()); let path = path.unwrap_or_chain_default(Chain::mainnet());
assert!(path.as_ref().ends_with("my/path/to/datadir"), "{:?}", path); assert!(path.as_ref().ends_with("my/path/to/datadir"), "{:?}", path);
} }
#[test]
fn test_maybe_testnet_datadir_path() {
let path = MaybePlatformPath::<DataDirPath>::default();
let path = path.unwrap_or_chain_default(Chain::goerli());
assert!(path.as_ref().ends_with("reth/goerli"), "{:?}", path);
let path = MaybePlatformPath::<DataDirPath>::default();
let path = path.unwrap_or_chain_default(Chain::holesky());
assert!(path.as_ref().ends_with("reth/holesky"), "{:?}", path);
let path = MaybePlatformPath::<DataDirPath>::default();
let path = path.unwrap_or_chain_default(Chain::sepolia());
assert!(path.as_ref().ends_with("reth/sepolia"), "{:?}", path);
}
} }

View File

@ -1,10 +1,10 @@
{ {
"nonce": "0x1234", "nonce": "0x1234",
"timestamp": "1694786100", "timestamp": "1695902100",
"extraData": "", "extraData": "",
"gasLimit": "0x17D7840", "gasLimit": "0x17D7840",
"difficulty": "0x01", "difficulty": "0x01",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000",
"stateRoot": "0x69d8c9d72f6fa4ad42d4702b433707212f90db395eb54dc20bc85de253788783", "stateRoot": "0x69d8c9d72f6fa4ad42d4702b433707212f90db395eb54dc20bc85de253788783",
"alloc": { "alloc": {

View File

@ -164,10 +164,10 @@ pub static HOLESKY: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
genesis: serde_json::from_str(include_str!("../../res/genesis/holesky.json")) genesis: serde_json::from_str(include_str!("../../res/genesis/holesky.json"))
.expect("Can't deserialize Holesky genesis json"), .expect("Can't deserialize Holesky genesis json"),
genesis_hash: Some(H256(hex!( genesis_hash: Some(H256(hex!(
"fd91bb7c01ae3f608b4d176078ca72bc7846791fdc02324481ca315ede4c9246" "b5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4"
))), ))),
paris_block_and_final_difficulty: Some((0, U256::from(1))), paris_block_and_final_difficulty: Some((0, U256::from(1))),
fork_timestamps: ForkTimestamps::default().shanghai(1694790240), fork_timestamps: ForkTimestamps::default().shanghai(1696000704),
hardforks: BTreeMap::from([ hardforks: BTreeMap::from([
(Hardfork::Frontier, ForkCondition::Block(0)), (Hardfork::Frontier, ForkCondition::Block(0)),
(Hardfork::Homestead, ForkCondition::Block(0)), (Hardfork::Homestead, ForkCondition::Block(0)),
@ -183,9 +183,9 @@ pub static HOLESKY: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
(Hardfork::London, ForkCondition::Block(0)), (Hardfork::London, ForkCondition::Block(0)),
( (
Hardfork::Paris, Hardfork::Paris,
ForkCondition::TTD { fork_block: None, total_difficulty: U256::ZERO }, ForkCondition::TTD { fork_block: Some(0), total_difficulty: U256::ZERO },
), ),
(Hardfork::Shanghai, ForkCondition::Timestamp(1694790240)), (Hardfork::Shanghai, ForkCondition::Timestamp(1696000704)),
]), ]),
deposit_contract: Some(DepositContract::new( deposit_contract: Some(DepositContract::new(
H160(hex!("4242424242424242424242424242424242424242")), H160(hex!("4242424242424242424242424242424242424242")),
@ -839,7 +839,7 @@ pub enum ForkCondition {
/// The block number at which TTD is reached, if it is known. /// The block number at which TTD is reached, if it is known.
/// ///
/// This should **NOT** be set unless you want this block advertised as [EIP-2124][eip2124] /// This should **NOT** be set unless you want this block advertised as [EIP-2124][eip2124]
/// `FORK_NEXT`. This is currently only the case for Sepolia. /// `FORK_NEXT`. This is currently only the case for Sepolia and Holesky.
/// ///
/// [eip2124]: https://eips.ethereum.org/EIPS/eip-2124 /// [eip2124]: https://eips.ethereum.org/EIPS/eip-2124
fork_block: Option<BlockNumber>, fork_block: Option<BlockNumber>,