consensus: replace reth-primitive imports (#10768)

This commit is contained in:
Håvard Anda Estensen
2024-09-09 14:54:49 +02:00
committed by GitHub
parent 9a541c9853
commit cb0625c391
22 changed files with 52 additions and 27 deletions

View File

@ -30,6 +30,9 @@ reth-engine-primitives.workspace = true
reth-network-p2p.workspace = true
reth-node-types.workspace = true
# ethereum
alloy-primitives.workspace = true
# async
tokio = { workspace = true, features = ["sync"] }
tokio-stream.workspace = true

View File

@ -1,5 +1,6 @@
use crate::engine::forkchoice::ForkchoiceStatus;
use reth_primitives::{SealedBlock, SealedHeader, B256};
use alloy_primitives::B256;
use reth_primitives::{SealedBlock, SealedHeader};
use reth_rpc_types::engine::ForkchoiceState;
use std::{sync::Arc, time::Duration};

View File

@ -1,4 +1,4 @@
use reth_primitives::B256;
use alloy_primitives::B256;
use reth_rpc_types::engine::{ForkchoiceState, PayloadStatusEnum};
/// The struct that keeps track of the received forkchoice state and their status.

View File

@ -1,5 +1,5 @@
use alloy_primitives::BlockNumber;
use reth_errors::{RethError, RethResult};
use reth_primitives::BlockNumber;
use std::{
fmt,
task::{Context, Poll},

View File

@ -4,11 +4,11 @@ use crate::{
engine::hooks::{EngineHook, EngineHookContext, EngineHookError, EngineHookEvent},
hooks::EngineHookDBAccessLevel,
};
use alloy_primitives::BlockNumber;
use futures::FutureExt;
use metrics::Counter;
use reth_errors::{RethError, RethResult};
use reth_node_types::NodeTypesWithDB;
use reth_primitives::BlockNumber;
use reth_provider::{providers::ProviderNodeTypes, ProviderFactory};
use reth_prune::{Pruner, PrunerError, PrunerWithResult};
use reth_tasks::TaskSpawner;

View File

@ -4,10 +4,11 @@ use crate::{
engine::hooks::{EngineHook, EngineHookContext, EngineHookError, EngineHookEvent},
hooks::EngineHookDBAccessLevel,
};
use alloy_primitives::BlockNumber;
use futures::FutureExt;
use reth_errors::RethResult;
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber};
use reth_primitives::static_file::HighestStaticFiles;
use reth_provider::providers::ProviderNodeTypes;
use reth_static_file::{StaticFileProducer, StaticFileProducerWithResult};
use reth_tasks::TaskSpawner;

View File

@ -1,8 +1,9 @@
use alloy_primitives::B256;
use reth_metrics::{
metrics::{Counter, Gauge},
Metrics,
};
use reth_primitives::{Header, SealedHeader, B256};
use reth_primitives::{Header, SealedHeader};
use schnellru::{ByLength, LruMap};
use std::sync::Arc;
use tracing::warn;

View File

@ -1,3 +1,4 @@
use alloy_primitives::{BlockNumber, B256};
use futures::{stream::BoxStream, Future, StreamExt};
use itertools::Either;
use reth_blockchain_tree_api::{
@ -15,8 +16,7 @@ use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_primitives::{PayloadAttributes, PayloadBuilderAttributes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{
constants::EPOCH_SLOTS, BlockNumHash, BlockNumber, Head, Header, SealedBlock, SealedHeader,
B256,
constants::EPOCH_SLOTS, BlockNumHash, Head, Header, SealedBlock, SealedHeader,
};
use reth_provider::{
providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker,
@ -2177,10 +2177,10 @@ mod tests {
mod fork_choice_updated {
use super::*;
use alloy_primitives::U256;
use generators::BlockParams;
use reth_db::{tables, test_utils::create_test_static_files_dir, Database};
use reth_db_api::transaction::DbTxMut;
use reth_primitives::U256;
use reth_provider::{providers::StaticFileProvider, test_utils::MockNodeTypesWithDB};
use reth_rpc_types::engine::ForkchoiceUpdateError;
use reth_testing_utils::generators::random_block;
@ -2578,9 +2578,10 @@ mod tests {
mod new_payload {
use super::*;
use alloy_genesis::Genesis;
use alloy_primitives::U256;
use generators::BlockParams;
use reth_db::test_utils::create_test_static_files_dir;
use reth_primitives::{EthereumHardfork, U256};
use reth_primitives::EthereumHardfork;
use reth_provider::{
providers::StaticFileProvider,
test_utils::{blocks::BlockchainTestData, MockNodeTypesWithDB},

View File

@ -4,13 +4,14 @@ use crate::{
engine::metrics::EngineSyncMetrics, BeaconConsensusEngineEvent,
ConsensusEngineLiveSyncProgress, EthBeaconConsensus,
};
use alloy_primitives::{BlockNumber, B256};
use futures::FutureExt;
use reth_network_p2p::{
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
BlockClient,
};
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{BlockNumber, SealedBlock, B256};
use reth_primitives::SealedBlock;
use reth_provider::providers::ProviderNodeTypes;
use reth_stages_api::{ControlFlow, Pipeline, PipelineError, PipelineTarget, PipelineWithResult};
use reth_tasks::TaskSpawner;

View File

@ -3,6 +3,7 @@ use crate::{
BeaconConsensusEngineError, BeaconConsensusEngineHandle, BeaconForkChoiceUpdateError,
BeaconOnNewPayloadError, EthBeaconConsensus, MIN_BLOCKS_FOR_PIPELINE_RUN,
};
use alloy_primitives::{BlockNumber, B256};
use reth_blockchain_tree::{
config::BlockchainTreeConfig, externals::TreeExternals, BlockchainTree, ShareableBlockchainTree,
};
@ -20,7 +21,6 @@ use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_exex_types::FinishedExExHeight;
use reth_network_p2p::{sync::NoopSyncStateUpdater, test_utils::NoopFullBlockClient, BlockClient};
use reth_payload_builder::test_utils::spawn_test_payload_service;
use reth_primitives::{BlockNumber, B256};
use reth_provider::{
providers::BlockchainProvider,
test_utils::{create_test_provider_factory_with_chain_spec, MockNodeTypesWithDB},