chore: remove prune_modes from BlockWriter (#9231)

This commit is contained in:
Dan Cline
2024-07-02 15:40:07 -04:00
committed by GitHub
parent e95c6dba9d
commit 405b730455
19 changed files with 105 additions and 117 deletions

View File

@ -109,7 +109,10 @@ impl EnvironmentArgs {
static_file_provider: StaticFileProvider,
) -> eyre::Result<ProviderFactory<Arc<DatabaseEnv>>> {
let has_receipt_pruning = config.prune.as_ref().map_or(false, |a| a.has_receipts_pruning());
let factory = ProviderFactory::new(db, self.chain.clone(), static_file_provider);
let prune_modes =
config.prune.as_ref().map(|prune| prune.segments.clone()).unwrap_or_default();
let factory = ProviderFactory::new(db, self.chain.clone(), static_file_provider)
.with_prune_modes(prune_modes.clone());
info!(target: "reth::cli", "Verifying storage consistency.");
@ -123,8 +126,6 @@ impl EnvironmentArgs {
return Ok(factory)
}
let prune_modes = config.prune.clone().map(|prune| prune.segments).unwrap_or_default();
// Highly unlikely to happen, and given its destructive nature, it's better to panic
// instead.
assert_ne!(unwind_target, PipelineTarget::Unwind(0), "A static file <> database inconsistency was found that would trigger an unwind to block 0");