Skip to content

Commit

Permalink
chore(crates): deprecate staged-sync (paradigmxyz#3564)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evalir authored Jul 4, 2023
1 parent b4801f9 commit a743146
Show file tree
Hide file tree
Showing 21 changed files with 11 additions and 192 deletions.
40 changes: 0 additions & 40 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ members = [
"crates/rpc/rpc-engine-api",
"crates/rpc/rpc-types",
"crates/rpc/rpc-testing-util",
"crates/staged-sync",
"crates/stages",
"crates/storage/codecs",
"crates/storage/db",
Expand Down
1 change: 0 additions & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ reth-db = { path = "../../crates/storage/db", features = ["mdbx", "test-utils"]
reth-provider = { workspace = true, features = ["test-utils"] }
reth-revm = { path = "../../crates/revm" }
reth-revm-inspectors = { path = "../../crates/revm/revm-inspectors" }
reth-staged-sync = { path = "../../crates/staged-sync" }
reth-stages = { path = "../../crates/stages" }
reth-interfaces = { workspace = true, features = ["test-utils", "clap"] }
reth-transaction-pool = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/chain/import.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{
dirs::{DataDirPath, MaybePlatformPath},
init::init_genesis,
node::events::{handle_events, NodeEvent},
version::SHORT_VERSION,
};
Expand All @@ -18,7 +19,6 @@ use reth_downloaders::{
};
use reth_interfaces::consensus::Consensus;
use reth_primitives::{stage::StageId, ChainSpec, H256};
use reth_staged_sync::utils::init::init_genesis;
use reth_stages::{
prelude::*,
stages::{
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/chain/init.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::{
args::{utils::genesis_value_parser, DatabaseArgs},
dirs::{DataDirPath, MaybePlatformPath},
init::init_genesis,
};
use clap::Parser;
use reth_db::init_db;
use reth_primitives::ChainSpec;
use reth_staged_sync::utils::init::init_genesis;
use std::sync::Arc;
use tracing::info;

Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/debug_cmd/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use crate::{
args::{get_secret_key, utils::genesis_value_parser, DatabaseArgs, NetworkArgs},
dirs::{DataDirPath, MaybePlatformPath},
init::init_genesis,
node::events,
runner::CliContext,
utils::get_single_header,
Expand All @@ -24,7 +25,6 @@ use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_primitives::{fs, stage::StageId, BlockHashOrNumber, BlockNumber, ChainSpec, H256};
use reth_provider::{BlockExecutionWriter, ProviderFactory, StageCheckpointReader};
use reth_staged_sync::utils::init::init_genesis;
use reth_stages::{
sets::DefaultStages,
stages::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Reth genesis initialization utility functions.
use reth_db::{
cursor::DbCursorRO,
database::{Database, DatabaseGAT},
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub mod config;
pub mod db;
pub mod debug_cmd;
pub mod dirs;
pub mod init;
pub mod node;
pub mod p2p;
pub mod prometheus_exporter;
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use crate::{
args::{get_secret_key, DebugArgs, NetworkArgs, RpcServerArgs},
dirs::DataDirPath,
init::init_genesis,
prometheus_exporter,
runner::CliContext,
utils::get_single_header,
Expand Down Expand Up @@ -46,7 +47,6 @@ use reth_provider::{
use reth_revm::Factory;
use reth_revm_inspectors::stack::Hook;
use reth_rpc_engine_api::EngineApi;
use reth_staged_sync::utils::init::init_genesis;
use reth_stages::{
prelude::*,
stages::{
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/stage/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
use crate::{
args::{utils::genesis_value_parser, DatabaseArgs, StageEnum},
dirs::{DataDirPath, MaybePlatformPath},
init::{insert_genesis_header, insert_genesis_state},
utils::DbTool,
};
use clap::Parser;
use reth_db::{database::Database, open_db, tables, transaction::DbTxMut, DatabaseEnv};
use reth_primitives::{fs, stage::StageId, ChainSpec};
use reth_staged_sync::utils::init::{insert_genesis_header, insert_genesis_state};
use std::sync::Arc;
use tracing::info;

Expand Down
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ component_management:
name: pipeline
paths:
- crates/stages/**
- crates/staged-sync/**
- component_id: storage
name: storage (db)
paths:
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ reth-tracing = { path = "../../tracing" }
reth-transaction-pool = { workspace = true, features = ["test-utils"] }

ethers-core = { workspace = true, default-features = false }
ethers-providers = { workspace = true, default-features = false }
ethers-providers = { workspace = true, default-features = false, features = ["ws"] }
ethers-signers = { workspace = true, default-features = false }
ethers-middleware = { workspace = true, default-features = false }

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ pub enum CliqueError<E> {
#[error("no genesis block returned from the provider")]
NoGenesis,

/// No tip block returned from the provider
#[error("no tip block returned from the provider")]
NoTip,

/// Account was not successfully unlocked on the provider
#[error("account was not successfully unlocked on the provider")]
AccountNotUnlocked,
Expand Down Expand Up @@ -94,12 +90,6 @@ pub trait CliqueMiddleware: Send + Sync + Middleware {
Ok(())
}

/// Returns the chain tip of the [`Geth`](ethers_core::utils::Geth) instance by calling
/// geth's `eth_getBlock`.
async fn remote_tip_block(&self) -> Result<Block<H256>, CliqueMiddlewareError<Self>> {
self.get_block(BlockNumber::Latest).await?.ok_or(CliqueError::NoTip)
}

/// Returns the genesis block of the [`Geth`](ethers_core::utils::Geth) instance by calling
/// geth's `eth_getBlock`.
async fn remote_genesis_block(&self) -> Result<Block<H256>, CliqueMiddlewareError<Self>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Common helpers for staged sync integration testing.
pub mod clique;
pub mod clique_middleware;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::clique::{CliqueGethInstance, CliqueMiddleware};
use ethers_core::{
types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, H160, U64},
utils::Geth,
Expand All @@ -10,7 +11,6 @@ use reth_network::{
use reth_network_api::Peers;
use reth_primitives::{ChainSpec, Genesis, PeerId, SealedHeader};
use reth_provider::test_utils::NoopProvider;
use reth_staged_sync::test_utils::{CliqueGethInstance, CliqueMiddleware};
use secp256k1::SecretKey;
use std::{net::SocketAddr, sync::Arc};

Expand Down
2 changes: 2 additions & 0 deletions crates/net/network/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mod clique;
mod connect;
mod geth;
mod requests;
mod session;
mod startup;
Expand Down
101 changes: 0 additions & 101 deletions crates/staged-sync/Cargo.toml

This file was deleted.

24 changes: 0 additions & 24 deletions crates/staged-sync/src/lib.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/staged-sync/src/utils/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion docs/repo/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ These crates implement the main syncing drivers of reth.

- [`blockchain-tree`](../../crates/blockchain-tree): A tree-like structure for handling multiple chains of unfinalized blocks. This is the main component during live sync (i.e. syncing at the tip)
- [`stages`](../../crates/stages): A pipelined sync, including implementation of various stages. This is used during initial sync and is faster than the tree-like structure for longer sync ranges.
- [`staged-sync`](../../crates/staged-sync): A catch-all for various things currently, to be removed

### RPC

Expand Down

0 comments on commit a743146

Please sign in to comment.