chore: rm reth-interfaces from beacon (#8456)

This commit is contained in:
Matthias Seitz
2024-05-29 11:59:00 +02:00
committed by GitHub
parent dd2113173e
commit efccfbfc65
13 changed files with 35 additions and 33 deletions

4
Cargo.lock generated
View File

@ -6499,17 +6499,19 @@ dependencies = [
"futures", "futures",
"metrics", "metrics",
"reth-blockchain-tree", "reth-blockchain-tree",
"reth-blockchain-tree-api",
"reth-config", "reth-config",
"reth-consensus", "reth-consensus",
"reth-db", "reth-db",
"reth-downloaders", "reth-downloaders",
"reth-engine-primitives", "reth-engine-primitives",
"reth-errors",
"reth-ethereum-consensus", "reth-ethereum-consensus",
"reth-ethereum-engine-primitives", "reth-ethereum-engine-primitives",
"reth-evm", "reth-evm",
"reth-evm-ethereum", "reth-evm-ethereum",
"reth-interfaces",
"reth-metrics", "reth-metrics",
"reth-network-p2p",
"reth-payload-builder", "reth-payload-builder",
"reth-payload-validator", "reth-payload-validator",
"reth-primitives", "reth-primitives",

View File

@ -13,9 +13,10 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-ethereum-consensus.workspace = true reth-ethereum-consensus.workspace = true
reth-blockchain-tree-api.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-interfaces.workspace = true
reth-stages-api.workspace = true reth-stages-api.workspace = true
reth-errors.workspace = true
reth-db.workspace = true reth-db.workspace = true
reth-provider.workspace = true reth-provider.workspace = true
reth-rpc-types.workspace = true reth-rpc-types.workspace = true
@ -26,6 +27,8 @@ reth-prune.workspace = true
reth-static-file.workspace = true reth-static-file.workspace = true
reth-tokio-util.workspace = true reth-tokio-util.workspace = true
reth-engine-primitives.workspace = true reth-engine-primitives.workspace = true
reth-network-p2p.workspace = true
# async # async
tokio = { workspace = true, features = ["sync"] } tokio = { workspace = true, features = ["sync"] }
@ -46,12 +49,12 @@ schnellru.workspace = true
reth-payload-builder = { workspace = true, features = ["test-utils"] } reth-payload-builder = { workspace = true, features = ["test-utils"] }
reth-primitives = { workspace = true, features = ["test-utils"] } reth-primitives = { workspace = true, features = ["test-utils"] }
reth-consensus = { workspace = true, features = ["test-utils"] } reth-consensus = { workspace = true, features = ["test-utils"] }
reth-interfaces = { workspace = true, features = ["test-utils"] }
reth-stages = { workspace = true, features = ["test-utils"] } reth-stages = { workspace = true, features = ["test-utils"] }
reth-blockchain-tree = { workspace = true, features = ["test-utils"] } reth-blockchain-tree = { workspace = true, features = ["test-utils"] }
reth-db = { workspace = true, features = ["test-utils"] } reth-db = { workspace = true, features = ["test-utils"] }
reth-provider = { workspace = true, features = ["test-utils"] } reth-provider = { workspace = true, features = ["test-utils"] }
reth-evm = { workspace = true, features = ["test-utils"] } reth-evm = { workspace = true, features = ["test-utils"] }
reth-network-p2p = { workspace = true, features = ["test-utils"] }
reth-rpc-types-compat.workspace = true reth-rpc-types-compat.workspace = true
reth-rpc.workspace = true reth-rpc.workspace = true
reth-tracing.workspace = true reth-tracing.workspace = true

View File

@ -1,5 +1,5 @@
use crate::engine::hooks::EngineHookError; use crate::engine::hooks::EngineHookError;
use reth_interfaces::RethError; use reth_errors::{DatabaseError, RethError};
use reth_rpc_types::engine::ForkchoiceUpdateError; use reth_rpc_types::engine::ForkchoiceUpdateError;
use reth_stages_api::PipelineError; use reth_stages_api::PipelineError;
@ -37,8 +37,8 @@ impl From<PipelineError> for BeaconConsensusEngineError {
} }
// for convenience in the beacon engine // for convenience in the beacon engine
impl From<reth_interfaces::db::DatabaseError> for BeaconConsensusEngineError { impl From<DatabaseError> for BeaconConsensusEngineError {
fn from(e: reth_interfaces::db::DatabaseError) -> Self { fn from(e: DatabaseError) -> Self {
Self::Common(e.into()) Self::Common(e.into())
} }
} }
@ -72,8 +72,8 @@ impl From<RethError> for BeaconForkChoiceUpdateError {
Self::internal(e) Self::internal(e)
} }
} }
impl From<reth_interfaces::db::DatabaseError> for BeaconForkChoiceUpdateError { impl From<DatabaseError> for BeaconForkChoiceUpdateError {
fn from(e: reth_interfaces::db::DatabaseError) -> Self { fn from(e: DatabaseError) -> Self {
Self::internal(e) Self::internal(e)
} }
} }

