chore: rm reth-interfaces from network (#8435)

This commit is contained in:
Matthias Seitz
2024-05-28 18:11:08 +02:00
committed by GitHub
parent a5c3c63fe4
commit de4e0ba041
14 changed files with 30 additions and 27 deletions

2
Cargo.lock generated
View File

@ -7246,11 +7246,11 @@ dependencies = [
"reth-dns-discovery", "reth-dns-discovery",
"reth-ecies", "reth-ecies",
"reth-eth-wire", "reth-eth-wire",
"reth-interfaces",
"reth-metrics", "reth-metrics",
"reth-net-common", "reth-net-common",
"reth-network", "reth-network",
"reth-network-api", "reth-network-api",
"reth-network-p2p",
"reth-network-types", "reth-network-types",
"reth-primitives", "reth-primitives",
"reth-provider", "reth-provider",

View File

@ -13,10 +13,10 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-interfaces.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-net-common.workspace = true reth-net-common.workspace = true
reth-network-api.workspace = true reth-network-api.workspace = true
reth-network-p2p.workspace = true
reth-discv4.workspace = true reth-discv4.workspace = true
reth-discv5.workspace = true reth-discv5.workspace = true
reth-dns-discovery.workspace = true reth-dns-discovery.workspace = true
@ -71,12 +71,12 @@ smallvec.workspace = true
[dev-dependencies] [dev-dependencies]
# reth # reth
reth-discv4 = { workspace = true, features = ["test-utils"] } reth-discv4 = { workspace = true, features = ["test-utils"] }
reth-interfaces = { workspace = true, features = ["test-utils"] }
reth-primitives = { workspace = true, features = ["test-utils"] } reth-primitives = { workspace = true, features = ["test-utils"] }
# we need to enable the test-utils feature in our own crate to use utils in # we need to enable the test-utils feature in our own crate to use utils in
# integration tests # integration tests
reth-network = { workspace = true, features = ["test-utils"] } reth-network = { workspace = true, features = ["test-utils"] }
reth-network-p2p = { workspace = true, features = ["test-utils"] }
reth-provider = { workspace = true, features = ["test-utils"] } reth-provider = { workspace = true, features = ["test-utils"] }
reth-tracing.workspace = true reth-tracing.workspace = true

View File

@ -10,7 +10,7 @@ use reth_eth_wire::{
BlockBodies, BlockHeaders, GetBlockBodies, GetBlockHeaders, GetNodeData, GetReceipts, NodeData, BlockBodies, BlockHeaders, GetBlockBodies, GetBlockHeaders, GetNodeData, GetReceipts, NodeData,
Receipts, Receipts,
}; };
use reth_interfaces::p2p::error::RequestResult; use reth_network_p2p::error::RequestResult;
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{BlockBody, BlockHashOrNumber, Header, HeadersDirection}; use reth_primitives::{BlockBody, BlockHashOrNumber, Header, HeadersDirection};
use reth_provider::{BlockReader, HeaderProvider, ReceiptProvider}; use reth_provider::{BlockReader, HeaderProvider, ReceiptProvider};

View File

@ -3,14 +3,14 @@
use crate::{fetch::DownloadRequest, flattened_response::FlattenedResponse, peers::PeersHandle}; use crate::{fetch::DownloadRequest, flattened_response::FlattenedResponse, peers::PeersHandle};
use futures::{future, future::Either}; use futures::{future, future::Either};
use reth_interfaces::p2p::{ use reth_network_api::ReputationChangeKind;
use reth_network_p2p::{
bodies::client::{BodiesClient, BodiesFut}, bodies::client::{BodiesClient, BodiesFut},
download::DownloadClient, download::DownloadClient,
error::{PeerRequestResult, RequestError}, error::{PeerRequestResult, RequestError},
headers::client::{HeadersClient, HeadersRequest}, headers::client::{HeadersClient, HeadersRequest},
priority::Priority, priority::Priority,
}; };
use reth_network_api::ReputationChangeKind;
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{Header, B256}; use reth_primitives::{Header, B256};
use std::sync::{ use std::sync::{

View File

@ -3,12 +3,12 @@
use crate::{message::BlockRequest, peers::PeersHandle}; use crate::{message::BlockRequest, peers::PeersHandle};
use futures::StreamExt; use futures::StreamExt;
use reth_eth_wire::{GetBlockBodies, GetBlockHeaders}; use reth_eth_wire::{GetBlockBodies, GetBlockHeaders};
use reth_interfaces::p2p::{ use reth_network_api::ReputationChangeKind;
use reth_network_p2p::{
error::{EthResponseValidator, PeerRequestResult, RequestError, RequestResult}, error::{EthResponseValidator, PeerRequestResult, RequestError, RequestResult},
headers::client::HeadersRequest, headers::client::HeadersRequest,
priority::Priority, priority::Priority,
}; };
use reth_network_api::ReputationChangeKind;
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{BlockBody, Header, B256}; use reth_primitives::{BlockBody, Header, B256};
use std::{ use std::{

View File

@ -10,7 +10,7 @@ use reth_eth_wire::{
NewBlockHashes, NewPooledTransactionHashes, NodeData, PooledTransactions, Receipts, NewBlockHashes, NewPooledTransactionHashes, NodeData, PooledTransactions, Receipts,
SharedTransactions, Transactions, SharedTransactions, Transactions,
}; };
use reth_interfaces::p2p::error::{RequestError, RequestResult}; use reth_network_p2p::error::{RequestError, RequestResult};
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{ use reth_primitives::{
BlockBody, Bytes, Header, PooledTransactionsElement, ReceiptWithBloom, B256, BlockBody, Bytes, Header, PooledTransactionsElement, ReceiptWithBloom, B256,

View File

@ -7,12 +7,12 @@ use enr::Enr;
use parking_lot::Mutex; use parking_lot::Mutex;
use reth_discv4::Discv4; use reth_discv4::Discv4;
use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions}; use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions};
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_net_common::bandwidth_meter::BandwidthMeter; use reth_net_common::bandwidth_meter::BandwidthMeter;
use reth_network_api::{ use reth_network_api::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation, NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind, ReputationChangeKind,
}; };
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{Head, NodeRecord, TransactionSigned, B256}; use reth_primitives::{Head, NodeRecord, TransactionSigned, B256};
use reth_rpc_types::NetworkStatus; use reth_rpc_types::NetworkStatus;

View File

@ -18,8 +18,8 @@ use reth_eth_wire::{
message::{EthBroadcastMessage, RequestPair}, message::{EthBroadcastMessage, RequestPair},
DisconnectP2P, DisconnectReason, EthMessage, DisconnectP2P, DisconnectReason, EthMessage,
}; };
use reth_interfaces::p2p::error::RequestError;
use reth_metrics::common::mpsc::MeteredPollSender; use reth_metrics::common::mpsc::MeteredPollSender;
use reth_network_p2p::error::RequestError;
use reth_network_types::PeerId; use reth_network_types::PeerId;
use std::{ use std::{
collections::VecDeque, collections::VecDeque,

View File

@ -536,7 +536,7 @@ mod tests {
capability::{Capabilities, Capability}, capability::{Capabilities, Capability},
BlockBodies, EthVersion, BlockBodies, EthVersion,
}; };
use reth_interfaces::p2p::{bodies::client::BodiesClient, error::RequestError}; use reth_network_p2p::{bodies::client::BodiesClient, error::RequestError};
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{BlockBody, Header, B256}; use reth_primitives::{BlockBody, Header, B256};
use reth_provider::test_utils::NoopProvider; use reth_provider::test_utils::NoopProvider;

View File

@ -40,7 +40,7 @@ use reth_eth_wire::{
DedupPayload, EthVersion, GetPooledTransactions, HandleMempoolData, HandleVersionedMempoolData, DedupPayload, EthVersion, GetPooledTransactions, HandleMempoolData, HandleVersionedMempoolData,
PartiallyValidData, RequestTxHashes, ValidAnnouncementData, PartiallyValidData, RequestTxHashes, ValidAnnouncementData,
}; };
use reth_interfaces::p2p::error::{RequestError, RequestResult}; use reth_network_p2p::error::{RequestError, RequestResult};
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{PooledTransactionsElement, TxHash}; use reth_primitives::{PooledTransactionsElement, TxHash};
use schnellru::ByLength; use schnellru::ByLength;

View File

@ -20,12 +20,12 @@ use reth_eth_wire::{
NewPooledTransactionHashes, NewPooledTransactionHashes66, NewPooledTransactionHashes68, NewPooledTransactionHashes, NewPooledTransactionHashes66, NewPooledTransactionHashes68,
PooledTransactions, RequestTxHashes, Transactions, PooledTransactions, RequestTxHashes, Transactions,
}; };
use reth_interfaces::{
p2p::error::{RequestError, RequestResult},
sync::SyncStateProvider,
};
use reth_metrics::common::mpsc::UnboundedMeteredReceiver; use reth_metrics::common::mpsc::UnboundedMeteredReceiver;
use reth_network_api::{Peers, ReputationChangeKind}; use reth_network_api::{Peers, ReputationChangeKind};
use reth_network_p2p::{
error::{RequestError, RequestResult},
sync::SyncStateProvider,
};
use reth_network_types::PeerId; use reth_network_types::PeerId;
use reth_primitives::{ use reth_primitives::{
FromRecoveredPooledTransaction, PooledTransactionsElement, TransactionSigned, TxHash, B256, FromRecoveredPooledTransaction, PooledTransactionsElement, TransactionSigned, TxHash, B256,
@ -1619,8 +1619,11 @@ mod tests {
use alloy_rlp::Decodable; use alloy_rlp::Decodable;
use constants::tx_fetcher::DEFAULT_MAX_COUNT_FALLBACK_PEERS; use constants::tx_fetcher::DEFAULT_MAX_COUNT_FALLBACK_PEERS;
use futures::FutureExt; use futures::FutureExt;
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState};
use reth_network_api::NetworkInfo; use reth_network_api::NetworkInfo;
use reth_network_p2p::{
error::{RequestError, RequestResult},
sync::{NetworkSyncUpdater, SyncState},
};
use reth_primitives::hex; use reth_primitives::hex;
use reth_provider::test_utils::NoopProvider; use reth_provider::test_utils::NoopProvider;
use reth_transaction_pool::test_utils::{testing_pool, MockTransaction}; use reth_transaction_pool::test_utils::{testing_pool, MockTransaction};

View File

@ -1,10 +1,10 @@
use reth_eth_wire::{GetPooledTransactions, PooledTransactions}; use reth_eth_wire::{GetPooledTransactions, PooledTransactions};
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState};
use reth_network::{ use reth_network::{
test_utils::{NetworkEventStream, Testnet}, test_utils::{NetworkEventStream, Testnet},
NetworkEvents, PeerRequest, NetworkEvents, PeerRequest,
}; };
use reth_network_api::{NetworkInfo, Peers}; use reth_network_api::{NetworkInfo, Peers};
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState};
use reth_primitives::{Signature, TransactionSigned, B256}; use reth_primitives::{Signature, TransactionSigned, B256};
use reth_provider::test_utils::MockEthProvider; use reth_provider::test_utils::MockEthProvider;
use reth_transaction_pool::{ use reth_transaction_pool::{

View File

@ -5,16 +5,16 @@ use alloy_provider::{ext::AdminApi, ProviderBuilder};
use futures::StreamExt; use futures::StreamExt;
use reth_discv4::Discv4Config; use reth_discv4::Discv4Config;
use reth_eth_wire::DisconnectReason; use reth_eth_wire::DisconnectReason;
use reth_interfaces::{
p2p::headers::client::{HeadersClient, HeadersRequest},
sync::{NetworkSyncUpdater, SyncState},
};
use reth_net_common::ban_list::BanList; use reth_net_common::ban_list::BanList;
use reth_network::{ use reth_network::{
test_utils::{enr_to_peer_id, NetworkEventStream, PeerConfig, Testnet, GETH_TIMEOUT}, test_utils::{enr_to_peer_id, NetworkEventStream, PeerConfig, Testnet, GETH_TIMEOUT},
NetworkConfigBuilder, NetworkEvent, NetworkEvents, NetworkManager, PeersConfig, NetworkConfigBuilder, NetworkEvent, NetworkEvents, NetworkManager, PeersConfig,
}; };
use reth_network_api::{NetworkInfo, Peers, PeersInfo}; use reth_network_api::{NetworkInfo, Peers, PeersInfo};
use reth_network_p2p::{
headers::client::{HeadersClient, HeadersRequest},
sync::{NetworkSyncUpdater, SyncState},
};
use reth_primitives::{mainnet_nodes, HeadersDirection, NodeRecord}; use reth_primitives::{mainnet_nodes, HeadersDirection, NodeRecord};
use reth_provider::test_utils::NoopProvider; use reth_provider::test_utils::NoopProvider;
use reth_transaction_pool::test_utils::testing_pool; use reth_transaction_pool::test_utils::testing_pool;

View File

@ -2,15 +2,15 @@
//! Tests for eth related requests //! Tests for eth related requests
use rand::Rng; use rand::Rng;
use reth_interfaces::p2p::{
bodies::client::BodiesClient,
headers::client::{HeadersClient, HeadersRequest},
};
use reth_network::{ use reth_network::{
test_utils::{NetworkEventStream, Testnet}, test_utils::{NetworkEventStream, Testnet},
NetworkEvents, NetworkEvents,
}; };
use reth_network_api::{NetworkInfo, Peers}; use reth_network_api::{NetworkInfo, Peers};
use reth_network_p2p::{
bodies::client::BodiesClient,
headers::client::{HeadersClient, HeadersRequest},
};
use reth_primitives::{ use reth_primitives::{
Block, BlockBody, Bytes, Header, HeadersDirection, Signature, Transaction, TransactionSigned, Block, BlockBody, Bytes, Header, HeadersDirection, Signature, Transaction, TransactionSigned,
TxEip2930, TxKind, U256, TxEip2930, TxKind, U256,