mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
chore: move primitives/stage to reth-stages-types (#8749)
This commit is contained in:
26
Cargo.lock
generated
26
Cargo.lock
generated
@@ -6543,6 +6543,7 @@ dependencies = [
|
||||
"reth-nippy-jar",
|
||||
"reth-primitives",
|
||||
"reth-prune-types",
|
||||
"reth-stages-types",
|
||||
"reth-storage-errors",
|
||||
"reth-tracing",
|
||||
"reth-trie-types",
|
||||
@@ -6577,6 +6578,7 @@ dependencies = [
|
||||
"reth-codecs",
|
||||
"reth-primitives",
|
||||
"reth-prune-types",
|
||||
"reth-stages-types",
|
||||
"reth-storage-errors",
|
||||
"reth-trie-types",
|
||||
"serde",
|
||||
@@ -6596,6 +6598,7 @@ dependencies = [
|
||||
"reth-etl",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-stages-types",
|
||||
"reth-trie",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -6730,6 +6733,7 @@ dependencies = [
|
||||
"reth-provider",
|
||||
"reth-rpc",
|
||||
"reth-rpc-layer",
|
||||
"reth-stages-types",
|
||||
"reth-tokio-util",
|
||||
"reth-tracing",
|
||||
"serde_json",
|
||||
@@ -7383,6 +7387,7 @@ dependencies = [
|
||||
"reth-rpc-server-types",
|
||||
"reth-rpc-types",
|
||||
"reth-rpc-types-compat",
|
||||
"reth-stages-types",
|
||||
"reth-storage-errors",
|
||||
"reth-tasks",
|
||||
"reth-tracing",
|
||||
@@ -7648,6 +7653,7 @@ dependencies = [
|
||||
"reth-nippy-jar",
|
||||
"reth-primitives",
|
||||
"reth-prune-types",
|
||||
"reth-stages-types",
|
||||
"reth-storage-api",
|
||||
"reth-storage-errors",
|
||||
"reth-testing-utils",
|
||||
@@ -7999,6 +8005,7 @@ dependencies = [
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-prune",
|
||||
"reth-stages-types",
|
||||
"reth-static-file",
|
||||
"reth-testing-utils",
|
||||
"reth-tokio-util",
|
||||
@@ -8008,6 +8015,23 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-stages-types"
|
||||
version = "0.2.0-beta.9"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"arbitrary",
|
||||
"bytes",
|
||||
"modular-bitfield",
|
||||
"proptest",
|
||||
"proptest-derive",
|
||||
"rand 0.8.5",
|
||||
"reth-codecs",
|
||||
"reth-trie-types",
|
||||
"serde",
|
||||
"test-fuzz",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-static-file"
|
||||
version = "0.2.0-beta.9"
|
||||
@@ -8049,6 +8073,7 @@ dependencies = [
|
||||
"reth-execution-types",
|
||||
"reth-primitives",
|
||||
"reth-prune-types",
|
||||
"reth-stages-types",
|
||||
"reth-storage-errors",
|
||||
"reth-trie",
|
||||
"revm",
|
||||
@@ -8167,6 +8192,7 @@ dependencies = [
|
||||
"reth-metrics",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-stages-types",
|
||||
"reth-storage-errors",
|
||||
"reth-trie-types",
|
||||
"revm",
|
||||
|
||||
@@ -79,6 +79,7 @@ members = [
|
||||
"crates/rpc/rpc/",
|
||||
"crates/stages/api/",
|
||||
"crates/stages/stages/",
|
||||
"crates/stages/types/",
|
||||
"crates/static-file/types/",
|
||||
"crates/static-file/static-file",
|
||||
"crates/storage/codecs/",
|
||||
@@ -316,6 +317,7 @@ reth-rpc-types = { path = "crates/rpc/rpc-types" }
|
||||
reth-rpc-types-compat = { path = "crates/rpc/rpc-types-compat" }
|
||||
reth-stages = { path = "crates/stages/stages" }
|
||||
reth-stages-api = { path = "crates/stages/api" }
|
||||
reth-stages-types = { path = "crates/stages/types" }
|
||||
reth-static-file = { path = "crates/static-file/static-file" }
|
||||
reth-static-file-types = { path = "crates/static-file/types" }
|
||||
reth-storage-api = { path = "crates/storage/storage-api" }
|
||||
|
||||
@@ -14,11 +14,11 @@ use reth_node_core::{
|
||||
},
|
||||
dirs::{ChainPath, DataDirPath},
|
||||
};
|
||||
use reth_primitives::{stage::PipelineTarget, ChainSpec};
|
||||
use reth_primitives::ChainSpec;
|
||||
use reth_provider::{
|
||||
providers::StaticFileProvider, HeaderSyncMode, ProviderFactory, StaticFileProviderFactory,
|
||||
};
|
||||
use reth_stages::{sets::DefaultStages, Pipeline};
|
||||
use reth_stages::{sets::DefaultStages, Pipeline, PipelineTarget};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
@@ -25,7 +25,6 @@ use reth_payload_builder::database::CachedReads;
|
||||
use reth_primitives::{
|
||||
constants::eip4844::{LoadKzgSettingsError, MAINNET_KZG_TRUSTED_SETUP},
|
||||
revm_primitives::KzgSettings,
|
||||
stage::StageId,
|
||||
Address, BlobTransaction, BlobTransactionSidecar, Bytes, PooledTransactionsElement,
|
||||
SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned, TxEip4844, B256, U256,
|
||||
};
|
||||
@@ -36,6 +35,7 @@ use reth_provider::{
|
||||
};
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
|
||||
use reth_stages::StageId;
|
||||
use reth_transaction_pool::{
|
||||
blobstore::InMemoryBlobStore, BlobStore, EthPooledTransaction, PoolConfig, TransactionOrigin,
|
||||
TransactionPool, TransactionValidationTaskExecutor,
|
||||
|
||||
@@ -22,7 +22,7 @@ use reth_exex::ExExManagerHandle;
|
||||
use reth_network::{NetworkEvents, NetworkHandle};
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_network_p2p::{bodies::client::BodiesClient, headers::client::HeadersClient};
|
||||
use reth_primitives::{stage::StageId, BlockHashOrNumber, BlockNumber, B256};
|
||||
use reth_primitives::{BlockHashOrNumber, BlockNumber, B256};
|
||||
use reth_provider::{
|
||||
BlockExecutionWriter, ChainSpecProvider, HeaderSyncMode, ProviderFactory, StageCheckpointReader,
|
||||
};
|
||||
@@ -30,7 +30,7 @@ use reth_prune_types::PruneModes;
|
||||
use reth_stages::{
|
||||
sets::DefaultStages,
|
||||
stages::{ExecutionStage, ExecutionStageThresholds},
|
||||
Pipeline, StageSet,
|
||||
Pipeline, StageId, StageSet,
|
||||
};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use reth_tasks::TaskExecutor;
|
||||
|
||||
@@ -15,13 +15,14 @@ use reth_errors::BlockValidationError;
|
||||
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
|
||||
use reth_network::NetworkHandle;
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_primitives::{stage::StageId, BlockHashOrNumber};
|
||||
use reth_primitives::BlockHashOrNumber;
|
||||
use reth_provider::{
|
||||
AccountExtReader, BundleStateWithReceipts, ChainSpecProvider, HashingWriter, HeaderProvider,
|
||||
LatestStateProviderRef, OriginalValuesKnown, ProviderFactory, StageCheckpointReader,
|
||||
StateWriter, StaticFileProviderFactory, StorageReader,
|
||||
};
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_stages::StageId;
|
||||
use reth_tasks::TaskExecutor;
|
||||
use reth_trie::{updates::TrieKey, StateRoot};
|
||||
use std::{net::SocketAddr, path::PathBuf, sync::Arc};
|
||||
|
||||
@@ -18,7 +18,7 @@ use reth_evm::execute::{BatchExecutor, BlockExecutorProvider};
|
||||
use reth_network::NetworkHandle;
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_network_p2p::full_block::FullBlockClient;
|
||||
use reth_primitives::{stage::StageCheckpoint, BlockHashOrNumber};
|
||||
use reth_primitives::BlockHashOrNumber;
|
||||
use reth_provider::{
|
||||
BlockNumReader, BlockWriter, ChainSpecProvider, HeaderProvider, LatestStateProviderRef,
|
||||
OriginalValuesKnown, ProviderError, ProviderFactory, StateWriter,
|
||||
@@ -27,7 +27,7 @@ use reth_prune_types::PruneModes;
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_stages::{
|
||||
stages::{AccountHashingStage, MerkleStage, StorageHashingStage},
|
||||
ExecInput, Stage,
|
||||
ExecInput, Stage, StageCheckpoint,
|
||||
};
|
||||
use reth_tasks::TaskExecutor;
|
||||
use std::{net::SocketAddr, path::PathBuf, sync::Arc};
|
||||
|
||||
@@ -22,13 +22,13 @@ use reth_network_p2p::{
|
||||
headers::downloader::{HeaderDownloader, SyncTarget},
|
||||
};
|
||||
use reth_node_events::node::NodeEvent;
|
||||
use reth_primitives::{stage::StageId, B256};
|
||||
use reth_primitives::B256;
|
||||
use reth_provider::{
|
||||
BlockNumReader, ChainSpecProvider, HeaderProvider, HeaderSyncMode, ProviderError,
|
||||
ProviderFactory, StageCheckpointReader,
|
||||
};
|
||||
use reth_prune_types::PruneModes;
|
||||
use reth_stages::{prelude::*, Pipeline, StageSet};
|
||||
use reth_stages::{prelude::*, Pipeline, StageId, StageSet};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
use tokio::sync::watch;
|
||||
|
||||
@@ -16,9 +16,9 @@ use reth_downloaders::file_client::{
|
||||
ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE,
|
||||
};
|
||||
use reth_optimism_primitives::bedrock_import::is_dup_tx;
|
||||
use reth_primitives::stage::StageId;
|
||||
use reth_provider::StageCheckpointReader;
|
||||
use reth_prune_types::PruneModes;
|
||||
use reth_stages::StageId;
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
use tracing::{debug, error, info};
|
||||
|
||||
@@ -11,11 +11,12 @@ use reth_downloaders::{
|
||||
};
|
||||
use reth_node_core::version::SHORT_VERSION;
|
||||
use reth_optimism_primitives::bedrock_import::is_dup_tx;
|
||||
use reth_primitives::{stage::StageId, Receipts, StaticFileSegment};
|
||||
use reth_primitives::{Receipts, StaticFileSegment};
|
||||
use reth_provider::{
|
||||
BundleStateWithReceipts, OriginalValuesKnown, ProviderFactory, StageCheckpointReader,
|
||||
StateWriter, StaticFileProviderFactory, StaticFileWriter, StatsReader,
|
||||
};
|
||||
use reth_stages::StageId;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tracing::{debug, error, info, trace};
|
||||
|
||||
|
||||
@@ -10,8 +10,9 @@ use itertools::Itertools;
|
||||
use reth_db::{static_file::iter_static_files, tables, DatabaseEnv};
|
||||
use reth_db_api::transaction::DbTxMut;
|
||||
use reth_db_common::init::{insert_genesis_header, insert_genesis_history, insert_genesis_state};
|
||||
use reth_primitives::{stage::StageId, static_file::find_fixed_range, StaticFileSegment};
|
||||
use reth_primitives::{static_file::find_fixed_range, StaticFileSegment};
|
||||
use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory};
|
||||
use reth_stages::StageId;
|
||||
|
||||
/// `reth drop-stage` command
|
||||
#[derive(Debug, Parser)]
|
||||
|
||||
@@ -5,9 +5,8 @@ use reth_db_api::{
|
||||
cursor::DbCursorRO, database::Database, table::TableImporter, transaction::DbTx,
|
||||
};
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_primitives::stage::StageCheckpoint;
|
||||
use reth_provider::{providers::StaticFileProvider, ChainSpecProvider, ProviderFactory};
|
||||
use reth_stages::{stages::ExecutionStage, Stage, UnwindInput};
|
||||
use reth_stages::{stages::ExecutionStage, Stage, StageCheckpoint, UnwindInput};
|
||||
use tracing::info;
|
||||
|
||||
pub(crate) async fn dump_execution_stage<DB: Database>(
|
||||
|
||||
@@ -4,9 +4,9 @@ use eyre::Result;
|
||||
use reth_db::{tables, DatabaseEnv};
|
||||
use reth_db_api::{database::Database, table::TableImporter};
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_primitives::{stage::StageCheckpoint, BlockNumber};
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_provider::{providers::StaticFileProvider, ProviderFactory};
|
||||
use reth_stages::{stages::AccountHashingStage, Stage, UnwindInput};
|
||||
use reth_stages::{stages::AccountHashingStage, Stage, StageCheckpoint, UnwindInput};
|
||||
use tracing::info;
|
||||
|
||||
pub(crate) async fn dump_hashing_account_stage<DB: Database>(
|
||||
|
||||
@@ -4,9 +4,8 @@ use eyre::Result;
|
||||
use reth_db::{tables, DatabaseEnv};
|
||||
use reth_db_api::{database::Database, table::TableImporter};
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_primitives::stage::StageCheckpoint;
|
||||
use reth_provider::{providers::StaticFileProvider, ProviderFactory};
|
||||
use reth_stages::{stages::StorageHashingStage, Stage, UnwindInput};
|
||||
use reth_stages::{stages::StorageHashingStage, Stage, StageCheckpoint, UnwindInput};
|
||||
use tracing::info;
|
||||
|
||||
pub(crate) async fn dump_hashing_storage_stage<DB: Database>(
|
||||
|
||||
@@ -6,7 +6,7 @@ use reth_db::{tables, DatabaseEnv};
|
||||
use reth_db_api::{database::Database, table::TableImporter};
|
||||
use reth_exex::ExExManagerHandle;
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_primitives::{stage::StageCheckpoint, BlockNumber};
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_provider::{providers::StaticFileProvider, ProviderFactory};
|
||||
use reth_prune_types::PruneModes;
|
||||
use reth_stages::{
|
||||
@@ -14,7 +14,7 @@ use reth_stages::{
|
||||
AccountHashingStage, ExecutionStage, ExecutionStageThresholds, MerkleStage,
|
||||
StorageHashingStage, MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
|
||||
},
|
||||
Stage, UnwindInput,
|
||||
Stage, StageCheckpoint, UnwindInput,
|
||||
};
|
||||
use tracing::info;
|
||||
|
||||
|
||||
@@ -1385,7 +1385,6 @@ mod tests {
|
||||
keccak256,
|
||||
proofs::{calculate_transaction_root, state_root_unhashed},
|
||||
revm_primitives::AccountInfo,
|
||||
stage::StageCheckpoint,
|
||||
Account, Address, ChainSpecBuilder, Genesis, GenesisAccount, Header, Signature,
|
||||
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559, Withdrawals, B256,
|
||||
MAINNET,
|
||||
@@ -1394,6 +1393,7 @@ mod tests {
|
||||
test_utils::{blocks::BlockchainTestData, create_test_provider_factory_with_chain_spec},
|
||||
ProviderFactory,
|
||||
};
|
||||
use reth_stages_api::StageCheckpoint;
|
||||
use reth_trie::StateRoot;
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@ use reth_payload_builder::PayloadBuilderHandle;
|
||||
use reth_payload_primitives::{PayloadAttributes, PayloadBuilderAttributes};
|
||||
use reth_payload_validator::ExecutionPayloadValidator;
|
||||
use reth_primitives::{
|
||||
constants::EPOCH_SLOTS,
|
||||
stage::{PipelineTarget, StageId},
|
||||
BlockNumHash, BlockNumber, Head, Header, SealedBlock, SealedHeader, B256,
|
||||
constants::EPOCH_SLOTS, BlockNumHash, BlockNumber, Head, Header, SealedBlock, SealedHeader,
|
||||
B256,
|
||||
};
|
||||
use reth_provider::{
|
||||
BlockIdReader, BlockReader, BlockSource, CanonChainTracker, ChainSpecProvider, ProviderError,
|
||||
@@ -28,7 +27,7 @@ use reth_rpc_types::engine::{
|
||||
CancunPayloadFields, ExecutionPayload, ForkchoiceState, PayloadStatus, PayloadStatusEnum,
|
||||
PayloadValidationError,
|
||||
};
|
||||
use reth_stages_api::{ControlFlow, Pipeline};
|
||||
use reth_stages_api::{ControlFlow, Pipeline, PipelineTarget, StageId};
|
||||
use reth_tasks::TaskSpawner;
|
||||
use reth_tokio_util::EventSender;
|
||||
use std::{
|
||||
@@ -1985,11 +1984,12 @@ mod tests {
|
||||
BeaconForkChoiceUpdateError,
|
||||
};
|
||||
use assert_matches::assert_matches;
|
||||
use reth_primitives::{stage::StageCheckpoint, ChainSpecBuilder, MAINNET};
|
||||
use reth_primitives::{ChainSpecBuilder, MAINNET};
|
||||
use reth_provider::{BlockWriter, ProviderFactory};
|
||||
use reth_rpc_types::engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus};
|
||||
use reth_rpc_types_compat::engine::payload::block_to_payload_v1;
|
||||
use reth_stages::{ExecOutput, PipelineError, StageError};
|
||||
use reth_stages_api::StageCheckpoint;
|
||||
use reth_testing_utils::generators::{self, Rng};
|
||||
use std::{collections::VecDeque, sync::Arc};
|
||||
use tokio::sync::oneshot::error::TryRecvError;
|
||||
|
||||
@@ -11,8 +11,8 @@ use reth_network_p2p::{
|
||||
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
|
||||
headers::client::HeadersClient,
|
||||
};
|
||||
use reth_primitives::{stage::PipelineTarget, BlockNumber, ChainSpec, SealedBlock, B256};
|
||||
use reth_stages_api::{ControlFlow, Pipeline, PipelineError, PipelineWithResult};
|
||||
use reth_primitives::{BlockNumber, ChainSpec, SealedBlock, B256};
|
||||
use reth_stages_api::{ControlFlow, Pipeline, PipelineError, PipelineTarget, PipelineWithResult};
|
||||
use reth_tasks::TaskSpawner;
|
||||
use reth_tokio_util::EventSender;
|
||||
use std::{
|
||||
@@ -431,14 +431,15 @@ mod tests {
|
||||
use reth_db::{mdbx::DatabaseEnv, test_utils::TempDatabase};
|
||||
use reth_network_p2p::{either::Either, test_utils::TestFullBlockClient};
|
||||
use reth_primitives::{
|
||||
constants::ETHEREUM_BLOCK_GAS_LIMIT, stage::StageCheckpoint, BlockBody, ChainSpecBuilder,
|
||||
Header, SealedHeader, MAINNET,
|
||||
constants::ETHEREUM_BLOCK_GAS_LIMIT, BlockBody, ChainSpecBuilder, Header, SealedHeader,
|
||||
MAINNET,
|
||||
};
|
||||
use reth_provider::{
|
||||
test_utils::create_test_provider_factory_with_chain_spec, BundleStateWithReceipts,
|
||||
};
|
||||
use reth_prune_types::PruneModes;
|
||||
use reth_stages::{test_utils::TestStages, ExecOutput, StageError};
|
||||
use reth_stages_api::StageCheckpoint;
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use reth_tasks::TokioTaskExecutor;
|
||||
use std::{collections::VecDeque, future::poll_fn, ops::Range};
|
||||
|
||||
@@ -19,6 +19,7 @@ reth-payload-builder = { workspace = true, features = ["test-utils"] }
|
||||
reth-provider.workspace = true
|
||||
reth-node-builder.workspace = true
|
||||
reth-tokio-util.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
|
||||
jsonrpsee.workspace = true
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ use reth::{
|
||||
rpc::types::engine::PayloadStatusEnum,
|
||||
};
|
||||
use reth_node_builder::NodeTypes;
|
||||
use reth_primitives::{stage::StageId, BlockHash, BlockNumber, Bytes, B256};
|
||||
use reth_primitives::{BlockHash, BlockNumber, Bytes, B256};
|
||||
use reth_stages_types::StageId;
|
||||
use std::{marker::PhantomData, pin::Pin};
|
||||
use tokio_stream::StreamExt;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ reth-tasks.workspace = true
|
||||
reth-consensus-common.workspace = true
|
||||
reth-beacon-consensus.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-rpc-types-engine.workspace = true
|
||||
|
||||
@@ -15,13 +15,14 @@ use reth_config::config::PruneConfig;
|
||||
use reth_db_api::{database::Database, database_metrics::DatabaseMetrics};
|
||||
use reth_network_p2p::headers::client::HeadersClient;
|
||||
use reth_primitives::{
|
||||
constants::eip4844::MAINNET_KZG_TRUSTED_SETUP, kzg::KzgSettings, stage::StageId,
|
||||
BlockHashOrNumber, BlockNumber, ChainSpec, Head, SealedHeader, B256, MAINNET,
|
||||
constants::eip4844::MAINNET_KZG_TRUSTED_SETUP, kzg::KzgSettings, BlockHashOrNumber,
|
||||
BlockNumber, ChainSpec, Head, SealedHeader, B256, MAINNET,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::StaticFileProvider, BlockHashReader, HeaderProvider, ProviderFactory,
|
||||
StageCheckpointReader,
|
||||
};
|
||||
use reth_stages_types::StageId;
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use reth_tasks::TaskExecutor;
|
||||
use std::{net::SocketAddr, path::PathBuf, sync::Arc};
|
||||
|
||||
@@ -15,14 +15,14 @@ use reth_node_core::{
|
||||
dirs::{ChainPath, DataDirPath},
|
||||
node_config::NodeConfig,
|
||||
};
|
||||
use reth_primitives::{stage::PipelineTarget, BlockNumber, Chain, ChainSpec, Head, B256};
|
||||
use reth_primitives::{BlockNumber, Chain, ChainSpec, Head, B256};
|
||||
use reth_provider::{
|
||||
providers::StaticFileProvider, HeaderSyncMode, ProviderFactory, StaticFileProviderFactory,
|
||||
};
|
||||
use reth_prune::{PruneModes, PrunerBuilder};
|
||||
use reth_rpc_builder::config::RethRpcServerConfig;
|
||||
use reth_rpc_layer::JwtSecret;
|
||||
use reth_stages::{sets::DefaultStages, Pipeline};
|
||||
use reth_stages::{sets::DefaultStages, Pipeline, PipelineTarget};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use reth_tasks::TaskExecutor;
|
||||
use reth_tracing::tracing::{debug, error, info, warn};
|
||||
|
||||
@@ -8,14 +8,10 @@ use reth_beacon_consensus::{
|
||||
use reth_db_api::{database::Database, database_metrics::DatabaseMetadata};
|
||||
use reth_network::{NetworkEvent, NetworkHandle};
|
||||
use reth_network_api::PeersInfo;
|
||||
use reth_primitives::{
|
||||
constants,
|
||||
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
|
||||
BlockNumber, B256,
|
||||
};
|
||||
use reth_primitives::{constants, BlockNumber, B256};
|
||||
use reth_prune::PrunerEvent;
|
||||
use reth_rpc_types::engine::ForkchoiceState;
|
||||
use reth_stages::{ExecOutput, PipelineEvent};
|
||||
use reth_stages::{EntitiesCheckpoint, ExecOutput, PipelineEvent, StageCheckpoint, StageId};
|
||||
use reth_static_file::StaticFileProducerEvent;
|
||||
use std::{
|
||||
fmt::{Display, Formatter},
|
||||
|
||||
@@ -39,7 +39,6 @@ mod receipt;
|
||||
mod request;
|
||||
/// Helpers for working with revm
|
||||
pub mod revm;
|
||||
pub mod stage;
|
||||
pub use reth_static_file_types as static_file;
|
||||
mod storage;
|
||||
pub mod transaction;
|
||||
|
||||
@@ -21,6 +21,7 @@ reth-tokio-util.workspace = true
|
||||
reth-consensus.workspace = true
|
||||
reth-prune.workspace = true
|
||||
reth-errors.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
|
||||
# metrics
|
||||
reth-metrics.workspace = true
|
||||
|
||||
@@ -26,3 +26,6 @@ pub use pipeline::*;
|
||||
pub use stage::*;
|
||||
|
||||
use aquamarine as _;
|
||||
|
||||
// re-export the stages types for convenience
|
||||
pub use reth_stages_types::*;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
use crate::metrics::SyncMetrics;
|
||||
use reth_primitives::{
|
||||
constants::MGAS_TO_GAS,
|
||||
stage::{StageCheckpoint, StageId},
|
||||
BlockNumber,
|
||||
};
|
||||
use crate::{metrics::SyncMetrics, StageCheckpoint, StageId};
|
||||
use reth_primitives::{constants::MGAS_TO_GAS, BlockNumber};
|
||||
use std::{
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::StageId;
|
||||
use reth_metrics::{
|
||||
metrics::{Counter, Gauge},
|
||||
Metrics,
|
||||
};
|
||||
use reth_primitives::stage::StageId;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{pipeline::BoxedStage, MetricEventsSender, Pipeline, Stage, StageSet};
|
||||
use crate::{pipeline::BoxedStage, MetricEventsSender, Pipeline, Stage, StageId, StageSet};
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::{stage::StageId, BlockNumber, B256};
|
||||
use reth_primitives::{BlockNumber, B256};
|
||||
use reth_provider::ProviderFactory;
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use tokio::sync::watch;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::stage::{ExecOutput, UnwindInput, UnwindOutput};
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
BlockNumber,
|
||||
use crate::{
|
||||
stage::{ExecOutput, UnwindInput, UnwindOutput},
|
||||
StageCheckpoint, StageId,
|
||||
};
|
||||
use reth_primitives::BlockNumber;
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
/// An event emitted by a [Pipeline][crate::Pipeline].
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
mod ctrl;
|
||||
mod event;
|
||||
pub use crate::pipeline::ctrl::ControlFlow;
|
||||
use crate::{PipelineTarget, StageCheckpoint, StageId};
|
||||
pub use event::*;
|
||||
use futures_util::Future;
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::{
|
||||
constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH,
|
||||
stage::{PipelineTarget, StageCheckpoint, StageId},
|
||||
static_file::HighestStaticFiles,
|
||||
BlockNumber, B256,
|
||||
constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH, static_file::HighestStaticFiles, BlockNumber,
|
||||
B256,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::StaticFileWriter, FinalizedBlockReader, FinalizedBlockWriter, ProviderFactory,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use crate::Stage;
|
||||
use crate::{Stage, StageId};
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::stage::StageId;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fmt::{Debug, Formatter},
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
use crate::error::StageError;
|
||||
use crate::{error::StageError, StageCheckpoint, StageId};
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
BlockNumber, TxNumber,
|
||||
};
|
||||
use reth_primitives::{BlockNumber, TxNumber};
|
||||
use reth_provider::{BlockReader, DatabaseProviderRW, ProviderError, TransactionsProvider};
|
||||
use std::{
|
||||
cmp::{max, min},
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use crate::{ExecInput, ExecOutput, Stage, StageError, StageId, UnwindInput, UnwindOutput};
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::stage::StageId;
|
||||
use reth_provider::DatabaseProviderRW;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@ use pprof::criterion::{Output, PProfProfiler};
|
||||
use reth_config::config::{EtlConfig, TransactionLookupConfig};
|
||||
use reth_db::{test_utils::TempDatabase, DatabaseEnv};
|
||||
|
||||
use reth_primitives::{stage::StageCheckpoint, BlockNumber};
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_stages::{
|
||||
stages::{MerkleStage, SenderRecoveryStage, TransactionLookupStage},
|
||||
test_utils::TestStageDB,
|
||||
StageCheckpoint,
|
||||
};
|
||||
use reth_stages_api::{ExecInput, Stage, StageExt, UnwindInput};
|
||||
use std::{ops::RangeInclusive, sync::Arc};
|
||||
|
||||
@@ -5,10 +5,11 @@ use reth_db::tables;
|
||||
use reth_db_api::{
|
||||
cursor::DbCursorRO, database::Database, transaction::DbTx, DatabaseError as DbError,
|
||||
};
|
||||
use reth_primitives::{stage::StageCheckpoint, BlockNumber};
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_stages::{
|
||||
stages::{AccountHashingStage, SeedOpts},
|
||||
test_utils::TestStageDB,
|
||||
StageCheckpoint,
|
||||
};
|
||||
use std::{fs, ops::RangeInclusive, path::Path};
|
||||
|
||||
|
||||
@@ -14,17 +14,15 @@ use reth_db_api::{
|
||||
transaction::DbTxMut,
|
||||
};
|
||||
use reth_network_p2p::bodies::{downloader::BodyDownloader, response::BlockResponse};
|
||||
use reth_primitives::{
|
||||
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
|
||||
StaticFileSegment, TxNumber,
|
||||
};
|
||||
use reth_primitives::{StaticFileSegment, TxNumber};
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileWriter},
|
||||
BlockReader, DatabaseProviderRW, HeaderProvider, ProviderError, StatsReader,
|
||||
};
|
||||
use reth_stages_api::{ExecInput, ExecOutput, StageError, UnwindInput, UnwindOutput};
|
||||
|
||||
use reth_stages_api::Stage;
|
||||
use reth_stages_api::{
|
||||
EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId,
|
||||
UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
|
||||
// TODO(onbjerg): Metrics and events (gradual status for e.g. CLI)
|
||||
@@ -397,8 +395,8 @@ fn stage_checkpoint<DB: Database>(
|
||||
mod tests {
|
||||
use assert_matches::assert_matches;
|
||||
|
||||
use reth_primitives::stage::StageUnitCheckpoint;
|
||||
use reth_provider::StaticFileProviderFactory;
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use test_utils::*;
|
||||
|
||||
use crate::test_utils::{
|
||||
|
||||
@@ -5,12 +5,7 @@ use reth_db::{static_file::HeaderMask, tables};
|
||||
use reth_db_api::{cursor::DbCursorRO, database::Database, transaction::DbTx};
|
||||
use reth_evm::execute::{BatchExecutor, BlockExecutorProvider};
|
||||
use reth_exex::{ExExManagerHandle, ExExNotification};
|
||||
use reth_primitives::{
|
||||
stage::{
|
||||
CheckpointBlockRange, EntitiesCheckpoint, ExecutionCheckpoint, StageCheckpoint, StageId,
|
||||
},
|
||||
BlockNumber, Header, StaticFileSegment,
|
||||
};
|
||||
use reth_primitives::{BlockNumber, Header, StaticFileSegment};
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter},
|
||||
BlockReader, BundleStateWithReceipts, Chain, DatabaseProviderRW, HeaderProvider,
|
||||
@@ -20,8 +15,9 @@ use reth_provider::{
|
||||
use reth_prune_types::PruneModes;
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_stages_api::{
|
||||
BlockErrorKind, ExecInput, ExecOutput, MetricEvent, MetricEventsSender, Stage, StageError,
|
||||
UnwindInput, UnwindOutput,
|
||||
BlockErrorKind, CheckpointBlockRange, EntitiesCheckpoint, ExecInput, ExecOutput,
|
||||
ExecutionCheckpoint, MetricEvent, MetricEventsSender, Stage, StageCheckpoint, StageError,
|
||||
StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use std::{
|
||||
cmp::Ordering,
|
||||
@@ -713,14 +709,15 @@ mod tests {
|
||||
use reth_evm_ethereum::execute::EthExecutorProvider;
|
||||
use reth_execution_errors::BlockValidationError;
|
||||
use reth_primitives::{
|
||||
address, hex_literal::hex, keccak256, stage::StageUnitCheckpoint, Account, Address,
|
||||
Bytecode, ChainSpecBuilder, SealedBlock, StorageEntry, B256, U256,
|
||||
address, hex_literal::hex, keccak256, Account, Address, Bytecode, ChainSpecBuilder,
|
||||
SealedBlock, StorageEntry, B256, U256,
|
||||
};
|
||||
use reth_provider::{
|
||||
test_utils::create_test_provider_factory, AccountReader, ReceiptProvider,
|
||||
StaticFileProviderFactory,
|
||||
};
|
||||
use reth_prune_types::{PruneMode, ReceiptsLogPruneConfig};
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
fn stage() -> ExecutionStage<EthExecutorProvider> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::stage::{StageCheckpoint, StageId};
|
||||
use reth_provider::DatabaseProviderRW;
|
||||
use reth_stages_api::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use reth_stages_api::{
|
||||
ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
|
||||
/// The finish stage.
|
||||
///
|
||||
|
||||
@@ -7,13 +7,12 @@ use reth_db_api::{
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_etl::Collector;
|
||||
use reth_primitives::{
|
||||
keccak256,
|
||||
stage::{AccountHashingCheckpoint, EntitiesCheckpoint, StageCheckpoint, StageId},
|
||||
Account, B256,
|
||||
};
|
||||
use reth_primitives::{keccak256, Account, B256};
|
||||
use reth_provider::{AccountExtReader, DatabaseProviderRW, HashingWriter, StatsReader};
|
||||
use reth_stages_api::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use reth_stages_api::{
|
||||
AccountHashingCheckpoint, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint,
|
||||
StageError, StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use std::{
|
||||
fmt::Debug,
|
||||
@@ -296,8 +295,9 @@ mod tests {
|
||||
UnwindStageTestRunner,
|
||||
};
|
||||
use assert_matches::assert_matches;
|
||||
use reth_primitives::{stage::StageUnitCheckpoint, Account, U256};
|
||||
use reth_primitives::{Account, U256};
|
||||
use reth_provider::providers::StaticFileWriter;
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use test_utils::*;
|
||||
|
||||
stage_test_suite_ext!(AccountHashingTestRunner, account_hashing);
|
||||
|
||||
@@ -9,13 +9,12 @@ use reth_db_api::{
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_etl::Collector;
|
||||
use reth_primitives::{
|
||||
keccak256,
|
||||
stage::{EntitiesCheckpoint, StageCheckpoint, StageId, StorageHashingCheckpoint},
|
||||
BufMut, StorageEntry, B256,
|
||||
};
|
||||
use reth_primitives::{keccak256, BufMut, StorageEntry, B256};
|
||||
use reth_provider::{DatabaseProviderRW, HashingWriter, StatsReader, StorageReader};
|
||||
use reth_stages_api::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use reth_stages_api::{
|
||||
EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId,
|
||||
StorageHashingCheckpoint, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use std::{
|
||||
fmt::Debug,
|
||||
|
||||
@@ -10,19 +10,15 @@ use reth_db_api::{
|
||||
};
|
||||
use reth_etl::Collector;
|
||||
use reth_network_p2p::headers::{downloader::HeaderDownloader, error::HeadersDownloaderError};
|
||||
use reth_primitives::{
|
||||
stage::{
|
||||
CheckpointBlockRange, EntitiesCheckpoint, HeadersCheckpoint, StageCheckpoint, StageId,
|
||||
},
|
||||
BlockHash, BlockNumber, SealedHeader, StaticFileSegment,
|
||||
};
|
||||
use reth_primitives::{BlockHash, BlockNumber, SealedHeader, StaticFileSegment};
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileWriter},
|
||||
BlockHashReader, DatabaseProviderRW, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider,
|
||||
HeaderSyncMode,
|
||||
};
|
||||
use reth_stages_api::{
|
||||
BlockErrorKind, ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput,
|
||||
BlockErrorKind, CheckpointBlockRange, EntitiesCheckpoint, ExecInput, ExecOutput,
|
||||
HeadersCheckpoint, Stage, StageCheckpoint, StageError, StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_storage_errors::provider::ProviderError;
|
||||
use std::{
|
||||
@@ -380,12 +376,11 @@ mod tests {
|
||||
stage_test_suite, ExecuteStageTestRunner, StageTestRunner, UnwindStageTestRunner,
|
||||
};
|
||||
use assert_matches::assert_matches;
|
||||
use reth_primitives::{
|
||||
stage::StageUnitCheckpoint, BlockBody, SealedBlock, SealedBlockWithSenders, B256,
|
||||
};
|
||||
use reth_primitives::{BlockBody, SealedBlock, SealedBlockWithSenders, B256};
|
||||
use reth_provider::{
|
||||
BlockWriter, BundleStateWithReceipts, ProviderFactory, StaticFileProviderFactory,
|
||||
};
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use reth_testing_utils::generators::{self, random_header, random_header_range};
|
||||
use reth_trie::{updates::TrieUpdates, HashedPostState};
|
||||
use test_runner::HeadersTestRunner;
|
||||
|
||||
@@ -2,15 +2,14 @@ use super::{collect_history_indices, load_history_indices};
|
||||
use reth_config::config::{EtlConfig, IndexHistoryConfig};
|
||||
use reth_db::tables;
|
||||
use reth_db_api::{database::Database, models::ShardedKey, table::Decode, transaction::DbTxMut};
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Address,
|
||||
};
|
||||
use reth_primitives::Address;
|
||||
use reth_provider::{
|
||||
DatabaseProviderRW, HistoryWriter, PruneCheckpointReader, PruneCheckpointWriter,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment};
|
||||
use reth_stages_api::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use reth_stages_api::{
|
||||
ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use std::fmt::Debug;
|
||||
use tracing::info;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use super::{collect_history_indices, load_history_indices};
|
||||
use crate::{StageCheckpoint, StageId};
|
||||
use reth_config::config::{EtlConfig, IndexHistoryConfig};
|
||||
use reth_db::tables;
|
||||
use reth_db_api::{
|
||||
@@ -7,7 +8,6 @@ use reth_db_api::{
|
||||
table::Decode,
|
||||
transaction::DbTxMut,
|
||||
};
|
||||
use reth_primitives::stage::{StageCheckpoint, StageId};
|
||||
use reth_provider::{
|
||||
DatabaseProviderRW, HistoryWriter, PruneCheckpointReader, PruneCheckpointWriter,
|
||||
};
|
||||
|
||||
@@ -5,16 +5,14 @@ use reth_db_api::{
|
||||
database::Database,
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_primitives::{
|
||||
stage::{EntitiesCheckpoint, MerkleCheckpoint, StageCheckpoint, StageId},
|
||||
BlockNumber, GotExpected, SealedHeader, B256,
|
||||
};
|
||||
use reth_primitives::{BlockNumber, GotExpected, SealedHeader, B256};
|
||||
use reth_provider::{
|
||||
DatabaseProviderRW, HeaderProvider, ProviderError, StageCheckpointReader,
|
||||
StageCheckpointWriter, StatsReader,
|
||||
};
|
||||
use reth_stages_api::{
|
||||
BlockErrorKind, ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput,
|
||||
BlockErrorKind, EntitiesCheckpoint, ExecInput, ExecOutput, MerkleCheckpoint, Stage,
|
||||
StageCheckpoint, StageError, StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_trie::{IntermediateStateRootState, StateRoot, StateRootProgress, StoredSubNode};
|
||||
use std::fmt::Debug;
|
||||
@@ -367,10 +365,9 @@ mod tests {
|
||||
};
|
||||
use assert_matches::assert_matches;
|
||||
use reth_db_api::cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO};
|
||||
use reth_primitives::{
|
||||
keccak256, stage::StageUnitCheckpoint, SealedBlock, StaticFileSegment, StorageEntry, U256,
|
||||
};
|
||||
use reth_primitives::{keccak256, SealedBlock, StaticFileSegment, StorageEntry, U256};
|
||||
use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory};
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use reth_testing_utils::{
|
||||
generators,
|
||||
generators::{
|
||||
|
||||
@@ -56,12 +56,8 @@ mod tests {
|
||||
use reth_evm_ethereum::execute::EthExecutorProvider;
|
||||
use reth_exex::ExExManagerHandle;
|
||||
use reth_primitives::{
|
||||
address,
|
||||
hex_literal::hex,
|
||||
keccak256,
|
||||
stage::{PipelineTarget, StageCheckpoint, StageId},
|
||||
Account, BlockNumber, Bytecode, ChainSpecBuilder, SealedBlock, StaticFileSegment, B256,
|
||||
U256,
|
||||
address, hex_literal::hex, keccak256, Account, BlockNumber, Bytecode, ChainSpecBuilder,
|
||||
SealedBlock, StaticFileSegment, B256, U256,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::StaticFileWriter, AccountExtReader, BlockReader, DatabaseProviderFactory,
|
||||
@@ -69,7 +65,7 @@ mod tests {
|
||||
StaticFileProviderFactory, StorageReader,
|
||||
};
|
||||
use reth_prune_types::{PruneMode, PruneModes};
|
||||
use reth_stages_api::{ExecInput, Stage};
|
||||
use reth_stages_api::{ExecInput, PipelineTarget, Stage, StageCheckpoint, StageId};
|
||||
use reth_testing_utils::generators::{self, random_block, random_block_range, random_receipt};
|
||||
use std::{io::Write, sync::Arc};
|
||||
|
||||
|
||||
@@ -6,17 +6,15 @@ use reth_db_api::{
|
||||
database::Database,
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_primitives::{
|
||||
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
|
||||
Address, StaticFileSegment, TransactionSignedNoHash, TxNumber,
|
||||
};
|
||||
use reth_primitives::{Address, StaticFileSegment, TransactionSignedNoHash, TxNumber};
|
||||
use reth_provider::{
|
||||
BlockReader, DatabaseProviderRW, HeaderProvider, ProviderError, PruneCheckpointReader,
|
||||
StatsReader,
|
||||
};
|
||||
use reth_prune_types::PruneSegment;
|
||||
use reth_stages_api::{
|
||||
BlockErrorKind, ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput,
|
||||
BlockErrorKind, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError,
|
||||
StageId, UnwindInput, UnwindOutput,
|
||||
};
|
||||
use std::{fmt::Debug, ops::Range, sync::mpsc};
|
||||
use thiserror::Error;
|
||||
@@ -282,14 +280,13 @@ struct FailedSenderRecoveryError {
|
||||
mod tests {
|
||||
use assert_matches::assert_matches;
|
||||
use reth_db_api::cursor::DbCursorRO;
|
||||
use reth_primitives::{
|
||||
stage::StageUnitCheckpoint, BlockNumber, SealedBlock, TransactionSigned, B256,
|
||||
};
|
||||
use reth_primitives::{BlockNumber, SealedBlock, TransactionSigned, B256};
|
||||
use reth_provider::{
|
||||
providers::StaticFileWriter, PruneCheckpointWriter, StaticFileProviderFactory,
|
||||
TransactionsProvider,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneMode};
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use reth_testing_utils::{
|
||||
generators,
|
||||
generators::{random_block, random_block_range},
|
||||
|
||||
@@ -7,16 +7,16 @@ use reth_db_api::{
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_etl::Collector;
|
||||
use reth_primitives::{
|
||||
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
|
||||
TxHash, TxNumber,
|
||||
};
|
||||
use reth_primitives::{TxHash, TxNumber};
|
||||
use reth_provider::{
|
||||
BlockReader, DatabaseProviderRW, PruneCheckpointReader, PruneCheckpointWriter, StatsReader,
|
||||
TransactionsProvider, TransactionsProviderExt,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment};
|
||||
use reth_stages_api::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
|
||||
use reth_stages_api::{
|
||||
EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId,
|
||||
UnwindInput, UnwindOutput,
|
||||
};
|
||||
use reth_storage_errors::provider::ProviderError;
|
||||
use tracing::*;
|
||||
|
||||
@@ -242,8 +242,9 @@ mod tests {
|
||||
TestRunnerError, TestStageDB, UnwindStageTestRunner,
|
||||
};
|
||||
use assert_matches::assert_matches;
|
||||
use reth_primitives::{stage::StageUnitCheckpoint, BlockNumber, SealedBlock, B256};
|
||||
use reth_primitives::{BlockNumber, SealedBlock, B256};
|
||||
use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory};
|
||||
use reth_stages_api::StageUnitCheckpoint;
|
||||
use reth_testing_utils::{
|
||||
generators,
|
||||
generators::{random_block, random_block_range},
|
||||
|
||||
@@ -36,7 +36,7 @@ macro_rules! stage_test_suite {
|
||||
let mut runner = $runner::default();
|
||||
let input = reth_stages_api::ExecInput {
|
||||
target: Some(target),
|
||||
checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(current_checkpoint)),
|
||||
checkpoint: Some(crate::StageCheckpoint::new(current_checkpoint)),
|
||||
};
|
||||
let seed = runner.seed_execution(input).expect("failed to seed");
|
||||
let rx = runner.execute(input);
|
||||
@@ -100,7 +100,7 @@ macro_rules! stage_test_suite {
|
||||
let mut runner = $runner::default();
|
||||
let execute_input = reth_stages_api::ExecInput {
|
||||
target: Some(target),
|
||||
checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(current_checkpoint)),
|
||||
checkpoint: Some(crate::StageCheckpoint::new(current_checkpoint)),
|
||||
};
|
||||
let seed = runner.seed_execution(execute_input).expect("failed to seed");
|
||||
|
||||
@@ -127,7 +127,7 @@ macro_rules! stage_test_suite {
|
||||
// Run stage unwind
|
||||
let unwind_input = reth_stages_api::UnwindInput {
|
||||
unwind_to: current_checkpoint,
|
||||
checkpoint: reth_primitives::stage::StageCheckpoint::new(target),
|
||||
checkpoint: crate::StageCheckpoint::new(target),
|
||||
bad_block: None,
|
||||
};
|
||||
|
||||
@@ -167,7 +167,7 @@ macro_rules! stage_test_suite_ext {
|
||||
let mut runner = $runner::default();
|
||||
let input = reth_stages_api::ExecInput {
|
||||
target: Some(current_checkpoint),
|
||||
checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(current_checkpoint)),
|
||||
checkpoint: Some(crate::StageCheckpoint::new(current_checkpoint)),
|
||||
};
|
||||
let seed = runner.seed_execution(input).expect("failed to seed");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use reth_primitives::stage::StageId;
|
||||
use reth_stages_api::StageId;
|
||||
|
||||
#[cfg(test)]
|
||||
mod macros;
|
||||
|
||||
28
crates/stages/types/Cargo.toml
Normal file
28
crates/stages/types/Cargo.toml
Normal file
@@ -0,0 +1,28 @@
|
||||
[package]
|
||||
name = "reth-stages-types"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
homepage.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "Commonly used types for stages usage in reth."
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
reth-codecs.workspace = true
|
||||
reth-trie-types.workspace = true
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
modular-bitfield.workspace = true
|
||||
bytes.workspace = true
|
||||
serde.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
arbitrary = { workspace = true, features = ["derive"] }
|
||||
proptest.workspace = true
|
||||
proptest-derive.workspace = true
|
||||
test-fuzz.workspace = true
|
||||
rand.workspace = true
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{Address, BlockNumber, B256};
|
||||
use alloy_primitives::{Address, BlockNumber, B256};
|
||||
use bytes::Buf;
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use reth_trie_types::{hash_builder::HashBuilderState, StoredSubNode};
|
||||
@@ -1,7 +1,17 @@
|
||||
//! Staged sync primitives.
|
||||
//! Commonly used types for staged sync usage.
|
||||
|
||||
#![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(not(test), warn(unused_crate_dependencies))]
|
||||
// TODO: remove when https://github.com/proptest-rs/proptest/pull/427 is merged
|
||||
#![allow(unknown_lints, non_local_definitions)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod id;
|
||||
use crate::{BlockHash, BlockNumber};
|
||||
use alloy_primitives::{BlockHash, BlockNumber};
|
||||
pub use id::StageId;
|
||||
|
||||
mod checkpoints;
|
||||
@@ -17,6 +17,7 @@ reth-codecs.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-storage-errors.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-trie-types.workspace = true
|
||||
|
||||
# codecs
|
||||
|
||||
@@ -5,8 +5,9 @@ use crate::{
|
||||
DatabaseError,
|
||||
};
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use reth_primitives::{stage::StageCheckpoint, Address, B256, *};
|
||||
use reth_primitives::{Address, B256, *};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::StageCheckpoint;
|
||||
use reth_trie_types::{StoredNibbles, StoredNibblesSubKey, *};
|
||||
|
||||
pub mod accounts;
|
||||
@@ -298,15 +299,15 @@ add_wrapper_struct!((ClientVersion, CompactClientVersion));
|
||||
mod tests {
|
||||
use super::*;
|
||||
use reth_primitives::{
|
||||
stage::{
|
||||
AccountHashingCheckpoint, CheckpointBlockRange, EntitiesCheckpoint,
|
||||
ExecutionCheckpoint, HeadersCheckpoint, IndexHistoryCheckpoint, StageCheckpoint,
|
||||
StageUnitCheckpoint, StorageHashingCheckpoint,
|
||||
},
|
||||
Account, Header, Receipt, ReceiptWithBloom, SealedHeader, TxEip1559, TxEip2930, TxEip4844,
|
||||
TxLegacy, Withdrawals,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneMode, PruneSegment};
|
||||
use reth_stages_types::{
|
||||
AccountHashingCheckpoint, CheckpointBlockRange, EntitiesCheckpoint, ExecutionCheckpoint,
|
||||
HeadersCheckpoint, IndexHistoryCheckpoint, StageCheckpoint, StageUnitCheckpoint,
|
||||
StorageHashingCheckpoint,
|
||||
};
|
||||
|
||||
// each value in the database has an extra field named flags that encodes metadata about other
|
||||
// fields in the value, e.g. offset and length.
|
||||
|
||||
@@ -17,6 +17,7 @@ reth-config.workspace = true
|
||||
reth-trie.workspace = true
|
||||
reth-etl.workspace = true
|
||||
reth-codecs.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
|
||||
# misc
|
||||
eyre.workspace = true
|
||||
|
||||
@@ -6,7 +6,6 @@ use reth_db::tables;
|
||||
use reth_db_api::{database::Database, transaction::DbTxMut, DatabaseError};
|
||||
use reth_etl::Collector;
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Account, Address, Bytecode, ChainSpec, GenesisAccount, Receipts, StaticFileSegment,
|
||||
StorageEntry, B256, U256,
|
||||
};
|
||||
@@ -18,6 +17,7 @@ use reth_provider::{
|
||||
DatabaseProviderRW, HashingWriter, HistoryWriter, OriginalValuesKnown, ProviderError,
|
||||
ProviderFactory, StageCheckpointWriter, StateWriter, StaticFileProviderFactory,
|
||||
};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_trie::{IntermediateStateRootState, StateRoot as StateRootComputer, StateRootProgress};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
|
||||
@@ -23,6 +23,7 @@ reth-libmdbx = { workspace = true, optional = true, features = [
|
||||
] }
|
||||
reth-nippy-jar.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-tracing.workspace = true
|
||||
reth-trie-types.workspace = true
|
||||
|
||||
|
||||
@@ -32,10 +32,11 @@ use reth_db_api::{
|
||||
table::{Decode, DupSort, Encode, Table},
|
||||
};
|
||||
use reth_primitives::{
|
||||
stage::StageCheckpoint, Account, Address, BlockHash, BlockNumber, Bytecode, Header,
|
||||
IntegerList, Receipt, Requests, StorageEntry, TransactionSignedNoHash, TxHash, TxNumber, B256,
|
||||
Account, Address, BlockHash, BlockNumber, Bytecode, Header, IntegerList, Receipt, Requests,
|
||||
StorageEntry, TransactionSignedNoHash, TxHash, TxNumber, B256,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::StageCheckpoint;
|
||||
use reth_trie_types::{StorageTrieEntry, StoredBranchNode, StoredNibbles, StoredNibblesSubKey};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
@@ -24,6 +24,7 @@ reth-network-p2p.workspace = true
|
||||
reth-db = { workspace = true, features = ["mdbx"] }
|
||||
reth-db-api.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-trie = { workspace = true, features = ["metrics"] }
|
||||
reth-nippy-jar.workspace = true
|
||||
reth-codecs.workspace = true
|
||||
|
||||
@@ -13,13 +13,13 @@ use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
|
||||
use reth_errors::{RethError, RethResult};
|
||||
use reth_evm::ConfigureEvmEnv;
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo,
|
||||
ChainSpec, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
|
||||
StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash,
|
||||
TxNumber, Withdrawal, Withdrawals, B256, U256,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
|
||||
use std::{
|
||||
|
||||
@@ -32,7 +32,6 @@ use reth_network_p2p::headers::downloader::SyncTarget;
|
||||
use reth_primitives::{
|
||||
keccak256,
|
||||
revm::{config::revm_spec, env::fill_block_env},
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders,
|
||||
ChainInfo, ChainSpec, GotExpected, Head, Header, Receipt, Requests, SealedBlock,
|
||||
SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta,
|
||||
@@ -40,6 +39,7 @@ use reth_primitives::{
|
||||
Withdrawal, Withdrawals, B256, U256,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneLimiter, PruneModes, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_errors::provider::{ProviderResult, RootMismatch};
|
||||
use reth_trie::{
|
||||
prefix_set::{PrefixSet, PrefixSetMut, TriePrefixSets},
|
||||
|
||||
@@ -18,13 +18,13 @@ use reth_db_api::{
|
||||
};
|
||||
use reth_evm::ConfigureEvmEnv;
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber,
|
||||
BlockNumberOrTag, BlockWithSenders, ChainInfo, ChainSpec, Header, Receipt, SealedBlock,
|
||||
SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned,
|
||||
TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
|
||||
use std::{
|
||||
|
||||
@@ -23,13 +23,13 @@ use reth_db_api::{
|
||||
use reth_nippy_jar::NippyJar;
|
||||
use reth_primitives::{
|
||||
keccak256,
|
||||
stage::{PipelineTarget, StageId},
|
||||
static_file::{find_fixed_range, HighestStaticFiles, SegmentHeader, SegmentRangeInclusive},
|
||||
Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo, Header,
|
||||
Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta,
|
||||
TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256,
|
||||
U256,
|
||||
};
|
||||
use reth_stages_types::{PipelineTarget, StageId};
|
||||
use reth_storage_errors::provider::{ProviderError, ProviderResult};
|
||||
use std::{
|
||||
collections::{hash_map::Entry, BTreeMap, HashMap},
|
||||
|
||||
@@ -9,14 +9,14 @@ use crate::{
|
||||
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
|
||||
use reth_evm::ConfigureEvmEnv;
|
||||
use reth_primitives::{
|
||||
proofs::AccountProof,
|
||||
stage::{StageCheckpoint, StageId},
|
||||
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, BlockWithSenders,
|
||||
Bytecode, ChainInfo, ChainSpec, Header, Receipt, SealedBlock, SealedBlockWithSenders,
|
||||
SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned,
|
||||
TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, MAINNET, U256,
|
||||
proofs::AccountProof, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId,
|
||||
BlockNumber, BlockWithSenders, Bytecode, ChainInfo, ChainSpec, Header, Receipt, SealedBlock,
|
||||
SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta,
|
||||
TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256,
|
||||
MAINNET, U256,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use reth_trie::updates::TrieUpdates;
|
||||
use revm::{
|
||||
|
||||
@@ -17,6 +17,7 @@ reth-execution-types.workspace = true
|
||||
reth-db-api.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-storage-errors.workspace = true
|
||||
reth-trie.workspace = true
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use reth_primitives::{
|
||||
stage::{StageCheckpoint, StageId},
|
||||
BlockNumber,
|
||||
};
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
|
||||
/// The trait for fetching stage checkpoint related data.
|
||||
|
||||
@@ -17,6 +17,7 @@ reth-primitives.workspace = true
|
||||
reth-execution-errors.workspace = true
|
||||
reth-db.workspace = true
|
||||
reth-db-api.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-trie-types.workspace = true
|
||||
|
||||
revm.workspace = true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::{hash_builder::HashBuilder, trie_cursor::CursorSubNode, updates::TrieUpdates};
|
||||
use reth_primitives::{stage::MerkleCheckpoint, B256};
|
||||
use reth_primitives::B256;
|
||||
use reth_stages_types::MerkleCheckpoint;
|
||||
|
||||
/// The progress of the state root computation.
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user