chore: rm optimism feature from reth-provider (#14035)

This commit is contained in:
Matthias Seitz
2025-01-28 14:31:26 +01:00
committed by GitHub
parent 0f2e2faeda
commit 5cf0276f1e
11 changed files with 19 additions and 34 deletions

View File

@ -9,11 +9,13 @@ use crate::{
};
use alloy_consensus::{transaction::TransactionMeta, Header};
use alloy_eips::{eip2718::Encodable2718, eip4895::Withdrawals, BlockHashOrNumber};
use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256};
use alloy_primitives::{
b256, keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256,
};
use dashmap::DashMap;
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
use parking_lot::RwLock;
use reth_chainspec::{ChainInfo, ChainSpecProvider};
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthChainSpec};
use reth_db::{
lockfile::StorageLock,
static_file::{
@ -655,17 +657,18 @@ impl<N: NodePrimitives> StaticFileProvider<N> {
//
// If we detect an OVM import was done (block #1 <https://optimistic.etherscan.io/block/1>), skip it.
// More on [#11099](https://github.com/paradigmxyz/reth/pull/11099).
#[cfg(feature = "optimism")]
if reth_chainspec::EthChainSpec::chain(&provider.chain_spec()) ==
reth_chainspec::Chain::optimism_mainnet() &&
provider
.block_number(reth_optimism_primitives::bedrock::OVM_HEADER_1_HASH)?
.is_some()
if provider.chain_spec().is_optimism() &&
reth_chainspec::Chain::optimism_mainnet() == provider.chain_spec().chain_id()
{
info!(target: "reth::cli",
"Skipping storage verification for OP mainnet, expected inconsistency in OVM chain"
);
return Ok(None)
// check whether we have the first OVM block: <https://optimistic.etherscan.io/block/0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453>
const OVM_HEADER_1_HASH: B256 =
b256!("bee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453");
if provider.block_number(OVM_HEADER_1_HASH)?.is_some() {
info!(target: "reth::cli",
"Skipping storage verification for OP mainnet, expected inconsistency in OVM chain"
);
return Ok(None)
}
}
info!(target: "reth::cli", "Verifying storage consistency.");