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

@ -41,9 +41,6 @@ alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true
revm.workspace = true
# optimism
reth-optimism-primitives = { workspace = true, features = ["reth-codec"], optional = true }
# async
tokio = { workspace = true, features = ["sync", "macros", "rt-multi-thread"] }
@ -85,15 +82,6 @@ eyre.workspace = true
alloy-consensus.workspace = true
[features]
optimism = [
"reth-execution-types/optimism",
"reth-optimism-primitives",
"reth-codecs/op",
"reth-db/optimism",
"reth-db-api/optimism",
"revm/optimism",
"reth-optimism-primitives/optimism",
]
serde = [
"dashmap/serde",
"notify/serde",
@ -105,7 +93,6 @@ serde = [
"alloy-rpc-types-engine/serde",
"revm/serde",
"reth-codecs/serde",
"reth-optimism-primitives?/serde",
"reth-primitives-traits/serde",
"reth-execution-types/serde",
"reth-trie-db/serde",
@ -128,5 +115,4 @@ test-utils = [
"revm/test-utils",
"reth-prune-types/test-utils",
"reth-stages-types/test-utils",
"reth-optimism-primitives?/arbitrary",
]

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.");