Skip to content

Commit

Permalink
remove Sepolia variant
Browse files Browse the repository at this point in the history
  • Loading branch information
leruaa committed Jan 22, 2025
1 parent bcb08ee commit 6f15be9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 76 deletions.
1 change: 0 additions & 1 deletion bin/host/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ async fn main() -> eyre::Result<()> {
ChainVariant::Ethereum(_) => include_elf!("rsp-client-eth"),
ChainVariant::Optimism(_) => include_elf!("rsp-client-op"),
ChainVariant::Linea(_) => include_elf!("rsp-client-linea"),
ChainVariant::Sepolia(_) => include_elf!("rsp-client-sepolia"),
});

// Execute the block inside the zkVM.
Expand Down
15 changes: 0 additions & 15 deletions crates/executor/client/src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,6 @@ impl ConfigureEvm for CustomEvmConfig {
.append_handler_register(Self::set_precompiles)
.build()
}
ChainVariant::Sepolia(_) => {
EvmBuilder::default()
.with_db(db)
// add additional precompiles
.append_handler_register(Self::set_precompiles)
.build()
}
}
}

Expand All @@ -167,9 +160,6 @@ impl ConfigureEvmEnv for CustomEvmConfig {
ChainVariant::Linea(_) => {
EthEvmConfig::default().fill_tx_env(tx_env, transaction, sender)
}
ChainVariant::Sepolia(_) => {
EthEvmConfig::default().fill_tx_env(tx_env, transaction, sender)
}
}
}

Expand All @@ -193,9 +183,6 @@ impl ConfigureEvmEnv for CustomEvmConfig {
ChainVariant::Linea(_) => {
EthEvmConfig::default().fill_cfg_env(cfg_env, chain_spec, header, total_difficulty)
}
ChainVariant::Sepolia(_) => {
EthEvmConfig::default().fill_cfg_env(cfg_env, chain_spec, header, total_difficulty)
}
}
}

Expand All @@ -213,8 +200,6 @@ impl ConfigureEvmEnv for CustomEvmConfig {
.fill_tx_env_system_contract_call(env, caller, contract, data),
ChainVariant::Linea(_) => EthEvmConfig::default()
.fill_tx_env_system_contract_call(env, caller, contract, data),
ChainVariant::Sepolia(_) => EthEvmConfig::default()
.fill_tx_env_system_contract_call(env, caller, contract, data),
}
}
}
Expand Down
64 changes: 4 additions & 60 deletions crates/executor/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,6 @@ impl LineaVariant {
}
}

/// Implementation for Sepolia-specific execution/validation logic.
#[derive(Debug, Clone)]
pub struct SepoliaVariant {
pub spec: ChainSpec,
}

impl SepoliaVariant {
/// Creates a new Sepolia variant.
pub fn new(spec: ChainSpec) -> Self {
Self { spec }
}
}

/// EVM chain variants that implement different execution/validation rules.
#[derive(Debug, Clone)]
pub enum ChainVariant {
Expand All @@ -132,8 +119,6 @@ pub enum ChainVariant {
Optimism(OptimismVariant),
/// Linea networks.
Linea(LineaVariant),
/// Testnets
Sepolia(SepoliaVariant),
}

impl ChainVariant {
Expand All @@ -142,15 +127,15 @@ impl ChainVariant {
CHAIN_ID_ETH_MAINNET => {
Ok(Self::Ethereum(EthereumVariant::new(rsp_primitives::chain_spec::mainnet())))
}
CHAIN_ID_SEPOLIA => {
Ok(Self::Ethereum(EthereumVariant::new(rsp_primitives::chain_spec::sepolia())))
}
CHAIN_ID_OP_MAINNET => {
Ok(Self::Optimism(OptimismVariant::new(rsp_primitives::chain_spec::op_mainnet())))
}
CHAIN_ID_LINEA_MAINNET => {
Ok(Self::Linea(LineaVariant::new(rsp_primitives::chain_spec::linea_mainnet())))
}
CHAIN_ID_SEPOLIA => {
Ok(Self::Sepolia(SepoliaVariant::new(rsp_primitives::chain_spec::sepolia())))
}
_ => Err(ClientError::UnknownChainId(chain_id)),
}
}
Expand All @@ -164,7 +149,7 @@ impl ChainVariant {
let reader = BufReader::new(file);
let genesis = serde_json::from_reader::<_, Genesis>(reader)?;

Ok(Self::from_genesis(genesis.into()))
Ok(Self::from_genesis(genesis))
}

pub fn mainnet() -> Self {
Expand All @@ -189,7 +174,6 @@ impl ChainVariant {
ChainVariant::Ethereum(v) => v.spec.genesis.config.chain_id,
ChainVariant::Optimism(v) => v.spec.genesis.config.chain_id,
ChainVariant::Linea(v) => v.spec.genesis.config.chain_id,
ChainVariant::Sepolia(v) => v.spec.genesis.config.chain_id,
}
}

Expand All @@ -198,7 +182,6 @@ impl ChainVariant {
ChainVariant::Ethereum(v) => v.spec.genesis.clone(),
ChainVariant::Optimism(v) => v.spec.genesis.clone(),
ChainVariant::Linea(v) => v.spec.genesis.clone(),
ChainVariant::Sepolia(v) => v.spec.genesis.clone(),
}
}
}
Expand All @@ -223,9 +206,6 @@ impl Variant for ChainVariant {
ChainVariant::Linea(v) => {
v.execute(executor_block_input, executor_difficulty, cache_db)
}
ChainVariant::Sepolia(v) => {
v.execute(executor_block_input, executor_difficulty, cache_db)
}
}
}

Expand All @@ -239,7 +219,6 @@ impl Variant for ChainVariant {
ChainVariant::Ethereum(v) => v.validate_block_post_execution(block, receipts, requests),
ChainVariant::Optimism(v) => v.validate_block_post_execution(block, receipts, requests),
ChainVariant::Linea(v) => v.validate_block_post_execution(block, receipts, requests),
ChainVariant::Sepolia(v) => v.validate_block_post_execution(block, receipts, requests),
}
}

Expand All @@ -248,7 +227,6 @@ impl Variant for ChainVariant {
ChainVariant::Ethereum(v) => v.pre_process_block(block),
ChainVariant::Optimism(v) => v.pre_process_block(block),
ChainVariant::Linea(v) => v.pre_process_block(block),
ChainVariant::Sepolia(v) => v.pre_process_block(block),
}
}
}
Expand Down Expand Up @@ -455,37 +433,3 @@ impl From<LineaVariant> for ChainVariant {
Self::Linea(v)
}
}

impl Variant for SepoliaVariant {
fn execute<DB>(
&self,
executor_block_input: &BlockWithSenders,
executor_difficulty: U256,
cache_db: DB,
) -> Result<BlockExecutionOutput<Receipt>, BlockExecutionError>
where
DB: Database<Error: Into<ProviderError> + Display>,
{
EthExecutorProvider::new(
self.spec.clone().into(),
CustomEvmConfig::from_variant(self.clone().into()),
)
.executor(cache_db)
.execute((executor_block_input, executor_difficulty).into())
}

fn validate_block_post_execution(
&self,
block: &BlockWithSenders,
receipts: &[Receipt],
requests: &[Request],
) -> Result<(), ConsensusError> {
validate_block_post_execution_ethereum(block, &self.spec, receipts, requests)
}
}

impl From<SepoliaVariant> for ChainVariant {
fn from(v: SepoliaVariant) -> Self {
Self::Sepolia(v)
}
}

0 comments on commit 6f15be9

Please sign in to comment.