chore: cleanup some staged-sync deps (#1815)

This commit is contained in:
Matthias Seitz
2023-03-17 13:20:11 +01:00
committed by GitHub
parent 1a317f20e4
commit 7c877cb921
6 changed files with 22 additions and 67 deletions

41
Cargo.lock generated
View File

@ -199,28 +199,6 @@ dependencies = [
"event-listener",
]
[[package]]
name = "async-stream"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965"
dependencies = [
"proc-macro2 1.0.52",
"quote 1.0.23",
"syn 1.0.109",
]
[[package]]
name = "async-trait"
version = "0.1.65"
@ -5269,15 +5247,11 @@ dependencies = [
"reth-db",
"reth-discv4",
"reth-downloaders",
"reth-interfaces",
"reth-net-nat",
"reth-network",
"reth-network-api",
"reth-primitives",
"reth-provider",
"reth-staged-sync",
"reth-stages",
"reth-tasks",
"reth-tracing",
"secp256k1",
"serde",
@ -5286,8 +5260,6 @@ dependencies = [
"tempfile",
"thiserror",
"tokio",
"tokio-stream",
"tokio-test",
"tracing",
"walkdir",
]
@ -6592,19 +6564,6 @@ dependencies = [
"tokio-util 0.7.7",
]
[[package]]
name = "tokio-test"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53474327ae5e166530d17f2d956afcb4f8a004de581b3cae10f12006bc8163e3"
dependencies = [
"async-stream",
"bytes",
"futures-core",
"tokio",
"tokio-stream",
]
[[package]]
name = "tokio-tungstenite"
version = "0.18.0"

View File

@ -7,12 +7,6 @@ repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Puts together all the Reth stages in a unified abstraction"
[package.metadata.cargo-udeps.ignore]
normal = [
# Used for config loading
"confy"
]
[dependencies]
# reth
reth-db = {path = "../../crates/storage/db", features = ["mdbx", "test-utils"] }
@ -23,13 +17,10 @@ reth-downloaders = { path = "../../crates/net/downloaders" }
reth-primitives = { path = "../../crates/primitives" }
reth-provider = { path = "../../crates/storage/provider", features = ["test-utils"] }
reth-net-nat = { path = "../../crates/net/nat" }
reth-interfaces = { path = "../interfaces", optional = true }
reth-tasks = { path = "../../crates/tasks" }
# io
serde = "1.0"
serde_json = "1.0.91"
confy = "0.5"
# misc
walkdir = "2.3.2"
@ -55,23 +46,18 @@ ethers-signers = { git = "https://github.com/gakonst/ethers-rs", default-feature
# async / futures
async-trait = { version = "0.1", optional = true }
tokio = { version = "1", features = ["io-util", "net", "macros", "rt-multi-thread", "time"], optional = true }
tokio-test = { version = "0.4", optional = true }
# misc
tempfile = { version = "3.3", optional = true }
hex = { version = "0.4", optional = true }
[dev-dependencies]
# reth crates
reth-tracing = { path = "../tracing" }
reth-stages = { path = "../stages" }
reth-downloaders = { path = "../net/downloaders" }
reth-staged-sync = { path = ".", features = ["test-utils"] }
# async/futures
futures = "0.3"
tokio = { version = "1", features = ["io-util", "net", "macros", "rt-multi-thread", "time"] }
tokio-stream = "0.1"
# crypto
secp256k1 = { version = "0.26.0", features = [
@ -80,19 +66,20 @@ secp256k1 = { version = "0.26.0", features = [
"recovery",
] }
confy = "0.5"
tempfile = "3.4"
[features]
test-utils = [
"reth-network/test-utils",
"reth-interfaces/test-utils",
"reth-network/test-utils",
"reth-provider/test-utils",
"dep:enr",
"dep:ethers-core",
"dep:tempfile",
"dep:hex",
"dep:rand",
"dep:tokio",
"dep:tokio-test",
"dep:ethers-signers",
"dep:ethers-providers",
"dep:ethers-middleware",

View File

@ -1,3 +1,12 @@
#![warn(missing_docs, unreachable_pub)]
#![deny(unused_must_use, rust_2018_idioms)]
#![doc(test(
no_crate_inject,
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Puts together all the Reth stages in a unified abstraction
pub mod config;
pub use config::Config;

View File

@ -20,7 +20,7 @@ use std::{
/// ```no_run
/// # use ethers_core::utils::Geth;
/// # use reth_staged_sync::test_utils::CliqueGethInstance;
/// # tokio_test::block_on(async {
/// # let clique = async {
///
/// // this creates a funded geth
/// let clique_geth = Geth::new()
@ -32,7 +32,7 @@ use std::{
///
/// // don't print logs, but drain the stderr
/// clique.prevent_blocking().await;
/// # });
/// # };
/// ```
pub struct CliqueGethInstance {
/// The spawned [`GethInstance`](ethers_core::utils::GethInstance).

View File

@ -1,5 +1,3 @@
#![warn(missing_docs, unreachable_pub)]
//! Common helpers for staged sync integration testing.
pub mod clique;

View File

@ -12,10 +12,7 @@ use tracing::debug;
/// Opens up an existing database or creates a new one at the specified path.
pub fn init_db<P: AsRef<Path>>(path: P) -> eyre::Result<Env<WriteMap>> {
std::fs::create_dir_all(path.as_ref())?;
let db = reth_db::mdbx::Env::<reth_db::mdbx::WriteMap>::open(
path.as_ref(),
reth_db::mdbx::EnvKind::RW,
)?;
let db = Env::<WriteMap>::open(path.as_ref(), reth_db::mdbx::EnvKind::RW)?;
db.create_tables()?;
Ok(db)
@ -26,7 +23,12 @@ pub fn init_db<P: AsRef<Path>>(path: P) -> eyre::Result<Env<WriteMap>> {
pub enum InitDatabaseError {
/// Attempted to reinitialize database with inconsistent genesis block
#[error("Genesis hash mismatch: expected {expected}, got {actual}")]
GenesisHashMismatch { expected: H256, actual: H256 },
GenesisHashMismatch {
/// Expected genesis hash.
expected: H256,
/// Actual genesis hash.
actual: H256,
},
/// Low-level database error.
#[error(transparent)]