mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: stages crates touchups (#7742)
This commit is contained in:
11
Cargo.lock
generated
11
Cargo.lock
generated
@ -7400,41 +7400,32 @@ name = "reth-stages"
|
|||||||
version = "0.2.0-beta.5"
|
version = "0.2.0-beta.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
"aquamarine",
|
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
"auto_impl",
|
|
||||||
"criterion",
|
"criterion",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"itertools 0.12.1",
|
"itertools 0.12.1",
|
||||||
"metrics",
|
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"paste",
|
"paste",
|
||||||
"pprof",
|
"pprof",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"rayon",
|
"rayon",
|
||||||
"reth-blockchain-tree",
|
|
||||||
"reth-codecs",
|
"reth-codecs",
|
||||||
"reth-config",
|
"reth-config",
|
||||||
"reth-db",
|
"reth-db",
|
||||||
"reth-downloaders",
|
"reth-downloaders",
|
||||||
"reth-eth-wire",
|
|
||||||
"reth-etl",
|
"reth-etl",
|
||||||
|
"reth-evm-ethereum",
|
||||||
"reth-interfaces",
|
"reth-interfaces",
|
||||||
"reth-metrics",
|
|
||||||
"reth-node-ethereum",
|
|
||||||
"reth-node-optimism",
|
|
||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-provider",
|
"reth-provider",
|
||||||
"reth-revm",
|
"reth-revm",
|
||||||
"reth-stages-api",
|
"reth-stages-api",
|
||||||
"reth-static-file",
|
"reth-static-file",
|
||||||
"reth-tokio-util",
|
|
||||||
"reth-trie",
|
"reth-trie",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -298,6 +298,7 @@ alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "188c4f8" }
|
|||||||
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "188c4f8" }
|
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "188c4f8" }
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
auto_impl = "1"
|
||||||
aquamarine = "0.5"
|
aquamarine = "0.5"
|
||||||
bytes = "1.5"
|
bytes = "1.5"
|
||||||
bitflags = "2.4"
|
bitflags = "2.4"
|
||||||
|
|||||||
@ -21,7 +21,7 @@ futures.workspace = true
|
|||||||
tokio = { workspace = true, features = ["sync"] }
|
tokio = { workspace = true, features = ["sync"] }
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
auto_impl = "1.0"
|
auto_impl.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
secp256k1 = { workspace = true, default-features = false, features = [
|
secp256k1 = { workspace = true, default-features = false, features = [
|
||||||
|
|||||||
@ -7,7 +7,6 @@ rust-version.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
exclude.workspace = true
|
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|||||||
@ -51,7 +51,7 @@ reth-metrics = { workspace = true, features = ["common"] }
|
|||||||
metrics.workspace = true
|
metrics.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
auto_impl = "1"
|
auto_impl.workspace = true
|
||||||
aquamarine.workspace = true
|
aquamarine.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
|
|||||||
@ -6,7 +6,9 @@ rust-version.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
exclude.workspace = true
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# reth
|
# reth
|
||||||
@ -15,7 +17,6 @@ reth-provider.workspace = true
|
|||||||
reth-db.workspace = true
|
reth-db.workspace = true
|
||||||
reth-interfaces.workspace = true
|
reth-interfaces.workspace = true
|
||||||
reth-static-file.workspace = true
|
reth-static-file.workspace = true
|
||||||
assert_matches.workspace = true
|
|
||||||
reth-tokio-util.workspace = true
|
reth-tokio-util.workspace = true
|
||||||
|
|
||||||
# metrics
|
# metrics
|
||||||
@ -28,13 +29,15 @@ tokio-stream.workspace = true
|
|||||||
futures-util.workspace = true
|
futures-util.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
aquamarine.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
auto_impl = "1"
|
auto_impl.workspace = true
|
||||||
aquamarine.workspace = true
|
|
||||||
|
[dev-dependencies]
|
||||||
|
assert_matches.workspace = true
|
||||||
|
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||||
|
reth-interfaces = { workspace = true, features = ["test-utils"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
test-utils = []
|
test-utils = []
|
||||||
|
|
||||||
[lints]
|
|
||||||
workspace = true
|
|
||||||
|
|||||||
@ -1,9 +1,21 @@
|
|||||||
//! Staged syncing primitives for reth.
|
//! Staged syncing primitives for reth.
|
||||||
|
//!
|
||||||
|
//! ## Feature Flags
|
||||||
|
//!
|
||||||
|
//! - `test-utils`: Utilities for testing
|
||||||
|
|
||||||
|
#![doc(
|
||||||
|
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||||
|
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||||
|
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||||
|
)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||||
|
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
mod metrics;
|
mod metrics;
|
||||||
mod pipeline;
|
mod pipeline;
|
||||||
mod stage;
|
mod stage;
|
||||||
#[allow(missing_docs)]
|
|
||||||
#[cfg(any(test, feature = "test-utils"))]
|
#[cfg(any(test, feature = "test-utils"))]
|
||||||
pub mod test_utils;
|
pub mod test_utils;
|
||||||
mod util;
|
mod util;
|
||||||
@ -12,3 +24,5 @@ pub use crate::metrics::*;
|
|||||||
pub use error::*;
|
pub use error::*;
|
||||||
pub use pipeline::*;
|
pub use pipeline::*;
|
||||||
pub use stage::*;
|
pub use stage::*;
|
||||||
|
|
||||||
|
use aquamarine as _;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ mod ctrl;
|
|||||||
mod event;
|
mod event;
|
||||||
pub use crate::pipeline::ctrl::ControlFlow;
|
pub use crate::pipeline::ctrl::ControlFlow;
|
||||||
pub use event::*;
|
pub use event::*;
|
||||||
|
|
||||||
use futures_util::Future;
|
use futures_util::Future;
|
||||||
use reth_db::database::Database;
|
use reth_db::database::Database;
|
||||||
use reth_interfaces::RethResult;
|
use reth_interfaces::RethResult;
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||||
use reth_db::database::Database;
|
use reth_db::database::Database;
|
||||||
use reth_primitives::stage::StageId;
|
use reth_primitives::stage::StageId;
|
||||||
use reth_provider::DatabaseProviderRW;
|
use reth_provider::DatabaseProviderRW;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
|
|
||||||
|
/// A test stage that can be used for testing.
|
||||||
|
///
|
||||||
|
/// This can be used to mock expected outputs of [Stage::execute] and [Stage::unwind]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TestStage {
|
pub struct TestStage {
|
||||||
id: StageId,
|
id: StageId,
|
||||||
@ -1,2 +0,0 @@
|
|||||||
mod stage;
|
|
||||||
pub use stage::TestStage;
|
|
||||||
@ -19,46 +19,33 @@ reth-db.workspace = true
|
|||||||
reth-codecs.workspace = true
|
reth-codecs.workspace = true
|
||||||
reth-provider.workspace = true
|
reth-provider.workspace = true
|
||||||
reth-trie = { workspace = true, features = ["metrics"] }
|
reth-trie = { workspace = true, features = ["metrics"] }
|
||||||
reth-tokio-util.workspace = true
|
|
||||||
reth-etl.workspace = true
|
reth-etl.workspace = true
|
||||||
reth-static-file.workspace = true
|
|
||||||
reth-config.workspace = true
|
reth-config.workspace = true
|
||||||
reth-stages-api = {workspace = true , features = ["test-utils"]}
|
reth-stages-api = {workspace = true , features = ["test-utils"]}
|
||||||
|
|
||||||
# async
|
# async
|
||||||
tokio = { workspace = true, features = ["sync"] }
|
tokio = { workspace = true, features = ["sync"] }
|
||||||
tokio-stream.workspace = true
|
|
||||||
futures-util.workspace = true
|
futures-util.workspace = true
|
||||||
|
|
||||||
# observability
|
# observability
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
|
||||||
# io
|
|
||||||
tempfile.workspace = true
|
|
||||||
|
|
||||||
# metrics
|
|
||||||
reth-metrics.workspace = true
|
|
||||||
metrics.workspace = true
|
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
aquamarine.workspace = true
|
|
||||||
itertools.workspace = true
|
itertools.workspace = true
|
||||||
rayon.workspace = true
|
rayon.workspace = true
|
||||||
num-traits = "0.2.15"
|
num-traits = "0.2.15"
|
||||||
auto_impl = "1"
|
tempfile = { workspace = true, optional = true}
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# reth
|
# reth
|
||||||
reth-primitives = { workspace = true, features = ["test-utils", "arbitrary"] }
|
reth-primitives = { workspace = true, features = ["test-utils", "arbitrary"] }
|
||||||
reth-db = { workspace = true, features = ["test-utils", "mdbx"] }
|
reth-db = { workspace = true, features = ["test-utils", "mdbx"] }
|
||||||
|
reth-evm-ethereum.workspace = true
|
||||||
reth-interfaces = { workspace = true, features = ["test-utils"] }
|
reth-interfaces = { workspace = true, features = ["test-utils"] }
|
||||||
reth-downloaders.workspace = true
|
reth-downloaders.workspace = true
|
||||||
reth-eth-wire.workspace = true # TODO(onbjerg): We only need this for [BlockBody]
|
|
||||||
reth-node-ethereum.workspace = true
|
|
||||||
reth-node-optimism.workspace = true
|
|
||||||
reth-blockchain-tree.workspace = true
|
|
||||||
reth-revm.workspace = true
|
reth-revm.workspace = true
|
||||||
|
reth-static-file.workspace = true
|
||||||
reth-trie = { workspace = true, features = ["test-utils"] }
|
reth-trie = { workspace = true, features = ["test-utils"] }
|
||||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||||
|
|
||||||
@ -68,6 +55,7 @@ tokio = { workspace = true, features = ["rt", "sync", "macros"] }
|
|||||||
assert_matches.workspace = true
|
assert_matches.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
paste.workspace = true
|
paste.workspace = true
|
||||||
|
tempfile.workspace = true
|
||||||
|
|
||||||
# Stage benchmarks
|
# Stage benchmarks
|
||||||
criterion = { workspace = true, features = ["async_futures"] }
|
criterion = { workspace = true, features = ["async_futures"] }
|
||||||
@ -79,7 +67,7 @@ serde_json.workspace = true
|
|||||||
pprof = { workspace = true, features = ["flamegraph", "frame-pointer", "criterion"] }
|
pprof = { workspace = true, features = ["flamegraph", "frame-pointer", "criterion"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
test-utils = ["reth-interfaces/test-utils", "reth-db/test-utils", "reth-provider/test-utils", "reth-stages-api/test-utils"]
|
test-utils = ["reth-interfaces/test-utils", "reth-db/test-utils", "reth-provider/test-utils", "reth-stages-api/test-utils", "dep:tempfile"]
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "criterion"
|
name = "criterion"
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
//! # use reth_stages::Pipeline;
|
//! # use reth_stages::Pipeline;
|
||||||
//! # use reth_stages::sets::DefaultStages;
|
//! # use reth_stages::sets::DefaultStages;
|
||||||
//! # use tokio::sync::watch;
|
//! # use tokio::sync::watch;
|
||||||
//! # use reth_node_ethereum::EthEvmConfig;
|
//! # use reth_evm_ethereum::EthEvmConfig;
|
||||||
//! # use reth_provider::ProviderFactory;
|
//! # use reth_provider::ProviderFactory;
|
||||||
//! # use reth_provider::HeaderSyncMode;
|
//! # use reth_provider::HeaderSyncMode;
|
||||||
//! # use reth_provider::test_utils::create_test_provider_factory;
|
//! # use reth_provider::test_utils::create_test_provider_factory;
|
||||||
@ -76,6 +76,7 @@
|
|||||||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||||
)]
|
)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||||
|
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg(any(test, feature = "test-utils"))]
|
#[cfg(any(test, feature = "test-utils"))]
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
//! # use reth_stages::sets::{OfflineStages};
|
//! # use reth_stages::sets::{OfflineStages};
|
||||||
//! # use reth_revm::EvmProcessorFactory;
|
//! # use reth_revm::EvmProcessorFactory;
|
||||||
//! # use reth_primitives::{PruneModes, MAINNET};
|
//! # use reth_primitives::{PruneModes, MAINNET};
|
||||||
//! # use reth_node_ethereum::EthEvmConfig;
|
//! # use reth_evm_ethereum::EthEvmConfig;
|
||||||
//! # use reth_provider::test_utils::create_test_provider_factory;
|
//! # use reth_provider::test_utils::create_test_provider_factory;
|
||||||
//! # use reth_static_file::StaticFileProducer;
|
//! # use reth_static_file::StaticFileProducer;
|
||||||
//! # use reth_config::config::EtlConfig;
|
//! # use reth_config::config::EtlConfig;
|
||||||
|
|||||||
@ -622,8 +622,8 @@ mod tests {
|
|||||||
use alloy_rlp::Decodable;
|
use alloy_rlp::Decodable;
|
||||||
use assert_matches::assert_matches;
|
use assert_matches::assert_matches;
|
||||||
use reth_db::models::AccountBeforeTx;
|
use reth_db::models::AccountBeforeTx;
|
||||||
|
use reth_evm_ethereum::EthEvmConfig;
|
||||||
use reth_interfaces::executor::BlockValidationError;
|
use reth_interfaces::executor::BlockValidationError;
|
||||||
use reth_node_ethereum::EthEvmConfig;
|
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
address, hex_literal::hex, keccak256, stage::StageUnitCheckpoint, Account, Address,
|
address, hex_literal::hex, keccak256, stage::StageUnitCheckpoint, Account, Address,
|
||||||
Bytecode, ChainSpecBuilder, PruneMode, ReceiptsLogPruneConfig, SealedBlock, StorageEntry,
|
Bytecode, ChainSpecBuilder, PruneMode, ReceiptsLogPruneConfig, SealedBlock, StorageEntry,
|
||||||
|
|||||||
@ -50,8 +50,8 @@ mod tests {
|
|||||||
transaction::{DbTx, DbTxMut},
|
transaction::{DbTx, DbTxMut},
|
||||||
AccountsHistory, DatabaseEnv,
|
AccountsHistory, DatabaseEnv,
|
||||||
};
|
};
|
||||||
|
use reth_evm_ethereum::EthEvmConfig;
|
||||||
use reth_interfaces::test_utils::generators::{self, random_block};
|
use reth_interfaces::test_utils::generators::{self, random_block};
|
||||||
use reth_node_ethereum::EthEvmConfig;
|
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
address, hex_literal::hex, keccak256, Account, Bytecode, ChainSpecBuilder, PruneMode,
|
address, hex_literal::hex, keccak256, Account, Bytecode, ChainSpecBuilder, PruneMode,
|
||||||
PruneModes, SealedBlock, StaticFileSegment, U256,
|
PruneModes, SealedBlock, StaticFileSegment, U256,
|
||||||
|
|||||||
@ -35,7 +35,7 @@ reth-metrics.workspace = true
|
|||||||
metrics.workspace = true
|
metrics.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
auto_impl = "1.0"
|
auto_impl.workspace = true
|
||||||
itertools.workspace = true
|
itertools.workspace = true
|
||||||
pin-project.workspace = true
|
pin-project.workspace = true
|
||||||
parking_lot.workspace = true
|
parking_lot.workspace = true
|
||||||
|
|||||||
@ -39,7 +39,7 @@ schnellru.workspace = true
|
|||||||
serde = { workspace = true, features = ["derive", "rc"], optional = true }
|
serde = { workspace = true, features = ["derive", "rc"], optional = true }
|
||||||
fnv = "1.0.7"
|
fnv = "1.0.7"
|
||||||
bitflags.workspace = true
|
bitflags.workspace = true
|
||||||
auto_impl = "1.0"
|
auto_impl.workspace = true
|
||||||
smallvec.workspace = true
|
smallvec.workspace = true
|
||||||
itertools.workspace = true
|
itertools.workspace = true
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ tracing.workspace = true
|
|||||||
# misc
|
# misc
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
derive_more.workspace = true
|
derive_more.workspace = true
|
||||||
auto_impl = "1"
|
auto_impl.workspace = true
|
||||||
|
|
||||||
# `metrics` feature
|
# `metrics` feature
|
||||||
reth-metrics = { workspace = true, optional = true }
|
reth-metrics = { workspace = true, optional = true }
|
||||||
|
|||||||
Reference in New Issue
Block a user