View File

@ -6,7 +6,7 @@ use crate::{
}; };
use futures::TryFutureExt; use futures::TryFutureExt;
use reth_engine_primitives::EngineTypes; use reth_engine_primitives::EngineTypes;
use reth_interfaces::RethResult; use reth_errors::RethResult;
use reth_rpc_types::engine::{ use reth_rpc_types::engine::{
CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus, CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus,
}; };

View File

@ -176,7 +176,7 @@ mod tests {
EngineHooksController, EngineHooksController,
}; };
use futures::poll; use futures::poll;
use reth_interfaces::{RethError, RethResult}; use reth_errors::{RethError, RethResult};
use std::{ use std::{
collections::VecDeque, collections::VecDeque,
future::poll_fn, future::poll_fn,

View File

@ -1,4 +1,4 @@
use reth_interfaces::{RethError, RethResult}; use reth_errors::{RethError, RethResult};
use reth_primitives::BlockNumber; use reth_primitives::BlockNumber;
use std::{ use std::{
fmt, fmt,

View File

@ -7,7 +7,7 @@ use crate::{
use futures::FutureExt; use futures::FutureExt;
use metrics::Counter; use metrics::Counter;
use reth_db::database::Database; use reth_db::database::Database;
use reth_interfaces::{RethError, RethResult}; use reth_errors::{RethError, RethResult};
use reth_primitives::BlockNumber; use reth_primitives::BlockNumber;
use reth_prune::{Pruner, PrunerError, PrunerWithResult}; use reth_prune::{Pruner, PrunerError, PrunerWithResult};
use reth_tasks::TaskSpawner; use reth_tasks::TaskSpawner;

View File

@ -6,7 +6,7 @@ use crate::{
}; };
use futures::FutureExt; use futures::FutureExt;
use reth_db::database::Database; use reth_db::database::Database;
use reth_interfaces::RethResult; use reth_errors::RethResult;
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber}; use reth_primitives::{static_file::HighestStaticFiles, BlockNumber};
use reth_static_file::{StaticFileProducer, StaticFileProducerWithResult}; use reth_static_file::{StaticFileProducer, StaticFileProducerWithResult};
use reth_tasks::TaskSpawner; use reth_tasks::TaskSpawner;

View File

@ -1,7 +1,7 @@
use crate::engine::{error::BeaconOnNewPayloadError, forkchoice::ForkchoiceStatus}; use crate::engine::{error::BeaconOnNewPayloadError, forkchoice::ForkchoiceStatus};
use futures::{future::Either, FutureExt}; use futures::{future::Either, FutureExt};
use reth_engine_primitives::EngineTypes; use reth_engine_primitives::EngineTypes;
use reth_interfaces::RethResult; use reth_errors::RethResult;
use reth_payload_builder::error::PayloadBuilderError; use reth_payload_builder::error::PayloadBuilderError;
use reth_rpc_types::engine::{ use reth_rpc_types::engine::{
CancunPayloadFields, ExecutionPayload, ForkChoiceUpdateResult, ForkchoiceState, CancunPayloadFields, ExecutionPayload, ForkChoiceUpdateResult, ForkchoiceState,

View File

@ -1,16 +1,15 @@
use futures::{stream::BoxStream, Future, StreamExt}; use futures::{stream::BoxStream, Future, StreamExt};
use reth_blockchain_tree_api::{
error::{BlockchainTreeError, CanonicalError, InsertBlockError, InsertBlockErrorKind},
BlockStatus, BlockValidationKind, BlockchainTreeEngine, CanonicalOutcome, InsertPayloadOk,
};
use reth_db::database::Database; use reth_db::database::Database;
use reth_engine_primitives::{EngineTypes, PayloadAttributes, PayloadBuilderAttributes}; use reth_engine_primitives::{EngineTypes, PayloadAttributes, PayloadBuilderAttributes};
use reth_interfaces::{ use reth_errors::{BlockValidationError, ProviderResult, RethError, RethResult};
blockchain_tree::{ use reth_network_p2p::{
error::{BlockchainTreeError, CanonicalError, InsertBlockError, InsertBlockErrorKind}, bodies::client::BodiesClient,
BlockStatus, BlockValidationKind, BlockchainTreeEngine, CanonicalOutcome, InsertPayloadOk, headers::client::HeadersClient,
},
executor::BlockValidationError,
p2p::{bodies::client::BodiesClient, headers::client::HeadersClient},
provider::ProviderResult,
sync::{NetworkSyncUpdater, SyncState}, sync::{NetworkSyncUpdater, SyncState},
RethError, RethResult,
}; };
use reth_payload_builder::PayloadBuilderHandle; use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_validator::ExecutionPayloadValidator; use reth_payload_validator::ExecutionPayloadValidator;
@ -1957,12 +1956,12 @@ mod tests {
BeaconForkChoiceUpdateError, BeaconForkChoiceUpdateError,
}; };
use assert_matches::assert_matches; use assert_matches::assert_matches;
use reth_interfaces::test_utils::generators::{self, Rng};
use reth_primitives::{stage::StageCheckpoint, ChainSpecBuilder, MAINNET}; use reth_primitives::{stage::StageCheckpoint, ChainSpecBuilder, MAINNET};
use reth_provider::{BlockWriter, ProviderFactory}; use reth_provider::{BlockWriter, ProviderFactory};
use reth_rpc_types::engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus}; use reth_rpc_types::engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus};
use reth_rpc_types_compat::engine::payload::block_to_payload_v1; use reth_rpc_types_compat::engine::payload::block_to_payload_v1;
use reth_stages::{ExecOutput, PipelineError, StageError}; use reth_stages::{ExecOutput, PipelineError, StageError};
use reth_testing_utils::generators::{self, Rng};
use std::{collections::VecDeque, sync::Arc}; use std::{collections::VecDeque, sync::Arc};
use tokio::sync::oneshot::error::TryRecvError; use tokio::sync::oneshot::error::TryRecvError;
@ -2152,9 +2151,9 @@ mod tests {
mod fork_choice_updated { mod fork_choice_updated {
use super::*; use super::*;
use reth_db::{tables, test_utils::create_test_static_files_dir, transaction::DbTxMut}; use reth_db::{tables, test_utils::create_test_static_files_dir, transaction::DbTxMut};
use reth_interfaces::test_utils::generators::random_block;
use reth_primitives::U256; use reth_primitives::U256;
use reth_rpc_types::engine::ForkchoiceUpdateError; use reth_rpc_types::engine::ForkchoiceUpdateError;
use reth_testing_utils::generators::random_block;
#[tokio::test] #[tokio::test]
async fn empty_head() { async fn empty_head() {
@ -2452,10 +2451,9 @@ mod tests {
mod new_payload { mod new_payload {
use super::*; use super::*;
use reth_db::test_utils::create_test_static_files_dir; use reth_db::test_utils::create_test_static_files_dir;
use reth_interfaces::test_utils::generators::random_block;
use reth_primitives::{genesis::Genesis, Hardfork, U256}; use reth_primitives::{genesis::Genesis, Hardfork, U256};
use reth_provider::test_utils::blocks::BlockchainTestData; use reth_provider::test_utils::blocks::BlockchainTestData;
use reth_testing_utils::GenesisAllocator; use reth_testing_utils::{generators::random_block, GenesisAllocator};
#[tokio::test] #[tokio::test]
async fn new_payload_before_forkchoice() { async fn new_payload_before_forkchoice() {

View File

@ -6,7 +6,7 @@ use crate::{
}; };
use futures::FutureExt; use futures::FutureExt;
use reth_db::database::Database; use reth_db::database::Database;
use reth_interfaces::p2p::{ use reth_network_p2p::{
bodies::client::BodiesClient, bodies::client::BodiesClient,
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient}, full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
headers::client::HeadersClient, headers::client::HeadersClient,
@ -429,7 +429,7 @@ mod tests {
use assert_matches::assert_matches; use assert_matches::assert_matches;
use futures::poll; use futures::poll;
use reth_db::{mdbx::DatabaseEnv, test_utils::TempDatabase}; use reth_db::{mdbx::DatabaseEnv, test_utils::TempDatabase};
use reth_interfaces::{p2p::either::Either, test_utils::TestFullBlockClient}; use reth_network_p2p::{either::Either, test_utils::TestFullBlockClient};
use reth_primitives::{ use reth_primitives::{
constants::ETHEREUM_BLOCK_GAS_LIMIT, stage::StageCheckpoint, BlockBody, ChainSpecBuilder, constants::ETHEREUM_BLOCK_GAS_LIMIT, stage::StageCheckpoint, BlockBody, ChainSpecBuilder,
Header, PruneModes, SealedHeader, MAINNET, Header, PruneModes, SealedHeader, MAINNET,

View File

@ -16,9 +16,8 @@ use reth_downloaders::{
use reth_ethereum_engine_primitives::EthEngineTypes; use reth_ethereum_engine_primitives::EthEngineTypes;
use reth_evm::{either::Either, test_utils::MockExecutorProvider}; use reth_evm::{either::Either, test_utils::MockExecutorProvider};
use reth_evm_ethereum::execute::EthExecutorProvider; use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_interfaces::{ use reth_network_p2p::{
p2p::{bodies::client::BodiesClient, headers::client::HeadersClient}, bodies::client::BodiesClient, headers::client::HeadersClient, sync::NoopSyncStateUpdater,
sync::NoopSyncStateUpdater,
test_utils::NoopFullBlockClient, test_utils::NoopFullBlockClient,
}; };
use reth_payload_builder::test_utils::spawn_test_payload_service; use reth_payload_builder::test_utils::spawn_test_payload_service;

View File

@ -17,7 +17,7 @@ pub use error::{RethError, RethResult};
pub use reth_blockchain_tree_api::error::{BlockchainTreeError, CanonicalError}; pub use reth_blockchain_tree_api::error::{BlockchainTreeError, CanonicalError};
pub use reth_consensus::ConsensusError; pub use reth_consensus::ConsensusError;
pub use reth_execution_errors::BlockExecutionError; pub use reth_execution_errors::{BlockExecutionError, BlockValidationError};
pub use reth_storage_errors::{ pub use reth_storage_errors::{
db::DatabaseError, db::DatabaseError,
provider::{ProviderError, ProviderResult}, provider::{ProviderError, ProviderResult},