mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix(op):skip db consistency check for op mainnet (#9737)
Co-authored-by: Russel Waters <6511720+argakiig@users.noreply.github.com>
This commit is contained in:
@@ -114,8 +114,6 @@ impl EnvironmentArgs {
|
||||
let factory = ProviderFactory::new(db, self.chain.clone(), static_file_provider)
|
||||
.with_prune_modes(prune_modes.clone());
|
||||
|
||||
info!(target: "reth::cli", "Verifying storage consistency.");
|
||||
|
||||
// Check for consistency between database and static files.
|
||||
if let Some(unwind_target) = factory
|
||||
.static_file_provider()
|
||||
|
||||
@@ -371,8 +371,6 @@ where
|
||||
let has_receipt_pruning =
|
||||
self.toml_config().prune.as_ref().map_or(false, |a| a.has_receipts_pruning());
|
||||
|
||||
info!(target: "reth::cli", "Verifying storage consistency.");
|
||||
|
||||
// Check for consistency between database and static files. If it fails, it unwinds to
|
||||
// the first block that's consistent between database and static files.
|
||||
if let Some(unwind_target) = factory
|
||||
|
||||
@@ -532,6 +532,18 @@ impl StaticFileProvider {
|
||||
provider: &DatabaseProvider<TX>,
|
||||
has_receipt_pruning: bool,
|
||||
) -> ProviderResult<Option<PipelineTarget>> {
|
||||
// OVM chain contains duplicate transactions, so is inconsistent by default since reth db
|
||||
// not designed for duplicate transactions (see <https://github.com/paradigmxyz/reth/blob/v1.0.3/crates/optimism/primitives/src/bedrock_import.rs>). Undefined behaviour for queries
|
||||
// to OVM chain is also in op-erigon.
|
||||
if provider.chain_spec().is_optimism_mainnet() {
|
||||
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.");
|
||||
|
||||
let mut unwind_target: Option<BlockNumber> = None;
|
||||
let mut update_unwind_target = |new_target: BlockNumber| {
|
||||
if let Some(target) = unwind_target.as_mut() {
|
||||
|
||||
Reference in New Issue
Block a user