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

1
Cargo.lock generated
View File

@ -8622,7 +8622,6 @@ dependencies = [
"reth-network-p2p",
"reth-nippy-jar",
"reth-node-types",
"reth-optimism-primitives",
"reth-primitives",
"reth-primitives-traits",
"reth-prune-types",

View File

@ -53,6 +53,5 @@ tracing.workspace = true
[features]
optimism = [
"reth-provider/optimism",
"revm-primitives/optimism",
]

View File

@ -75,7 +75,6 @@ tempfile.workspace = true
optimism = [
"reth-db?/optimism",
"reth-db-api?/optimism",
"reth-provider/optimism",
]
test-utils = [

View File

@ -44,7 +44,6 @@ optimism = [
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"reth-optimism-rpc/optimism",
"reth-provider/optimism",
"reth-optimism-primitives/optimism",
]

View File

@ -77,7 +77,6 @@ optimism = [
"dep:derive_more",
"dep:serde",
"reth-optimism-evm/optimism",
"reth-provider/optimism",
"reth-node-core/optimism",
"reth-optimism-node/optimism",
"reth-execution-types/optimism",

View File

@ -90,7 +90,6 @@ futures.workspace = true
[features]
default = ["reth-codec"]
optimism = [
"reth-provider/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"revm/optimism",

View File

@ -55,7 +55,6 @@ sha2.workspace = true
[features]
optimism = [
"reth-provider/optimism",
"reth-optimism-evm/optimism",
"revm/optimism",
"reth-execution-types/optimism",

View File

@ -55,10 +55,14 @@ pub fn is_dup_tx(block_number: u64) -> bool {
}
/// OVM Header #1 hash.
///
/// <https://optimistic.etherscan.io/block/0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453>
pub const OVM_HEADER_1_HASH: B256 =
b256!("bee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453");
/// Bedrock hash on Optimism Mainnet.
///
/// <https://optimistic.etherscan.io/block/0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3>
pub const BEDROCK_HEADER_HASH: B256 =
b256!("dbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3");

View File

@ -70,7 +70,6 @@ reth-optimism-chainspec.workspace = true
[features]
optimism = [
"reth-optimism-evm/optimism",
"reth-provider/optimism",
"revm/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-payload-builder/optimism",

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