chore: move primitives/prune to reth-prune-types (#8676)

This commit is contained in:
joshieDo
2024-06-07 17:24:39 +02:00
committed by GitHub
parent 977def880a
commit ade059235b
86 changed files with 268 additions and 151 deletions

39
Cargo.lock generated
View File

@ -6210,6 +6210,7 @@ dependencies = [
"reth-payload-validator",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-revm",
"reth-rpc",
"reth-rpc-api",
@ -6306,6 +6307,7 @@ dependencies = [
"reth-primitives",
"reth-provider",
"reth-prune",
"reth-prune-types",
"reth-revm",
"reth-rpc",
"reth-rpc-types",
@ -6344,6 +6346,7 @@ dependencies = [
"reth-network",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-revm",
"reth-stages-api",
"reth-storage-errors",
@ -6411,7 +6414,7 @@ dependencies = [
"confy",
"humantime-serde",
"reth-network",
"reth-primitives",
"reth-prune-types",
"serde",
"tempfile",
"toml",
@ -6460,6 +6463,7 @@ dependencies = [
"reth-metrics",
"reth-nippy-jar",
"reth-primitives",
"reth-prune-types",
"reth-storage-errors",
"reth-tracing",
"rustc-hash",
@ -6492,6 +6496,7 @@ dependencies = [
"rand 0.8.5",
"reth-codecs",
"reth-primitives",
"reth-prune-types",
"reth-storage-errors",
"serde",
"serde_json",
@ -6838,6 +6843,7 @@ dependencies = [
"parking_lot 0.12.3",
"reth-execution-errors",
"reth-primitives",
"reth-prune-types",
"reth-storage-errors",
"revm",
"revm-primitives",
@ -6852,6 +6858,7 @@ dependencies = [
"reth-ethereum-consensus",
"reth-evm",
"reth-primitives",
"reth-prune-types",
"reth-revm",
"reth-testing-utils",
"revm-primitives",
@ -6869,6 +6876,7 @@ dependencies = [
"reth-optimism-consensus",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-revm",
"revm",
"revm-primitives",
@ -6882,6 +6890,7 @@ version = "0.2.0-beta.9"
dependencies = [
"reth-consensus",
"reth-primitives",
"reth-prune-types",
"reth-storage-errors",
"thiserror",
]
@ -7275,6 +7284,7 @@ dependencies = [
"reth-network-types",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-rpc",
"reth-rpc-api",
"reth-rpc-builder",
@ -7543,6 +7553,7 @@ dependencies = [
"reth-network-p2p",
"reth-nippy-jar",
"reth-primitives",
"reth-prune-types",
"reth-storage-api",
"reth-storage-errors",
"reth-testing-utils",
@ -7559,6 +7570,7 @@ dependencies = [
name = "reth-prune"
version = "0.2.0-beta.9"
dependencies = [
"alloy-primitives",
"assert_matches",
"itertools 0.12.1",
"metrics",
@ -7570,6 +7582,7 @@ dependencies = [
"reth-metrics",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-stages",
"reth-testing-utils",
"reth-tokio-util",
@ -7579,6 +7592,26 @@ dependencies = [
"tracing",
]
[[package]]
name = "reth-prune-types"
version = "0.2.0-beta.9"
dependencies = [
"alloy-primitives",
"arbitrary",
"assert_matches",
"bytes",
"derive_more",
"modular-bitfield",
"proptest",
"proptest-derive",
"reth-codecs",
"serde",
"serde_json",
"test-fuzz",
"thiserror",
"toml",
]
[[package]]
name = "reth-revm"
version = "0.2.0-beta.9"
@ -7588,6 +7621,7 @@ dependencies = [
"reth-consensus-common",
"reth-execution-errors",
"reth-primitives",
"reth-prune-types",
"reth-storage-api",
"reth-storage-errors",
"reth-trie",
@ -7836,6 +7870,7 @@ dependencies = [
"reth-network-types",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-revm",
"reth-stages-api",
"reth-static-file",
@ -7887,6 +7922,7 @@ dependencies = [
"reth-nippy-jar",
"reth-primitives",
"reth-provider",
"reth-prune-types",
"reth-stages",
"reth-storage-errors",
"reth-testing-utils",
@ -7914,6 +7950,7 @@ dependencies = [
"reth-db-api",
"reth-execution-types",
"reth-primitives",
"reth-prune-types",
"reth-storage-errors",
"reth-trie",
"revm",

View File

@ -53,7 +53,8 @@ members = [
"crates/payload/primitives/",
"crates/payload/validator/",
"crates/primitives/",
"crates/prune/",
"crates/prune/prune",
"crates/prune/types",
"crates/revm/",
"crates/rpc/ipc/",
"crates/rpc/rpc-api/",
@ -295,7 +296,8 @@ reth-payload-primitives = { path = "crates/payload/primitives" }
reth-payload-validator = { path = "crates/payload/validator" }
reth-primitives = { path = "crates/primitives" }
reth-provider = { path = "crates/storage/provider" }
reth-prune = { path = "crates/prune" }
reth-prune = { path = "crates/prune/prune" }
reth-prune-types = { path = "crates/prune/types" }
reth-revm = { path = "crates/revm" }
reth-rpc = { path = "crates/rpc/rpc" }
reth-rpc-api = { path = "crates/rpc/rpc-api" }

View File

@ -63,6 +63,7 @@ reth-node-builder.workspace = true
reth-node-events.workspace = true
reth-consensus.workspace = true
reth-optimism-primitives.workspace = true
reth-prune-types.workspace = true
# crypto
alloy-rlp.workspace = true

View File

@ -22,10 +22,11 @@ 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, PruneModes, B256};
use reth_primitives::{stage::StageId, BlockHashOrNumber, BlockNumber, B256};
use reth_provider::{
BlockExecutionWriter, ChainSpecProvider, HeaderSyncMode, ProviderFactory, StageCheckpointReader,
};
use reth_prune_types::PruneModes;
use reth_stages::{
sets::DefaultStages,
stages::{ExecutionStage, ExecutionStageThresholds},

View File

@ -18,11 +18,12 @@ use reth_evm::execute::{BatchBlockExecutionOutput, BatchExecutor, BlockExecutorP
use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_network_p2p::full_block::FullBlockClient;
use reth_primitives::{stage::StageCheckpoint, BlockHashOrNumber, PruneModes};
use reth_primitives::{stage::StageCheckpoint, BlockHashOrNumber};
use reth_provider::{
BlockNumReader, BlockWriter, BundleStateWithReceipts, ChainSpecProvider, HeaderProvider,
LatestStateProviderRef, OriginalValuesKnown, ProviderError, ProviderFactory, StateWriter,
};
use reth_prune_types::PruneModes;
use reth_revm::database::StateProviderDatabase;
use reth_stages::{
stages::{AccountHashingStage, MerkleStage, StorageHashingStage},

View File

@ -19,10 +19,10 @@ use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_node_core::engine::engine_store::{EngineMessageStore, StoredEngineApiMessage};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_primitives::PruneModes;
use reth_provider::{
providers::BlockchainProvider, CanonStateSubscriptions, ChainSpecProvider, ProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages::Pipeline;
use reth_static_file::StaticFileProducer;
use reth_tasks::TaskExecutor;

View File

@ -22,11 +22,12 @@ use reth_network_p2p::{
headers::downloader::{HeaderDownloader, SyncTarget},
};
use reth_node_events::node::NodeEvent;
use reth_primitives::{stage::StageId, PruneModes, B256};
use reth_primitives::{stage::StageId, B256};
use reth_provider::{
BlockNumReader, ChainSpecProvider, HeaderProvider, HeaderSyncMode, ProviderError,
ProviderFactory, StageCheckpointReader,
};
use reth_prune_types::PruneModes;
use reth_stages::{prelude::*, Pipeline, StageSet};
use reth_static_file::StaticFileProducer;
use std::{path::PathBuf, sync::Arc};

View File

@ -16,8 +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, PruneModes};
use reth_primitives::stage::StageId;
use reth_provider::StageCheckpointReader;
use reth_prune_types::PruneModes;
use reth_static_file::StaticFileProducer;
use std::{path::PathBuf, sync::Arc};
use tracing::{debug, error, info};

View File

@ -6,8 +6,9 @@ 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, PruneModes};
use reth_primitives::{stage::StageCheckpoint, BlockNumber};
use reth_provider::{providers::StaticFileProvider, ProviderFactory};
use reth_prune_types::PruneModes;
use reth_stages::{
stages::{
AccountHashingStage, ExecutionStage, ExecutionStageThresholds, MerkleStage,

View File

@ -8,11 +8,12 @@ use reth_db_api::database::Database;
use reth_downloaders::{bodies::noop::NoopBodiesDownloader, headers::noop::NoopHeaderDownloader};
use reth_exex::ExExManagerHandle;
use reth_node_core::args::NetworkArgs;
use reth_primitives::{BlockHashOrNumber, BlockNumber, PruneModes, B256};
use reth_primitives::{BlockHashOrNumber, BlockNumber, B256};
use reth_provider::{
BlockExecutionWriter, BlockNumReader, ChainSpecProvider, FinalizedBlockReader,
FinalizedBlockWriter, HeaderSyncMode, ProviderFactory, StaticFileProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages::{
sets::DefaultStages,
stages::{ExecutionStage, ExecutionStageThresholds},

View File

@ -21,6 +21,7 @@ reth-db-api.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-provider.workspace = true
reth-prune-types.workspace = true
reth-stages-api.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }
reth-trie-parallel = { workspace = true, features = ["parallel"] }

View File

@ -14,8 +14,8 @@ use reth_db_api::database::Database;
use reth_evm::execute::BlockExecutorProvider;
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_primitives::{
BlockHash, BlockNumHash, BlockNumber, ForkBlock, GotExpected, Hardfork, PruneModes, Receipt,
SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, B256, U256,
BlockHash, BlockNumHash, BlockNumber, ForkBlock, GotExpected, Hardfork, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, StaticFileSegment, B256, U256,
};
use reth_provider::{
BlockExecutionWriter, BlockNumReader, BlockWriter, BundleStateWithReceipts,
@ -23,6 +23,7 @@ use reth_provider::{
ChainSpecProvider, ChainSplit, ChainSplitTarget, DisplayBlocksChain, HeaderProvider,
ProviderError, StaticFileProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages_api::{MetricEvent, MetricEventsSender};
use reth_storage_errors::provider::{ProviderResult, RootMismatch};
use std::{

View File

@ -13,7 +13,7 @@ workspace = true
[dependencies]
# reth
reth-network.workspace = true
reth-primitives.workspace = true
reth-prune-types.workspace = true
# serde
serde.workspace = true

View File

@ -1,7 +1,7 @@
//! Configuration files.
use reth_network::{PeersConfig, SessionsConfig};
use reth_primitives::PruneModes;
use reth_prune_types::PruneModes;
use serde::{Deserialize, Deserializer, Serialize};
use std::{
ffi::OsStr,

View File

@ -66,6 +66,7 @@ reth-evm-ethereum.workspace = true
reth-ethereum-engine-primitives.workspace = true
reth-config.workspace = true
reth-testing-utils.workspace = true
reth-prune-types.workspace = true
assert_matches.workspace = true

View File

@ -432,11 +432,12 @@ mod tests {
use reth_network_p2p::{either::Either, test_utils::TestFullBlockClient};
use reth_primitives::{
constants::ETHEREUM_BLOCK_GAS_LIMIT, stage::StageCheckpoint, BlockBody, ChainSpecBuilder,
Header, PruneModes, SealedHeader, MAINNET,
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_static_file::StaticFileProducer;
use reth_tasks::TokioTaskExecutor;

View File

@ -21,12 +21,13 @@ use reth_network_p2p::{
test_utils::NoopFullBlockClient,
};
use reth_payload_builder::test_utils::spawn_test_payload_service;
use reth_primitives::{BlockNumber, ChainSpec, FinishedExExHeight, PruneModes, B256};
use reth_primitives::{BlockNumber, ChainSpec, FinishedExExHeight, B256};
use reth_provider::{
providers::BlockchainProvider, test_utils::create_test_provider_factory_with_chain_spec,
BundleStateWithReceipts, HeaderSyncMode,
};
use reth_prune::Pruner;
use reth_prune_types::PruneModes;
use reth_rpc_types::engine::{
CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus,
};

View File

@ -16,6 +16,7 @@ reth-evm.workspace = true
reth-primitives.workspace = true
reth-revm.workspace = true
reth-ethereum-consensus.workspace = true
reth-prune-types.workspace = true
# Ethereum
revm-primitives.workspace = true

View File

@ -13,9 +13,10 @@ use reth_evm::{
ConfigureEvm,
};
use reth_primitives::{
BlockNumber, BlockWithSenders, ChainSpec, Hardfork, Header, PruneModes, Receipt, Request,
Withdrawals, MAINNET, U256,
BlockNumber, BlockWithSenders, ChainSpec, Hardfork, Header, Receipt, Request, Withdrawals,
MAINNET, U256,
};
use reth_prune_types::PruneModes;
use reth_revm::{
batch::{BlockBatchRecord, BlockExecutorStats},
db::states::bundle_state::BundleRetention,

View File

@ -15,6 +15,7 @@ workspace = true
reth-execution-errors.workspace = true
reth-primitives.workspace = true
revm-primitives.workspace = true
reth-prune-types.workspace = true
reth-storage-errors.workspace = true
revm.workspace = true

View File

@ -15,5 +15,5 @@ workspace = true
reth-consensus.workspace = true
reth-primitives.workspace = true
reth-storage-errors.workspace = true
reth-prune-types.workspace = true
thiserror.workspace = true

View File

@ -9,7 +9,8 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_consensus::ConsensusError;
use reth_primitives::{revm_primitives::EVMError, BlockNumHash, PruneSegmentError, B256};
use reth_primitives::{revm_primitives::EVMError, BlockNumHash, B256};
use reth_prune_types::PruneSegmentError;
use reth_storage_errors::provider::ProviderError;
use std::fmt::Display;
use thiserror::Error;

View File

@ -5,7 +5,8 @@ use crate::execute::{
BlockExecutorProvider, Executor,
};
use reth_execution_errors::BlockExecutionError;
use reth_primitives::{BlockNumber, BlockWithSenders, PruneModes, Receipt};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm_primitives::db::Database;

View File

@ -1,8 +1,7 @@
//! Traits for execution.
use reth_primitives::{
BlockNumber, BlockWithSenders, PruneModes, Receipt, Receipts, Request, Requests, U256,
};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt, Receipts, Request, Requests, U256};
use reth_prune_types::PruneModes;
use revm::db::BundleState;
use revm_primitives::db::Database;

View File

@ -1,7 +1,8 @@
//! A no operation block executor implementation.
use reth_execution_errors::BlockExecutionError;
use reth_primitives::{BlockNumber, BlockWithSenders, PruneModes, Receipt};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm_primitives::db::Database;

View File

@ -6,7 +6,8 @@ use crate::execute::{
};
use parking_lot::Mutex;
use reth_execution_errors::BlockExecutionError;
use reth_primitives::{BlockNumber, BlockWithSenders, PruneModes, Receipt};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm_primitives::db::Database;
use std::sync::Arc;

View File

@ -36,6 +36,7 @@ reth-engine-primitives.workspace = true
reth-tasks.workspace = true
reth-consensus-common.workspace = true
reth-beacon-consensus.workspace = true
reth-prune-types.workspace = true
# ethereum
alloy-rpc-types-engine.workspace = true

View File

@ -2,9 +2,8 @@
use clap::Args;
use reth_config::config::PruneConfig;
use reth_primitives::{
ChainSpec, PruneMode, PruneModes, ReceiptsLogPruneConfig, MINIMUM_PRUNING_DISTANCE,
};
use reth_primitives::ChainSpec;
use reth_prune_types::{PruneMode, PruneModes, ReceiptsLogPruneConfig, MINIMUM_PRUNING_DISTANCE};
/// Parameters for pruning and full node
#[derive(Debug, Clone, Args, PartialEq, Eq, Default)]

View File

@ -16,13 +16,11 @@ use reth_node_core::{
dirs::{ChainPath, DataDirPath},
node_config::NodeConfig,
};
use reth_primitives::{
stage::PipelineTarget, BlockNumber, Chain, ChainSpec, Head, PruneModes, B256,
};
use reth_primitives::{stage::PipelineTarget, BlockNumber, Chain, ChainSpec, Head, B256};
use reth_provider::{
providers::StaticFileProvider, HeaderSyncMode, ProviderFactory, StaticFileProviderFactory,
};
use reth_prune::PrunerBuilder;
use reth_prune::{PruneModes, PrunerBuilder};
use reth_rpc_layer::JwtSecret;
use reth_stages::{sets::DefaultStages, Pipeline};
use reth_static_file::StaticFileProducer;

View File

@ -17,6 +17,7 @@ reth-primitives.workspace = true
reth-revm.workspace = true
reth-execution-errors.workspace = true
reth-provider.workspace = true
reth-prune-types.workspace = true
reth-consensus-common.workspace = true
# Optimism

View File

@ -10,9 +10,10 @@ use reth_evm::{
};
use reth_optimism_consensus::validate_block_post_execution;
use reth_primitives::{
BlockNumber, BlockWithSenders, ChainSpec, Hardfork, Header, PruneModes, Receipt, Receipts,
TxType, Withdrawals, U256,
BlockNumber, BlockWithSenders, ChainSpec, Hardfork, Header, Receipt, Receipts, TxType,
Withdrawals, U256,
};
use reth_prune_types::PruneModes;
use reth_revm::{
batch::{BlockBatchRecord, BlockExecutorStats},
db::states::bundle_state::BundleRetention,

View File

@ -36,7 +36,6 @@ mod integer_list;
mod log;
mod net;
pub mod proofs;
mod prune;
mod receipt;
mod request;
/// Helpers for working with revm
@ -76,11 +75,6 @@ pub use net::{
NodeRecordParseError, TrustedPeer, GOERLI_BOOTNODES, HOLESKY_BOOTNODES, MAINNET_BOOTNODES,
SEPOLIA_BOOTNODES,
};
pub use prune::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneModes, PruneProgress,
PrunePurpose, PruneSegment, PruneSegmentError, ReceiptsLogPruneConfig,
MINIMUM_PRUNING_DISTANCE,
};
pub use receipt::{
gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts,
};

View File

@ -20,10 +20,12 @@ reth-errors.workspace = true
reth-provider.workspace = true
reth-tokio-util.workspace = true
reth-config.workspace = true
reth-prune-types.workspace = true
# metrics
reth-metrics.workspace = true
metrics.workspace = true
alloy-primitives.workspace = true
# misc
tracing.workspace = true

View File

@ -1,8 +1,9 @@
use crate::{segments::SegmentSet, Pruner};
use reth_config::PruneConfig;
use reth_db_api::database::Database;
use reth_primitives::{FinishedExExHeight, PruneModes, MAINNET};
use reth_primitives::{FinishedExExHeight, MAINNET};
use reth_provider::ProviderFactory;
use reth_prune_types::PruneModes;
use std::time::Duration;
use tokio::sync::watch;

View File

@ -1,7 +1,7 @@
use reth_db::DatabaseError;
use reth_errors::RethError;
use reth_primitives::PruneSegmentError;
use reth_provider::ProviderError;
use reth_prune_types::PruneSegmentError;
use thiserror::Error;
/// Errors that can occur during pruning.

View File

@ -1,4 +1,5 @@
use reth_primitives::{BlockNumber, PruneProgress, PruneSegment};
use alloy_primitives::BlockNumber;
use reth_prune_types::{PruneProgress, PruneSegment};
use std::{collections::BTreeMap, time::Duration};
/// An event emitted by a [Pruner][crate::Pruner].

View File

@ -21,3 +21,7 @@ pub use builder::PrunerBuilder;
pub use error::PrunerError;
pub use event::PrunerEvent;
pub use pruner::{Pruner, PrunerResult, PrunerWithResult};
// Re-export prune types
#[doc(inline)]
pub use reth_prune_types::*;

View File

@ -2,7 +2,7 @@ use reth_metrics::{
metrics::{Gauge, Histogram},
Metrics,
};
use reth_primitives::PruneSegment;
use reth_prune_types::PruneSegment;
use std::collections::HashMap;
#[derive(Metrics)]

View File

@ -6,13 +6,11 @@ use crate::{
Metrics, PrunerError, PrunerEvent,
};
use reth_db_api::database::Database;
use reth_primitives::{
BlockNumber, FinishedExExHeight, PruneLimiter, PruneMode, PruneProgress, PrunePurpose,
PruneSegment, StaticFileSegment,
};
use reth_primitives::{BlockNumber, FinishedExExHeight, StaticFileSegment};
use reth_provider::{
DatabaseProviderRW, ProviderFactory, PruneCheckpointReader, StaticFileProviderFactory,
};
use reth_prune_types::{PruneLimiter, PruneMode, PruneProgress, PrunePurpose, PruneSegment};
use reth_tokio_util::{EventSender, EventStream};
use std::{
collections::BTreeMap,

View File

@ -6,8 +6,8 @@ use crate::{
};
use reth_db::tables;
use reth_db_api::{database::Database, models::ShardedKey};
use reth_primitives::{PruneInterruptReason, PruneMode, PruneProgress, PruneSegment};
use reth_provider::DatabaseProviderRW;
use reth_prune_types::{PruneInterruptReason, PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
/// Number of account history tables to prune in one step.
@ -108,11 +108,11 @@ mod tests {
};
use assert_matches::assert_matches;
use reth_db::{tables, BlockNumberList};
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, B256,
};
use reth_primitives::{BlockNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{
generators,

View File

@ -12,8 +12,9 @@ use reth_db_api::{
transaction::DbTxMut,
};
use reth_primitives::{BlockNumber, PruneLimiter, PruneMode, PruneProgress, PruneSegment};
use alloy_primitives::BlockNumber;
use reth_provider::DatabaseProviderRW;
use reth_prune_types::{PruneLimiter, PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
/// Number of header tables to prune in one step
@ -190,11 +191,11 @@ mod tests {
use assert_matches::assert_matches;
use reth_db::tables;
use reth_db_api::transaction::DbTx;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, B256, U256,
};
use reth_primitives::{BlockNumber, B256, U256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
use reth_stages::test_utils::TestStageDB;
use reth_testing_utils::{generators, generators::random_header_range};
use tracing::trace;

View File

@ -11,17 +11,17 @@ mod transactions;
use crate::PrunerError;
pub use account_history::AccountHistory;
use alloy_primitives::{BlockNumber, TxNumber};
pub use headers::Headers;
pub use receipts::Receipts;
pub use receipts_by_logs::ReceiptsByLogs;
use reth_db_api::database::Database;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, TxNumber,
};
use reth_provider::{
errors::provider::ProviderResult, BlockReader, DatabaseProviderRW, PruneCheckpointWriter,
};
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
pub use sender_recovery::SenderRecovery;
pub use set::SegmentSet;
use std::{fmt::Debug, ops::RangeInclusive};

View File

@ -4,11 +4,11 @@ use crate::{
};
use reth_db::tables;
use reth_db_api::database::Database;
use reth_primitives::{PruneCheckpoint, PruneMode, PruneProgress, PruneSegment};
use reth_provider::{
errors::provider::ProviderResult, DatabaseProviderRW, PruneCheckpointWriter,
TransactionsProvider,
};
use reth_prune_types::{PruneCheckpoint, PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
#[derive(Debug)]
@ -100,11 +100,11 @@ mod tests {
Itertools,
};
use reth_db::tables;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, TxNumber, B256,
};
use reth_primitives::{BlockNumber, TxNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{
generators,

View File

@ -4,11 +4,11 @@ use crate::{
};
use reth_db::tables;
use reth_db_api::database::Database;
use reth_primitives::{
use reth_provider::{BlockReader, DatabaseProviderRW, PruneCheckpointWriter, TransactionsProvider};
use reth_prune_types::{
PruneCheckpoint, PruneMode, PruneProgress, PrunePurpose, PruneSegment, ReceiptsLogPruneConfig,
MINIMUM_PRUNING_DISTANCE,
};
use reth_provider::{BlockReader, DatabaseProviderRW, PruneCheckpointWriter, TransactionsProvider};
use tracing::{instrument, trace};
#[derive(Debug)]
@ -219,8 +219,9 @@ mod tests {
use assert_matches::assert_matches;
use reth_db::tables;
use reth_db_api::{cursor::DbCursorRO, transaction::DbTx};
use reth_primitives::{PruneLimiter, PruneMode, PruneSegment, ReceiptsLogPruneConfig, B256};
use reth_primitives::B256;
use reth_provider::{PruneCheckpointReader, TransactionsProvider};
use reth_prune_types::{PruneLimiter, PruneMode, PruneSegment, ReceiptsLogPruneConfig};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{
generators,

View File

@ -4,8 +4,8 @@ use crate::{
};
use reth_db::tables;
use reth_db_api::database::Database;
use reth_primitives::{PruneMode, PruneProgress, PruneSegment};
use reth_provider::{DatabaseProviderRW, TransactionsProvider};
use reth_prune_types::{PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
#[derive(Debug)]
@ -83,11 +83,9 @@ mod tests {
Itertools,
};
use reth_db::tables;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
TxNumber, B256,
};
use reth_primitives::{BlockNumber, TxNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{PruneCheckpoint, PruneLimiter, PruneMode, PruneProgress, PruneSegment};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{generators, generators::random_block_range};
use std::ops::Sub;
@ -214,7 +212,7 @@ mod tests {
6,
(
PruneProgress::HasMoreData(
reth_primitives::PruneInterruptReason::DeletedEntriesLimitReached,
reth_prune_types::PruneInterruptReason::DeletedEntriesLimitReached,
),
10,
),

View File

@ -3,7 +3,7 @@ use crate::segments::{
TransactionLookup,
};
use reth_db_api::database::Database;
use reth_primitives::PruneModes;
use reth_prune_types::PruneModes;
/// Collection of [Segment]. Thread-safe, allocated on the heap.
#[derive(Debug)]

View File

@ -9,8 +9,8 @@ use reth_db_api::{
database::Database,
models::{storage_sharded_key::StorageShardedKey, BlockNumberAddress},
};
use reth_primitives::{PruneInterruptReason, PruneMode, PruneProgress, PruneSegment};
use reth_provider::DatabaseProviderRW;
use reth_prune_types::{PruneInterruptReason, PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
/// Number of storage history tables to prune in one step
@ -111,10 +111,9 @@ mod tests {
};
use assert_matches::assert_matches;
use reth_db::{tables, BlockNumberList};
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneLimiter, PruneMode, PruneProgress, PruneSegment, B256,
};
use reth_primitives::{BlockNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{PruneCheckpoint, PruneLimiter, PruneMode, PruneProgress, PruneSegment};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{
generators,
@ -280,7 +279,7 @@ mod tests {
1,
(
PruneProgress::HasMoreData(
reth_primitives::PruneInterruptReason::DeletedEntriesLimitReached,
reth_prune_types::PruneInterruptReason::DeletedEntriesLimitReached,
),
500,
),

View File

@ -5,8 +5,8 @@ use crate::{
use rayon::prelude::*;
use reth_db::tables;
use reth_db_api::database::Database;
use reth_primitives::{PruneMode, PruneProgress, PruneSegment};
use reth_provider::{DatabaseProviderRW, TransactionsProvider};
use reth_prune_types::{PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
#[derive(Debug)]
@ -110,11 +110,11 @@ mod tests {
Itertools,
};
use reth_db::tables;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, TxNumber, B256,
};
use reth_primitives::{BlockNumber, TxNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{generators, generators::random_block_range};
use std::ops::Sub;

View File

@ -4,8 +4,8 @@ use crate::{
};
use reth_db::tables;
use reth_db_api::database::Database;
use reth_primitives::{PruneMode, PruneProgress, PruneSegment};
use reth_provider::{DatabaseProviderRW, TransactionsProvider};
use reth_prune_types::{PruneMode, PruneProgress, PruneSegment};
use tracing::{instrument, trace};
#[derive(Debug)]
@ -82,11 +82,11 @@ mod tests {
Itertools,
};
use reth_db::tables;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, TxNumber, B256,
};
use reth_primitives::{BlockNumber, TxNumber, B256};
use reth_provider::PruneCheckpointReader;
use reth_prune_types::{
PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress, PruneSegment,
};
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{generators, generators::random_block_range};
use std::ops::Sub;

View File

@ -0,0 +1,31 @@
[package]
name = "reth-prune-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 prune usage in reth."
[lints]
workspace = true
[dependencies]
reth-codecs.workspace = true
alloy-primitives.workspace = true
bytes.workspace = true
derive_more.workspace = true
modular-bitfield.workspace = true
serde.workspace = true
thiserror.workspace = true
[dev-dependencies]
arbitrary = { workspace = true, features = ["derive"] }
assert_matches.workspace = true
proptest.workspace = true
proptest-derive.workspace = true
serde_json.workspace = true
test-fuzz.workspace = true
toml.workspace = true

View File

@ -1,4 +1,5 @@
use crate::{prune::PruneMode, BlockNumber, TxNumber};
use crate::PruneMode;
use alloy_primitives::{BlockNumber, TxNumber};
use reth_codecs::{main_codec, Compact};
/// Saves the pruning progress of a stage.

View File

@ -1,10 +1,21 @@
//! Commonly used types for prune 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 checkpoint;
mod limiter;
mod mode;
mod segment;
mod target;
use crate::{Address, BlockNumber};
pub use checkpoint::PruneCheckpoint;
pub use limiter::PruneLimiter;
pub use mode::PruneMode;
@ -13,6 +24,8 @@ use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
pub use target::{PruneModes, MINIMUM_PRUNING_DISTANCE};
use alloy_primitives::{Address, BlockNumber};
/// Configuration for pruning receipts not associated with logs emitted by the specified contracts.
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct ReceiptsLogPruneConfig(pub BTreeMap<Address, PruneMode>);

View File

@ -1,4 +1,5 @@
use crate::{prune::segment::PrunePurpose, BlockNumber, PruneSegment, PruneSegmentError};
use crate::{segment::PrunePurpose, PruneSegment, PruneSegmentError};
use alloy_primitives::BlockNumber;
use reth_codecs::{main_codec, Compact};
/// Prune mode.
@ -74,7 +75,7 @@ impl Default for PruneMode {
#[cfg(test)]
mod tests {
use crate::{
prune::PruneMode, PrunePurpose, PruneSegment, PruneSegmentError, MINIMUM_PRUNING_DISTANCE,
PruneMode, PrunePurpose, PruneSegment, PruneSegmentError, MINIMUM_PRUNING_DISTANCE,
};
use assert_matches::assert_matches;
use serde::Deserialize;

View File

@ -17,6 +17,7 @@ reth-primitives.workspace = true
reth-storage-errors.workspace = true
reth-execution-errors.workspace = true
reth-consensus-common.workspace = true
reth-prune-types.workspace = true
reth-storage-api.workspace = true
reth-trie = { workspace = true, optional = true }

View File

@ -2,10 +2,8 @@
use crate::{precompile::Address, primitives::alloy_primitives::BlockNumber};
use reth_execution_errors::BlockExecutionError;
use reth_primitives::{
PruneMode, PruneModes, PruneSegmentError, Receipt, Receipts, Request, Requests,
MINIMUM_PRUNING_DISTANCE,
};
use reth_primitives::{Receipt, Receipts, Request, Requests};
use reth_prune_types::{PruneMode, PruneModes, PruneSegmentError, MINIMUM_PRUNING_DISTANCE};
use revm::db::states::bundle_state::BundleRetention;
use std::time::Duration;
use tracing::debug;

View File

@ -68,7 +68,7 @@ pub enum StageError {
Database(#[from] DatabaseError),
/// Invalid pruning configuration
#[error(transparent)]
PruningConfiguration(#[from] reth_primitives::PruneSegmentError),
PruningConfiguration(#[from] reth_prune::PruneSegmentError),
/// Invalid checkpoint passed to the stage
#[error("invalid stage checkpoint: {0}")]
StageCheckpoint(u64),

View File

@ -607,8 +607,8 @@ mod tests {
use assert_matches::assert_matches;
use reth_consensus::ConsensusError;
use reth_errors::ProviderError;
use reth_primitives::PruneModes;
use reth_provider::test_utils::create_test_provider_factory;
use reth_prune::PruneModes;
use reth_testing_utils::{generators, generators::random_header};
use tokio_stream::StreamExt;

View File

@ -24,6 +24,7 @@ reth-exex.workspace = true
reth-network-p2p.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-prune-types.workspace = true
reth-storage-errors.workspace = true
reth-revm.workspace = true
reth-stages-api = { workspace = true, features = ["test-utils"] }

View File

@ -17,7 +17,8 @@
//! # use reth_downloaders::headers::reverse_headers::ReverseHeadersDownloaderBuilder;
//! # use reth_network_p2p::test_utils::{TestBodiesClient, TestHeadersClient};
//! # use reth_evm_ethereum::execute::EthExecutorProvider;
//! # use reth_primitives::{MAINNET, B256, PruneModes};
//! # use reth_primitives::{MAINNET, B256};
//! # use reth_prune_types::PruneModes;
//! # use reth_network_types::PeerId;
//! # use reth_stages::Pipeline;
//! # use reth_stages::sets::DefaultStages;

View File

@ -12,7 +12,8 @@
//! ```no_run
//! # use reth_stages::Pipeline;
//! # use reth_stages::sets::{OfflineStages};
//! # use reth_primitives::{PruneModes, MAINNET};
//! # use reth_primitives::MAINNET;
//! # use reth_prune_types::PruneModes;
//! # use reth_evm_ethereum::EthEvmConfig;
//! # use reth_provider::StaticFileProviderFactory;
//! # use reth_provider::test_utils::create_test_provider_factory;
@ -45,8 +46,8 @@ use reth_consensus::Consensus;
use reth_db_api::database::Database;
use reth_evm::execute::BlockExecutorProvider;
use reth_network_p2p::{bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader};
use reth_primitives::PruneModes;
use reth_provider::{HeaderSyncGapProvider, HeaderSyncMode};
use reth_prune_types::PruneModes;
use std::sync::Arc;
/// A set containing all stages to run a fully syncing instance of reth.

View File

@ -9,7 +9,7 @@ use reth_primitives::{
stage::{
CheckpointBlockRange, EntitiesCheckpoint, ExecutionCheckpoint, StageCheckpoint, StageId,
},
BlockNumber, Header, PruneModes, StaticFileSegment,
BlockNumber, Header, StaticFileSegment,
};
use reth_provider::{
providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter},
@ -17,6 +17,7 @@ use reth_provider::{
LatestStateProviderRef, OriginalValuesKnown, ProviderError, StateWriter, StatsReader,
TransactionVariant,
};
use reth_prune_types::PruneModes;
use reth_revm::database::StateProviderDatabase;
use reth_stages_api::{
BlockErrorKind, ExecInput, ExecOutput, MetricEvent, MetricEventsSender, Stage, StageError,
@ -658,13 +659,13 @@ mod tests {
use reth_execution_errors::BlockValidationError;
use reth_primitives::{
address, hex_literal::hex, keccak256, stage::StageUnitCheckpoint, Account, Address,
Bytecode, ChainSpecBuilder, PruneMode, ReceiptsLogPruneConfig, SealedBlock, StorageEntry,
B256, U256,
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 std::collections::BTreeMap;
fn stage() -> ExecutionStage<EthExecutorProvider> {

View File

@ -4,11 +4,12 @@ use reth_db::tables;
use reth_db_api::{database::Database, models::ShardedKey, table::Decode, transaction::DbTxMut};
use reth_primitives::{
stage::{StageCheckpoint, StageId},
Address, PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment,
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 std::fmt::Debug;
use tracing::info;

View File

@ -7,13 +7,11 @@ use reth_db_api::{
table::Decode,
transaction::DbTxMut,
};
use reth_primitives::{
stage::{StageCheckpoint, StageId},
PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment,
};
use reth_primitives::stage::{StageCheckpoint, StageId};
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 std::fmt::Debug;
use tracing::info;

View File

@ -60,14 +60,15 @@ mod tests {
hex_literal::hex,
keccak256,
stage::{PipelineTarget, StageCheckpoint, StageId},
Account, BlockNumber, Bytecode, ChainSpecBuilder, PruneMode, PruneModes, SealedBlock,
StaticFileSegment, B256, U256,
Account, BlockNumber, Bytecode, ChainSpecBuilder, SealedBlock, StaticFileSegment, B256,
U256,
};
use reth_provider::{
providers::StaticFileWriter, AccountExtReader, BlockReader, DatabaseProviderFactory,
ProviderFactory, ProviderResult, ReceiptProvider, StageCheckpointWriter,
StaticFileProviderFactory, StorageReader,
};
use reth_prune_types::{PruneMode, PruneModes};
use reth_stages_api::{ExecInput, Stage};
use reth_testing_utils::generators::{self, random_block, random_block_range, random_receipt};
use std::{io::Write, sync::Arc};

View File

@ -8,12 +8,13 @@ use reth_db_api::{
};
use reth_primitives::{
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
Address, PruneSegment, StaticFileSegment, TransactionSignedNoHash, TxNumber,
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,
};
@ -282,13 +283,13 @@ mod tests {
use assert_matches::assert_matches;
use reth_db_api::cursor::DbCursorRO;
use reth_primitives::{
stage::StageUnitCheckpoint, BlockNumber, PruneCheckpoint, PruneMode, SealedBlock,
TransactionSigned, B256,
stage::StageUnitCheckpoint, BlockNumber, SealedBlock, TransactionSigned, B256,
};
use reth_provider::{
providers::StaticFileWriter, PruneCheckpointWriter, StaticFileProviderFactory,
TransactionsProvider,
};
use reth_prune_types::{PruneCheckpoint, PruneMode};
use reth_testing_utils::{
generators,
generators::{random_block, random_block_range},

View File

@ -9,12 +9,13 @@ use reth_db_api::{
use reth_etl::Collector;
use reth_primitives::{
stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment, TxHash, TxNumber,
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_storage_errors::provider::ProviderError;
use tracing::*;

View File

@ -20,6 +20,7 @@ reth-provider.workspace = true
reth-storage-errors.workspace = true
reth-nippy-jar.workspace = true
reth-tokio-util.workspace = true
reth-prune-types.workspace = true
# misc
tracing.workspace = true

View File

@ -4,8 +4,9 @@ use crate::{segments, segments::Segment, StaticFileProducerEvent};
use parking_lot::Mutex;
use rayon::prelude::*;
use reth_db_api::database::Database;
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber, PruneModes};
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber};
use reth_provider::{providers::StaticFileWriter, ProviderFactory, StaticFileProviderFactory};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderResult;
use reth_tokio_util::{EventSender, EventStream};
use std::{
@ -230,12 +231,11 @@ mod tests {
use assert_matches::assert_matches;
use reth_db::{test_utils::TempDatabase, DatabaseEnv};
use reth_db_api::{database::Database, transaction::DbTx};
use reth_primitives::{
static_file::HighestStaticFiles, PruneModes, StaticFileSegment, B256, U256,
};
use reth_primitives::{static_file::HighestStaticFiles, StaticFileSegment, B256, U256};
use reth_provider::{
providers::StaticFileWriter, ProviderError, ProviderFactory, StaticFileProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_testing_utils::{
generators,

View File

@ -15,6 +15,7 @@ workspace = true
# reth
reth-codecs.workspace = true
reth-primitives.workspace = true
reth-prune-types.workspace = true
reth-storage-errors.workspace = true
# codecs

View File

@ -8,8 +8,9 @@ use reth_codecs::{main_codec, Compact};
use reth_primitives::{
stage::StageCheckpoint,
trie::{StoredNibbles, StoredNibblesSubKey, *},
Address, PruneSegment, B256, *,
Address, B256, *,
};
use reth_prune_types::{PruneCheckpoint, PruneSegment};
pub mod accounts;
pub mod blocks;
@ -305,9 +306,10 @@ mod tests {
ExecutionCheckpoint, HeadersCheckpoint, IndexHistoryCheckpoint, StageCheckpoint,
StageUnitCheckpoint, StorageHashingCheckpoint,
},
Account, Header, PruneCheckpoint, PruneMode, PruneSegment, Receipt, ReceiptWithBloom,
SealedHeader, TxEip1559, TxEip2930, TxEip4844, TxLegacy, Withdrawals,
Account, Header, Receipt, ReceiptWithBloom, SealedHeader, TxEip1559, TxEip2930, TxEip4844,
TxLegacy, Withdrawals,
};
use reth_prune_types::{PruneCheckpoint, PruneMode, PruneSegment};
// 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.

View File

@ -22,6 +22,7 @@ reth-libmdbx = { workspace = true, optional = true, features = [
"read-tx-timeouts",
] }
reth-nippy-jar.workspace = true
reth-prune-types.workspace = true
reth-tracing.workspace = true
# codecs

View File

@ -34,9 +34,10 @@ use reth_db_api::{
use reth_primitives::{
stage::StageCheckpoint,
trie::{StorageTrieEntry, StoredBranchNode, StoredNibbles, StoredNibblesSubKey},
Account, Address, BlockHash, BlockNumber, Bytecode, Header, IntegerList, PruneCheckpoint,
PruneSegment, 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 serde::{Deserialize, Serialize};
use std::fmt;

View File

@ -23,6 +23,7 @@ reth-storage-api.workspace = true
reth-network-p2p.workspace = true
reth-db = { workspace = true, features = ["mdbx"] }
reth-db-api.workspace = true
reth-prune-types.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }
reth-nippy-jar.workspace = true
reth-codecs.workspace = true

View File

@ -15,10 +15,11 @@ use reth_evm::ConfigureEvmEnv;
use reth_primitives::{
stage::{StageCheckpoint, StageId},
Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo,
ChainSpec, Header, PruneCheckpoint, PruneSegment, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256,
ChainSpec, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash,
TxNumber, Withdrawal, Withdrawals, B256, U256,
};
use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_storage_errors::provider::ProviderResult;
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
use std::{
@ -596,9 +597,9 @@ mod tests {
test_utils::{create_test_static_files_dir, ERROR_TEMPDIR},
};
use reth_primitives::{
hex_literal::hex, ChainSpecBuilder, PruneMode, PruneModes, SealedBlock, StaticFileSegment,
TxNumber, B256, U256,
hex_literal::hex, ChainSpecBuilder, SealedBlock, StaticFileSegment, TxNumber, B256, U256,
};
use reth_prune_types::{PruneMode, PruneModes};
use reth_storage_errors::provider::ProviderError;
use reth_testing_utils::{
generators,

View File

@ -35,12 +35,12 @@ use reth_primitives::{
stage::{StageCheckpoint, StageId},
trie::Nibbles,
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders,
ChainInfo, ChainSpec, GotExpected, Head, Header, PruneCheckpoint, PruneLimiter, PruneModes,
PruneSegment, Receipt, Requests, SealedBlock, SealedBlockWithSenders, SealedHeader,
StaticFileSegment, StorageEntry, TransactionMeta, TransactionSigned,
TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal,
Withdrawals, B256, U256,
ChainInfo, ChainSpec, GotExpected, Head, Header, Receipt, Requests, SealedBlock,
SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta,
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber,
Withdrawal, Withdrawals, B256, U256,
};
use reth_prune_types::{PruneCheckpoint, PruneLimiter, PruneModes, PruneSegment};
use reth_storage_errors::provider::{ProviderResult, RootMismatch};
use reth_trie::{
prefix_set::{PrefixSet, PrefixSetMut, TriePrefixSets},

View File

@ -20,11 +20,11 @@ use reth_evm::ConfigureEvmEnv;
use reth_primitives::{
stage::{StageCheckpoint, StageId},
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber,
BlockNumberOrTag, BlockWithSenders, ChainInfo, ChainSpec, Header, PruneCheckpoint,
PruneSegment, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta,
TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256,
U256,
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_storage_errors::provider::ProviderResult;
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
use std::{

View File

@ -375,11 +375,11 @@ delegate_provider_impls!(HistoricalStateProvider<TX> where [TX: DbTx]);
#[derive(Clone, Copy, Debug, Default)]
pub struct LowestAvailableBlocks {
/// Lowest block number at which the account history is available. It may not be available if
/// [`reth_primitives::PruneSegment::AccountHistory`] was pruned.
/// [`reth_prune_types::PruneSegment::AccountHistory`] was pruned.
/// [`Option::None`] means all history is available.
pub account_history_block_number: Option<BlockNumber>,
/// Lowest block number at which the storage history is available. It may not be available if
/// [`reth_primitives::PruneSegment::StorageHistory`] was pruned.
/// [`reth_prune_types::PruneSegment::StorageHistory`] was pruned.
/// [`Option::None`] means all history is available.
pub storage_history_block_number: Option<BlockNumber>,
}

View File

@ -12,11 +12,11 @@ use reth_primitives::{
stage::{StageCheckpoint, StageId},
trie::AccountProof,
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, BlockWithSenders,
Bytecode, ChainInfo, ChainSpec, Header, PruneCheckpoint, PruneSegment, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta,
TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256,
MAINNET, U256,
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_storage_errors::provider::ProviderResult;
use reth_trie::updates::TrieUpdates;
use revm::{

View File

@ -1,6 +1,7 @@
use crate::{BundleStateWithReceipts, Chain};
use reth_db_api::models::StoredBlockBodyIndices;
use reth_primitives::{BlockNumber, PruneModes, SealedBlockWithSenders};
use reth_primitives::{BlockNumber, SealedBlockWithSenders};
use reth_prune_types::PruneModes;
use reth_storage_api::BlockReader;
use reth_storage_errors::provider::ProviderResult;
use reth_trie::{updates::TrieUpdates, HashedPostState};

View File

@ -16,6 +16,7 @@ workspace = true
reth-execution-types.workspace = true
reth-db-api.workspace = true
reth-primitives.workspace = true
reth-prune-types.workspace = true
reth-storage-errors.workspace = true
reth-trie.workspace = true

View File

@ -1,4 +1,4 @@
use reth_primitives::{PruneCheckpoint, PruneSegment};
use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_storage_errors::provider::ProviderResult;
/// The trait for fetching prune checkpoint related data.