Skip to content

Commit

Permalink
chore: reuse build_import_pipeline for OP (#13529)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Dec 23, 2024
1 parent 8579c08 commit 5ea8f31
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 117 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions crates/optimism/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ reth-optimism-primitives.workspace = true
reth-optimism-chainspec.workspace = true

reth-chainspec.workspace = true
reth-stages-types.workspace = true
reth-node-events.workspace = true
reth-network-p2p.workspace = true
reth-errors.workspace = true
reth-config.workspace = true
reth-optimism-evm.workspace = true
reth-cli.workspace = true
reth-cli-runner.workspace = true
Expand Down
101 changes: 0 additions & 101 deletions crates/optimism/cli/src/commands/build_pipeline.rs

This file was deleted.

14 changes: 8 additions & 6 deletions crates/optimism/cli/src/commands/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
//! file.
use clap::Parser;
use reth_cli::chainspec::ChainSpecParser;
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
use reth_cli_commands::{
common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs},
import::build_import_pipeline,
};
use reth_consensus::noop::NoopConsensus;
use reth_db::tables;
use reth_db_api::transaction::DbTx;
Expand All @@ -11,16 +14,15 @@ use reth_downloaders::file_client::{
};
use reth_node_core::version::SHORT_VERSION;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_evm::OpExecutorProvider;
use reth_optimism_primitives::bedrock::is_dup_tx;
use reth_provider::StageCheckpointReader;
use reth_provider::{ChainSpecProvider, StageCheckpointReader};
use reth_prune::PruneModes;
use reth_stages::StageId;
use reth_static_file::StaticFileProducer;
use std::{path::PathBuf, sync::Arc};
use tracing::{debug, error, info};

use crate::commands::build_pipeline::build_import_pipeline;

/// Syncs RLP encoded blocks from a file.
#[derive(Debug, Parser)]
pub struct ImportOpCommand<C: ChainSpecParser> {
Expand Down Expand Up @@ -94,8 +96,8 @@ impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> ImportOpCommand<C> {
Arc::new(file_client),
StaticFileProducer::new(provider_factory.clone(), PruneModes::default()),
true,
)
.await?;
OpExecutorProvider::optimism(provider_factory.chain_spec()),
)?;

// override the tip
pipeline.set_tip(tip);
Expand Down
2 changes: 0 additions & 2 deletions crates/optimism/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use reth_cli_commands::{
};
use std::fmt;

/// Helper function to build an import pipeline.
mod build_pipeline;
pub mod import;
pub mod import_receipts;
pub mod init_state;
Expand Down

0 comments on commit 5ea8f31

Please sign in to comment.