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:
Emilia Hane
2024-07-23 23:12:07 +02:00
committed by GitHub
parent f3cd39ef90
commit b2b3ff8128
3 changed files with 12 additions and 4 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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() {