feat: base sepolia support (#5697)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Chomtana
2023-12-28 02:25:39 +07:00
committed by GitHub
parent 68b174e088
commit ed774e9a81
6 changed files with 15374 additions and 5 deletions

View File

@ -10,14 +10,14 @@ use std::{
};
#[cfg(feature = "optimism")]
use reth_primitives::{BASE_GOERLI, BASE_MAINNET};
use reth_primitives::{BASE_GOERLI, BASE_MAINNET, BASE_SEPOLIA};
#[cfg(not(feature = "optimism"))]
use reth_primitives::{DEV, GOERLI, HOLESKY, MAINNET, SEPOLIA};
#[cfg(feature = "optimism")]
/// Chains supported by op-reth. First value should be used as the default.
pub const SUPPORTED_CHAINS: &[&str] = &["base", "base_goerli"];
pub const SUPPORTED_CHAINS: &[&str] = &["base", "base_goerli", "base_sepolia"];
#[cfg(not(feature = "optimism"))]
/// Chains supported by reth. First value should be used as the default.
pub const SUPPORTED_CHAINS: &[&str] = &["mainnet", "sepolia", "goerli", "holesky", "dev"];
@ -45,6 +45,8 @@ pub fn chain_spec_value_parser(s: &str) -> eyre::Result<Arc<ChainSpec>, eyre::Er
#[cfg(feature = "optimism")]
"base_goerli" | "base-goerli" => BASE_GOERLI.clone(),
#[cfg(feature = "optimism")]
"base_sepolia" | "base-sepolia" => BASE_SEPOLIA.clone(),
#[cfg(feature = "optimism")]
"base" => BASE_MAINNET.clone(),
_ => {
let raw = fs::read_to_string(PathBuf::from(shellexpand::full(s)?.into_owned()))?;
@ -78,6 +80,8 @@ pub fn genesis_value_parser(s: &str) -> eyre::Result<Arc<ChainSpec>, eyre::Error
#[cfg(feature = "optimism")]
"base_goerli" | "base-goerli" => BASE_GOERLI.clone(),
#[cfg(feature = "optimism")]
"base_sepolia" | "base-sepolia" => BASE_SEPOLIA.clone(),
#[cfg(feature = "optimism")]
"base" => BASE_MAINNET.clone(),
_ => {
// try to read json from path first