Skip to content

Commit

Permalink
feat: sepolia and holesky dencun configs (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncitron authored Jan 30, 2024
1 parent 4ca6146 commit c49c12a
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion config/src/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub enum Network {
MAINNET,
GOERLI,
SEPOLIA,
HOLESKY,
}

impl FromStr for Network {
Expand All @@ -30,6 +31,7 @@ impl FromStr for Network {
"mainnet" => Ok(Self::MAINNET),
"goerli" => Ok(Self::GOERLI),
"sepolia" => Ok(Self::SEPOLIA),
"holesky" => Ok(Self::HOLESKY),
_ => Err(eyre::eyre!("network not recognized")),
}
}
Expand All @@ -41,6 +43,7 @@ impl Display for Network {
Self::MAINNET => "mainnet",
Self::GOERLI => "goerli",
Self::SEPOLIA => "sepolia",
Self::HOLESKY => "holesky",
};

f.write_str(str)
Expand All @@ -53,6 +56,7 @@ impl Network {
Self::MAINNET => mainnet(),
Self::GOERLI => goerli(),
Self::SEPOLIA => sepolia(),
Self::HOLESKY => holesky(),
}
}

Expand Down Expand Up @@ -189,7 +193,7 @@ pub fn sepolia() -> BaseConfig {
fork_version: hex_str_to_bytes("0x90000072").unwrap(),
},
deneb: Fork {
epoch: u64::MAX,
epoch: 132608,
fork_version: hex_str_to_bytes("0x90000073").unwrap(),
},
},
Expand All @@ -200,6 +204,51 @@ pub fn sepolia() -> BaseConfig {
}
}

pub fn holesky() -> BaseConfig {
BaseConfig {
default_checkpoint: hex_str_to_bytes(
"0xd8fad84478f4947c3d09cfefde36d09bb9e71217f650610a3eb730eba54cdf1f",
)
.unwrap(),
rpc_port: 8545,
consensus_rpc: None,
chain: ChainConfig {
chain_id: 17000,
genesis_time: 1695902400,
genesis_root: hex_str_to_bytes(
"0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1",
)
.unwrap(),
},
forks: Forks {
genesis: Fork {
epoch: 0,
fork_version: hex_str_to_bytes("0x01017000").unwrap(),
},
altair: Fork {
epoch: 0,
fork_version: hex_str_to_bytes("0x02017000").unwrap(),
},
bellatrix: Fork {
epoch: 0,
fork_version: hex_str_to_bytes("0x03017000").unwrap(),
},
capella: Fork {
epoch: 256,
fork_version: hex_str_to_bytes("0x04017000").unwrap(),
},
deneb: Fork {
epoch: 29696,
fork_version: hex_str_to_bytes("0x05017000").unwrap(),
},
},
max_checkpoint_age: 1_209_600, // 14 days
#[cfg(not(target_arch = "wasm32"))]
data_dir: Some(data_dir(Network::HOLESKY)),
..std::default::Default::default()
}
}

#[cfg(not(target_arch = "wasm32"))]
fn data_dir(network: Network) -> PathBuf {
home_dir()
Expand Down

0 comments on commit c49c12a

Please sign in to comment.