chore(primitives): move checkpoints under stage mod (#2906)

This commit is contained in:
Roman Krasiuk
2023-05-30 20:14:13 +03:00
committed by GitHub
parent c481b8717b
commit 5d7eba6fb2
41 changed files with 113 additions and 66 deletions

View File

@ -2,7 +2,10 @@
use crate::dirs::{DataDirPath, MaybePlatformPath}; use crate::dirs::{DataDirPath, MaybePlatformPath};
use clap::Parser; use clap::Parser;
use reth_db::{cursor::DbCursorRO, tables, transaction::DbTx}; use reth_db::{cursor::DbCursorRO, tables, transaction::DbTx};
use reth_primitives::{stage::StageId, ChainSpec, StageCheckpoint}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
ChainSpec,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_staged_sync::utils::{chainspec::genesis_value_parser, init::init_db}; use reth_staged_sync::utils::{chainspec::genesis_value_parser, init::init_db};
use reth_stages::{ use reth_stages::{

View File

@ -4,7 +4,7 @@ use futures::Stream;
use reth_beacon_consensus::BeaconConsensusEngineEvent; use reth_beacon_consensus::BeaconConsensusEngineEvent;
use reth_network::{NetworkEvent, NetworkHandle}; use reth_network::{NetworkEvent, NetworkHandle};
use reth_network_api::PeersInfo; use reth_network_api::PeersInfo;
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_stages::{ExecOutput, PipelineEvent}; use reth_stages::{ExecOutput, PipelineEvent};
use std::{ use std::{
future::Future, future::Future,

View File

@ -4,7 +4,10 @@ use eyre::Result;
use reth_db::{ use reth_db::{
cursor::DbCursorRO, database::Database, table::TableImporter, tables, transaction::DbTx, cursor::DbCursorRO, database::Database, table::TableImporter, tables, transaction::DbTx,
}; };
use reth_primitives::{stage::StageId, StageCheckpoint, MAINNET}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
MAINNET,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_stages::{stages::ExecutionStage, Stage, UnwindInput}; use reth_stages::{stages::ExecutionStage, Stage, UnwindInput};
use std::{ops::DerefMut, path::PathBuf, sync::Arc}; use std::{ops::DerefMut, path::PathBuf, sync::Arc};

View File

@ -2,7 +2,10 @@ use super::setup;
use crate::utils::DbTool; use crate::utils::DbTool;
use eyre::Result; use eyre::Result;
use reth_db::{database::Database, table::TableImporter, tables}; use reth_db::{database::Database, table::TableImporter, tables};
use reth_primitives::{stage::StageId, BlockNumber, StageCheckpoint}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
BlockNumber,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_stages::{stages::AccountHashingStage, Stage, UnwindInput}; use reth_stages::{stages::AccountHashingStage, Stage, UnwindInput};
use std::{ops::DerefMut, path::PathBuf}; use std::{ops::DerefMut, path::PathBuf};

View File

@ -2,7 +2,7 @@ use super::setup;
use crate::utils::DbTool; use crate::utils::DbTool;
use eyre::Result; use eyre::Result;
use reth_db::{database::Database, table::TableImporter, tables}; use reth_db::{database::Database, table::TableImporter, tables};
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_stages::{stages::StorageHashingStage, Stage, UnwindInput}; use reth_stages::{stages::StorageHashingStage, Stage, UnwindInput};
use std::{ops::DerefMut, path::PathBuf}; use std::{ops::DerefMut, path::PathBuf};

View File

@ -2,7 +2,10 @@ use super::setup;
use crate::utils::DbTool; use crate::utils::DbTool;
use eyre::Result; use eyre::Result;
use reth_db::{database::Database, table::TableImporter, tables}; use reth_db::{database::Database, table::TableImporter, tables};
use reth_primitives::{stage::StageId, BlockNumber, StageCheckpoint, MAINNET}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
BlockNumber, MAINNET,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_stages::{ use reth_stages::{
stages::{ stages::{

View File

@ -11,7 +11,10 @@ use clap::Parser;
use reth_beacon_consensus::BeaconConsensus; use reth_beacon_consensus::BeaconConsensus;
use reth_config::Config; use reth_config::Config;
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder; use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
use reth_primitives::{stage::StageId, ChainSpec, StageCheckpoint}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
ChainSpec,
};
use reth_provider::{ShareableDatabase, Transaction}; use reth_provider::{ShareableDatabase, Transaction};
use reth_staged_sync::utils::{chainspec::chain_spec_value_parser, init::init_db}; use reth_staged_sync::utils::{chainspec::chain_spec_value_parser, init::init_db};
use reth_stages::{ use reth_stages::{

View File

@ -1043,7 +1043,9 @@ mod tests {
transaction::DbTxMut, transaction::DbTxMut,
}; };
use reth_interfaces::test_utils::TestConsensus; use reth_interfaces::test_utils::TestConsensus;
use reth_primitives::{proofs::EMPTY_ROOT, ChainSpecBuilder, StageCheckpoint, H256, MAINNET}; use reth_primitives::{
proofs::EMPTY_ROOT, stage::StageCheckpoint, ChainSpecBuilder, H256, MAINNET,
};
use reth_provider::{ use reth_provider::{
insert_block, insert_block,
post_state::PostState, post_state::PostState,

View File

@ -992,7 +992,7 @@ mod tests {
}; };
use reth_payload_builder::test_utils::spawn_test_payload_service; use reth_payload_builder::test_utils::spawn_test_payload_service;
use reth_primitives::{ use reth_primitives::{
ChainSpec, ChainSpecBuilder, SealedBlockWithSenders, StageCheckpoint, H256, MAINNET, stage::StageCheckpoint, ChainSpec, ChainSpecBuilder, SealedBlockWithSenders, H256, MAINNET,
}; };
use reth_provider::{ use reth_provider::{
providers::BlockchainProvider, test_utils::TestExecutorFactory, ShareableDatabase, providers::BlockchainProvider, test_utils::TestExecutorFactory, ShareableDatabase,

View File

@ -16,7 +16,6 @@ mod bits;
mod block; mod block;
pub mod bloom; pub mod bloom;
mod chain; mod chain;
mod checkpoints;
mod compression; mod compression;
pub mod constants; pub mod constants;
pub mod contract; pub mod contract;
@ -51,10 +50,6 @@ pub use chain::{
AllGenesisFormats, Chain, ChainInfo, ChainSpec, ChainSpecBuilder, ForkCondition, GOERLI, AllGenesisFormats, Chain, ChainInfo, ChainSpec, ChainSpecBuilder, ForkCondition, GOERLI,
MAINNET, SEPOLIA, MAINNET, SEPOLIA,
}; };
pub use checkpoints::{
AccountHashingCheckpoint, EntitiesCheckpoint, MerkleCheckpoint, StageCheckpoint,
StageUnitCheckpoint, StorageHashingCheckpoint,
};
pub use compression::*; pub use compression::*;
pub use constants::{ pub use constants::{
EMPTY_OMMER_ROOT, GOERLI_GENESIS, KECCAK_EMPTY, MAINNET_GENESIS, SEPOLIA_GENESIS, EMPTY_OMMER_ROOT, GOERLI_GENESIS, KECCAK_EMPTY, MAINNET_GENESIS, SEPOLIA_GENESIS,

View File

@ -2,3 +2,9 @@
mod id; mod id;
pub use id::StageId; pub use id::StageId;
mod checkpoints;
pub use checkpoints::{
AccountHashingCheckpoint, EntitiesCheckpoint, MerkleCheckpoint, StageCheckpoint,
StageUnitCheckpoint, StorageHashingCheckpoint,
};

View File

@ -3,7 +3,7 @@ use bytes::Buf;
use reth_codecs::Compact; use reth_codecs::Compact;
/// Walker sub node for storing intermediate state root calculation state in the database. /// Walker sub node for storing intermediate state root calculation state in the database.
/// See [crate::MerkleCheckpoint]. /// See [crate::stage::MerkleCheckpoint].
#[derive(Debug, Clone, PartialEq, Default)] #[derive(Debug, Clone, PartialEq, Default)]
pub struct StoredSubNode { pub struct StoredSubNode {
/// The key of the current node. /// The key of the current node.

View File

@ -5,7 +5,7 @@ use criterion::{
use pprof::criterion::{Output, PProfProfiler}; use pprof::criterion::{Output, PProfProfiler};
use reth_db::mdbx::{Env, WriteMap}; use reth_db::mdbx::{Env, WriteMap};
use reth_interfaces::test_utils::TestConsensus; use reth_interfaces::test_utils::TestConsensus;
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_stages::{ use reth_stages::{
stages::{MerkleStage, SenderRecoveryStage, TotalDifficultyStage, TransactionLookupStage}, stages::{MerkleStage, SenderRecoveryStage, TotalDifficultyStage, TransactionLookupStage},
test_utils::TestTransaction, test_utils::TestTransaction,

View File

@ -2,7 +2,7 @@ use super::{constants, StageRange};
use reth_db::{ use reth_db::{
cursor::DbCursorRO, database::Database, tables, transaction::DbTx, DatabaseError as DbError, cursor::DbCursorRO, database::Database, tables, transaction::DbTx, DatabaseError as DbError,
}; };
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_stages::{ use reth_stages::{
stages::{AccountHashingStage, SeedOpts}, stages::{AccountHashingStage, SeedOpts},
test_utils::TestTransaction, test_utils::TestTransaction,

View File

@ -1,5 +1,5 @@
use crate::stage::{ExecOutput, UnwindInput, UnwindOutput}; use crate::stage::{ExecOutput, UnwindInput, UnwindOutput};
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
/// An event emitted by a [Pipeline][crate::Pipeline]. /// An event emitted by a [Pipeline][crate::Pipeline].
/// ///

View File

@ -2,7 +2,9 @@ use crate::{error::*, ExecInput, ExecOutput, Stage, StageError, UnwindInput};
use futures_util::Future; use futures_util::Future;
use reth_db::database::Database; use reth_db::database::Database;
use reth_primitives::{ use reth_primitives::{
listener::EventListeners, stage::StageId, BlockNumber, StageCheckpoint, H256, listener::EventListeners,
stage::{StageCheckpoint, StageId},
BlockNumber, H256,
}; };
use reth_provider::{providers::get_stage_checkpoint, Transaction}; use reth_provider::{providers::get_stage_checkpoint, Transaction};
use std::pin::Pin; use std::pin::Pin;

View File

@ -3,7 +3,8 @@ use reth_metrics::{
Metrics, Metrics,
}; };
use reth_primitives::{ use reth_primitives::{
stage::StageId, BlockNumber, EntitiesCheckpoint, StageCheckpoint, StageUnitCheckpoint, stage::{EntitiesCheckpoint, StageCheckpoint, StageId, StageUnitCheckpoint},
BlockNumber,
}; };
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -1,7 +1,10 @@
use crate::error::StageError; use crate::error::StageError;
use async_trait::async_trait; use async_trait::async_trait;
use reth_db::database::Database; use reth_db::database::Database;
use reth_primitives::{stage::StageId, BlockNumber, StageCheckpoint}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
BlockNumber,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::{ use std::{
cmp::{max, min}, cmp::{max, min},

View File

@ -11,7 +11,7 @@ use reth_interfaces::{
consensus::Consensus, consensus::Consensus,
p2p::bodies::{downloader::BodyDownloader, response::BlockResponse}, p2p::bodies::{downloader::BodyDownloader, response::BlockResponse},
}; };
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::sync::Arc; use std::sync::Arc;
use tracing::*; use tracing::*;

View File

@ -11,8 +11,9 @@ use reth_metrics::{
Metrics, Metrics,
}; };
use reth_primitives::{ use reth_primitives::{
constants::MGAS_TO_GAS, stage::StageId, Block, BlockNumber, BlockWithSenders, StageCheckpoint, constants::MGAS_TO_GAS,
TransactionSigned, U256, stage::{StageCheckpoint, StageId},
Block, BlockNumber, BlockWithSenders, TransactionSigned, U256,
}; };
use reth_provider::{ use reth_provider::{
post_state::PostState, BlockExecutor, ExecutorFactory, LatestStateProviderRef, Transaction, post_state::PostState, BlockExecutor, ExecutorFactory, LatestStateProviderRef, Transaction,

View File

@ -1,6 +1,6 @@
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput}; use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
use reth_db::database::Database; use reth_db::database::Database;
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_provider::Transaction; use reth_provider::Transaction;
/// The finish stage. /// The finish stage.

View File

@ -8,7 +8,10 @@ use reth_db::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
RawKey, RawTable, RawKey, RawTable,
}; };
use reth_primitives::{keccak256, stage::StageId, AccountHashingCheckpoint, StageCheckpoint}; use reth_primitives::{
keccak256,
stage::{AccountHashingCheckpoint, StageCheckpoint, StageId},
};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::{ use std::{
cmp::max, cmp::max,
@ -268,7 +271,7 @@ mod tests {
PREV_STAGE_ID, PREV_STAGE_ID,
}; };
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_primitives::{Account, StageUnitCheckpoint, U256}; use reth_primitives::{stage::StageUnitCheckpoint, Account, U256};
use test_utils::*; use test_utils::*;
stage_test_suite_ext!(AccountHashingTestRunner, account_hashing); stage_test_suite_ext!(AccountHashingTestRunner, account_hashing);

View File

@ -8,7 +8,9 @@ use reth_db::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_primitives::{ use reth_primitives::{
keccak256, stage::StageId, StageCheckpoint, StorageEntry, StorageHashingCheckpoint, keccak256,
stage::{StageCheckpoint, StageId, StorageHashingCheckpoint},
StorageEntry,
}; };
use reth_provider::Transaction; use reth_provider::Transaction;
use std::{collections::BTreeMap, fmt::Debug}; use std::{collections::BTreeMap, fmt::Debug};
@ -205,7 +207,9 @@ mod tests {
use reth_interfaces::test_utils::generators::{ use reth_interfaces::test_utils::generators::{
random_block_range, random_contract_account_range, random_block_range, random_contract_account_range,
}; };
use reth_primitives::{Address, SealedBlock, StageUnitCheckpoint, StorageEntry, H256, U256}; use reth_primitives::{
stage::StageUnitCheckpoint, Address, SealedBlock, StorageEntry, H256, U256,
};
stage_test_suite_ext!(StorageHashingTestRunner, storage_hashing); stage_test_suite_ext!(StorageHashingTestRunner, storage_hashing);

View File

@ -11,8 +11,8 @@ use reth_interfaces::{
provider::ProviderError, provider::ProviderError,
}; };
use reth_primitives::{ use reth_primitives::{
stage::StageId, BlockHashOrNumber, BlockNumber, EntitiesCheckpoint, SealedHeader, stage::{EntitiesCheckpoint, StageCheckpoint, StageId},
StageCheckpoint, H256, BlockHashOrNumber, BlockNumber, SealedHeader, H256,
}; };
use reth_provider::Transaction; use reth_provider::Transaction;
use tokio::sync::watch; use tokio::sync::watch;
@ -358,7 +358,7 @@ mod tests {
}; };
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_interfaces::test_utils::generators::random_header; use reth_interfaces::test_utils::generators::random_header;
use reth_primitives::{StageUnitCheckpoint, H256}; use reth_primitives::{stage::StageUnitCheckpoint, H256};
use test_runner::HeadersTestRunner; use test_runner::HeadersTestRunner;
mod test_runner { mod test_runner {

View File

@ -1,6 +1,6 @@
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput}; use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
use reth_db::database::Database; use reth_db::database::Database;
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::fmt::Debug; use std::fmt::Debug;
use tracing::*; use tracing::*;

View File

@ -1,6 +1,6 @@
use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput}; use crate::{ExecInput, ExecOutput, Stage, StageError, UnwindInput, UnwindOutput};
use reth_db::{database::Database, models::BlockNumberAddress}; use reth_db::{database::Database, models::BlockNumberAddress};
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::fmt::Debug; use std::fmt::Debug;
use tracing::*; use tracing::*;

View File

@ -7,7 +7,10 @@ use reth_db::{
}; };
use reth_interfaces::consensus; use reth_interfaces::consensus;
use reth_primitives::{ use reth_primitives::{
hex, stage::StageId, trie::StoredSubNode, BlockNumber, MerkleCheckpoint, StageCheckpoint, H256, hex,
stage::{MerkleCheckpoint, StageCheckpoint, StageId},
trie::StoredSubNode,
BlockNumber, H256,
}; };
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_trie::{IntermediateStateRootState, StateRoot, StateRootProgress}; use reth_trie::{IntermediateStateRootState, StateRoot, StateRootProgress};

View File

@ -8,7 +8,9 @@ use reth_db::{
RawKey, RawTable, RawValue, RawKey, RawTable, RawValue,
}; };
use reth_primitives::{ use reth_primitives::{
keccak256, stage::StageId, StageCheckpoint, TransactionSignedNoHash, TxNumber, H160, keccak256,
stage::{StageCheckpoint, StageId},
TransactionSignedNoHash, TxNumber, H160,
}; };
use reth_provider::Transaction; use reth_provider::Transaction;
use std::fmt::Debug; use std::fmt::Debug;

View File

@ -6,7 +6,10 @@ use reth_db::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_interfaces::{consensus::Consensus, provider::ProviderError}; use reth_interfaces::{consensus::Consensus, provider::ProviderError};
use reth_primitives::{stage::StageId, StageCheckpoint, U256}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
U256,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use std::sync::Arc; use std::sync::Arc;
use tracing::*; use tracing::*;

View File

@ -8,8 +8,9 @@ use reth_db::{
transaction::{DbTx, DbTxMut}, transaction::{DbTx, DbTxMut},
}; };
use reth_primitives::{ use reth_primitives::{
rpc_utils::keccak256, stage::StageId, BlockNumber, StageCheckpoint, TransactionSignedNoHash, rpc_utils::keccak256,
TxNumber, H256, stage::{StageCheckpoint, StageId},
BlockNumber, TransactionSignedNoHash, TxNumber, H256,
}; };
use reth_provider::Transaction; use reth_provider::Transaction;
use thiserror::Error; use thiserror::Error;

View File

@ -29,8 +29,8 @@ macro_rules! stage_test_suite {
// Set up the runner // Set up the runner
let mut runner = $runner::default(); let mut runner = $runner::default();
let input = crate::stage::ExecInput { let input = crate::stage::ExecInput {
previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::StageCheckpoint::new(previous_stage))), previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::stage::StageCheckpoint::new(previous_stage))),
checkpoint: Some(reth_primitives::StageCheckpoint::new(stage_progress)), checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(stage_progress)),
}; };
let seed = runner.seed_execution(input).expect("failed to seed"); let seed = runner.seed_execution(input).expect("failed to seed");
let rx = runner.execute(input); let rx = runner.execute(input);
@ -81,8 +81,8 @@ macro_rules! stage_test_suite {
// Set up the runner // Set up the runner
let mut runner = $runner::default(); let mut runner = $runner::default();
let execute_input = crate::stage::ExecInput { let execute_input = crate::stage::ExecInput {
previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::StageCheckpoint::new(previous_stage))), previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::stage::StageCheckpoint::new(previous_stage))),
checkpoint: Some(reth_primitives::StageCheckpoint::new(stage_progress)), checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(stage_progress)),
}; };
let seed = runner.seed_execution(execute_input).expect("failed to seed"); let seed = runner.seed_execution(execute_input).expect("failed to seed");
@ -103,7 +103,7 @@ macro_rules! stage_test_suite {
// Run stage unwind // Run stage unwind
let unwind_input = crate::stage::UnwindInput { let unwind_input = crate::stage::UnwindInput {
unwind_to: stage_progress, unwind_to: stage_progress,
checkpoint: reth_primitives::StageCheckpoint::new(previous_stage), checkpoint: reth_primitives::stage::StageCheckpoint::new(previous_stage),
bad_block: None, bad_block: None,
}; };
@ -138,8 +138,8 @@ macro_rules! stage_test_suite_ext {
// Set up the runner // Set up the runner
let mut runner = $runner::default(); let mut runner = $runner::default();
let input = crate::stage::ExecInput { let input = crate::stage::ExecInput {
previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::StageCheckpoint::new(stage_progress))), previous_stage: Some((crate::test_utils::PREV_STAGE_ID, reth_primitives::stage::StageCheckpoint::new(stage_progress))),
checkpoint: Some(reth_primitives::StageCheckpoint::new(stage_progress)), checkpoint: Some(reth_primitives::stage::StageCheckpoint::new(stage_progress)),
}; };
let seed = runner.seed_execution(input).expect("failed to seed"); let seed = runner.seed_execution(input).expect("failed to seed");

View File

@ -3,7 +3,7 @@ use crate::{
tables::models::*, tables::models::*,
}; };
use reth_codecs::{main_codec, Compact}; use reth_codecs::{main_codec, Compact};
use reth_primitives::{trie::*, *}; use reth_primitives::{stage::StageCheckpoint, trie::*, *};
/// Implements compression for Compact type. /// Implements compression for Compact type.
macro_rules! impl_compression_for_compact { macro_rules! impl_compression_for_compact {

View File

@ -33,9 +33,10 @@ use crate::{
}, },
}; };
use reth_primitives::{ use reth_primitives::{
stage::StageCheckpoint,
trie::{BranchNodeCompact, StorageTrieEntry, StoredNibbles, StoredNibblesSubKey}, trie::{BranchNodeCompact, StorageTrieEntry, StoredNibbles, StoredNibblesSubKey},
Account, Address, BlockHash, BlockNumber, Bytecode, Header, IntegerList, Receipt, Account, Address, BlockHash, BlockNumber, Bytecode, Header, IntegerList, Receipt, StorageEntry,
StageCheckpoint, StorageEntry, TransactionSignedNoHash, TxHash, TxNumber, H256, TransactionSignedNoHash, TxHash, TxNumber, H256,
}; };
/// Enum for the types of tables present in libmdbx. /// Enum for the types of tables present in libmdbx.

View File

@ -8,9 +8,10 @@ use crate::{
use reth_db::{cursor::DbCursorRO, database::Database, tables, transaction::DbTx}; use reth_db::{cursor::DbCursorRO, database::Database, tables, transaction::DbTx};
use reth_interfaces::Result; use reth_interfaces::Result;
use reth_primitives::{ use reth_primitives::{
stage::StageId, Block, BlockHash, BlockHashOrNumber, BlockNumber, ChainInfo, ChainSpec, Head, stage::{StageCheckpoint, StageId},
Header, Receipt, SealedBlock, SealedHeader, StageCheckpoint, TransactionMeta, Block, BlockHash, BlockHashOrNumber, BlockNumber, ChainInfo, ChainSpec, Head, Header, Receipt,
TransactionSigned, TxHash, TxNumber, Withdrawal, H256, U256, SealedBlock, SealedHeader, TransactionMeta, TransactionSigned, TxHash, TxNumber, Withdrawal,
H256, U256,
}; };
use reth_revm_primitives::{ use reth_revm_primitives::{
config::revm_spec, config::revm_spec,

View File

@ -12,10 +12,10 @@ use reth_interfaces::{
Error, Result, Error, Result,
}; };
use reth_primitives::{ use reth_primitives::{
stage::StageId, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber, stage::{StageCheckpoint, StageId},
BlockNumberOrTag, ChainInfo, Header, Receipt, SealedBlock, SealedBlockWithSenders, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber, BlockNumberOrTag,
SealedHeader, StageCheckpoint, TransactionMeta, TransactionSigned, TxHash, TxNumber, ChainInfo, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta,
Withdrawal, H256, U256, TransactionSigned, TxHash, TxNumber, Withdrawal, H256, U256,
}; };
use reth_revm_primitives::primitives::{BlockEnv, CfgEnv}; use reth_revm_primitives::primitives::{BlockEnv, CfgEnv};
pub use state::{ pub use state::{

View File

@ -6,6 +6,7 @@ use crate::{
}; };
use reth_interfaces::Result; use reth_interfaces::Result;
use reth_primitives::{ use reth_primitives::{
stage::{StageCheckpoint, StageId},
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, Bytecode, Bytes, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, Bytecode, Bytes,
ChainInfo, Header, Receipt, SealedBlock, SealedHeader, StorageKey, StorageValue, ChainInfo, Header, Receipt, SealedBlock, SealedHeader, StorageKey, StorageValue,
TransactionMeta, TransactionSigned, TxHash, TxNumber, H256, KECCAK_EMPTY, U256, TransactionMeta, TransactionSigned, TxHash, TxNumber, H256, KECCAK_EMPTY, U256,
@ -279,10 +280,7 @@ impl StateProviderFactory for NoopProvider {
} }
impl StageCheckpointProvider for NoopProvider { impl StageCheckpointProvider for NoopProvider {
fn get_stage_checkpoint( fn get_stage_checkpoint(&self, _id: StageId) -> Result<Option<StageCheckpoint>> {
&self,
_id: reth_primitives::stage::StageId,
) -> Result<Option<reth_primitives::StageCheckpoint>> {
Ok(None) Ok(None)
} }
} }

View File

@ -1,5 +1,5 @@
use reth_interfaces::Result; use reth_interfaces::Result;
use reth_primitives::{stage::StageId, StageCheckpoint}; use reth_primitives::stage::{StageCheckpoint, StageId};
/// The trait for fetching stage checkpoint related data. /// The trait for fetching stage checkpoint related data.
#[auto_impl::auto_impl(&, Arc)] #[auto_impl::auto_impl(&, Arc)]

View File

@ -20,9 +20,11 @@ use reth_db::{
}; };
use reth_interfaces::{db::DatabaseError as DbError, provider::ProviderError}; use reth_interfaces::{db::DatabaseError as DbError, provider::ProviderError};
use reth_primitives::{ use reth_primitives::{
keccak256, stage::StageId, Account, Address, BlockHash, BlockNumber, ChainSpec, Hardfork, keccak256,
Header, SealedBlock, SealedBlockWithSenders, StageCheckpoint, StorageEntry, TransactionSigned, stage::{StageCheckpoint, StageId},
TransactionSignedEcRecovered, H256, U256, Account, Address, BlockHash, BlockNumber, ChainSpec, Hardfork, Header, SealedBlock,
SealedBlockWithSenders, StorageEntry, TransactionSigned, TransactionSignedEcRecovered, H256,
U256,
}; };
use reth_trie::{StateRoot, StateRootError}; use reth_trie::{StateRoot, StateRootError};
use std::{ use std::{

View File

@ -1,7 +1,8 @@
use crate::{trie_cursor::CursorSubNode, updates::TrieUpdates}; use crate::{trie_cursor::CursorSubNode, updates::TrieUpdates};
use reth_primitives::{ use reth_primitives::{
stage::MerkleCheckpoint,
trie::{hash_builder::HashBuilder, Nibbles}, trie::{hash_builder::HashBuilder, Nibbles},
MerkleCheckpoint, H256, H256,
}; };
/// The progress of the state root computation. /// The progress of the state root computation.

View File

@ -5,7 +5,10 @@ use crate::{
Case, Error, Suite, Case, Error, Suite,
}; };
use reth_db::mdbx::test_utils::create_test_rw_db; use reth_db::mdbx::test_utils::create_test_rw_db;
use reth_primitives::{stage::StageId, BlockBody, SealedBlock, StageCheckpoint}; use reth_primitives::{
stage::{StageCheckpoint, StageId},
BlockBody, SealedBlock,
};
use reth_provider::Transaction; use reth_provider::Transaction;
use reth_stages::{stages::ExecutionStage, ExecInput, Stage}; use reth_stages::{stages::ExecutionStage, ExecInput, Stage};
use std::{collections::BTreeMap, ffi::OsStr, fs, ops::Deref, path::Path, sync::Arc}; use std::{collections::BTreeMap, ffi::OsStr, fs, ops::Deref, path::Path, sync::Arc};