Skip to content

Commit

Permalink
chore: rm reth-interfaces from network (#8435)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored May 28, 2024
1 parent a5c3c63 commit de4e0ba
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/net/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ workspace = true

[dependencies]
# reth
reth-interfaces.workspace = true
reth-primitives.workspace = true
reth-net-common.workspace = true
reth-network-api.workspace = true
reth-network-p2p.workspace = true
reth-discv4.workspace = true
reth-discv5.workspace = true
reth-dns-discovery.workspace = true
Expand Down Expand Up @@ -71,12 +71,12 @@ smallvec.workspace = true
[dev-dependencies]
# reth
reth-discv4 = { workspace = true, features = ["test-utils"] }
reth-interfaces = { 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
# integration tests
reth-network = { workspace = true, features = ["test-utils"] }
reth-network-p2p = { workspace = true, features = ["test-utils"] }

reth-provider = { workspace = true, features = ["test-utils"] }
reth-tracing.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/eth_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use reth_eth_wire::{
BlockBodies, BlockHeaders, GetBlockBodies, GetBlockHeaders, GetNodeData, GetReceipts, NodeData,
Receipts,
};
use reth_interfaces::p2p::error::RequestResult;
use reth_network_p2p::error::RequestResult;
use reth_network_types::PeerId;
use reth_primitives::{BlockBody, BlockHashOrNumber, Header, HeadersDirection};
use reth_provider::{BlockReader, HeaderProvider, ReceiptProvider};
Expand Down
4 changes: 2 additions & 2 deletions crates/net/network/src/fetch/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
use crate::{fetch::DownloadRequest, flattened_response::FlattenedResponse, peers::PeersHandle};
use futures::{future, future::Either};

use reth_interfaces::p2p::{
use reth_network_api::ReputationChangeKind;
use reth_network_p2p::{
bodies::client::{BodiesClient, BodiesFut},
download::DownloadClient,
error::{PeerRequestResult, RequestError},
headers::client::{HeadersClient, HeadersRequest},
priority::Priority,
};
use reth_network_api::ReputationChangeKind;
use reth_network_types::PeerId;
use reth_primitives::{Header, B256};
use std::sync::{
Expand Down
4 changes: 2 additions & 2 deletions crates/net/network/src/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use crate::{message::BlockRequest, peers::PeersHandle};
use futures::StreamExt;
use reth_eth_wire::{GetBlockBodies, GetBlockHeaders};
use reth_interfaces::p2p::{
use reth_network_api::ReputationChangeKind;
use reth_network_p2p::{
error::{EthResponseValidator, PeerRequestResult, RequestError, RequestResult},
headers::client::HeadersRequest,
priority::Priority,
};
use reth_network_api::ReputationChangeKind;
use reth_network_types::PeerId;
use reth_primitives::{BlockBody, Header, B256};
use std::{
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use reth_eth_wire::{
NewBlockHashes, NewPooledTransactionHashes, NodeData, PooledTransactions, Receipts,
SharedTransactions, Transactions,
};
use reth_interfaces::p2p::error::{RequestError, RequestResult};
use reth_network_p2p::error::{RequestError, RequestResult};
use reth_network_types::PeerId;
use reth_primitives::{
BlockBody, Bytes, Header, PooledTransactionsElement, ReceiptWithBloom, B256,
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use enr::Enr;
use parking_lot::Mutex;
use reth_discv4::Discv4;
use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions};
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_net_common::bandwidth_meter::BandwidthMeter;
use reth_network_api::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind,
};
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_network_types::PeerId;
use reth_primitives::{Head, NodeRecord, TransactionSigned, B256};
use reth_rpc_types::NetworkStatus;
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/session/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use reth_eth_wire::{
message::{EthBroadcastMessage, RequestPair},
DisconnectP2P, DisconnectReason, EthMessage,
};
use reth_interfaces::p2p::error::RequestError;
use reth_metrics::common::mpsc::MeteredPollSender;
use reth_network_p2p::error::RequestError;
use reth_network_types::PeerId;
use std::{
collections::VecDeque,
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ mod tests {
capability::{Capabilities, Capability},
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_primitives::{BlockBody, Header, B256};
use reth_provider::test_utils::NoopProvider;
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/transactions/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use reth_eth_wire::{
DedupPayload, EthVersion, GetPooledTransactions, HandleMempoolData, HandleVersionedMempoolData,
PartiallyValidData, RequestTxHashes, ValidAnnouncementData,
};
use reth_interfaces::p2p::error::{RequestError, RequestResult};
use reth_network_p2p::error::{RequestError, RequestResult};
use reth_network_types::PeerId;
use reth_primitives::{PooledTransactionsElement, TxHash};
use schnellru::ByLength;
Expand Down
13 changes: 8 additions & 5 deletions crates/net/network/src/transactions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use reth_eth_wire::{
NewPooledTransactionHashes, NewPooledTransactionHashes66, NewPooledTransactionHashes68,
PooledTransactions, RequestTxHashes, Transactions,
};
use reth_interfaces::{
p2p::error::{RequestError, RequestResult},
sync::SyncStateProvider,
};
use reth_metrics::common::mpsc::UnboundedMeteredReceiver;
use reth_network_api::{Peers, ReputationChangeKind};
use reth_network_p2p::{
error::{RequestError, RequestResult},
sync::SyncStateProvider,
};
use reth_network_types::PeerId;
use reth_primitives::{
FromRecoveredPooledTransaction, PooledTransactionsElement, TransactionSigned, TxHash, B256,
Expand Down Expand Up @@ -1619,8 +1619,11 @@ mod tests {
use alloy_rlp::Decodable;
use constants::tx_fetcher::DEFAULT_MAX_COUNT_FALLBACK_PEERS;
use futures::FutureExt;
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState};
use reth_network_api::NetworkInfo;
use reth_network_p2p::{
error::{RequestError, RequestResult},
sync::{NetworkSyncUpdater, SyncState},
};
use reth_primitives::hex;
use reth_provider::test_utils::NoopProvider;
use reth_transaction_pool::test_utils::{testing_pool, MockTransaction};
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/tests/it/big_pooled_txs_req.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use reth_eth_wire::{GetPooledTransactions, PooledTransactions};
use reth_interfaces::sync::{NetworkSyncUpdater, SyncState};
use reth_network::{
test_utils::{NetworkEventStream, Testnet},
NetworkEvents, PeerRequest,
};
use reth_network_api::{NetworkInfo, Peers};
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState};
use reth_primitives::{Signature, TransactionSigned, B256};
use reth_provider::test_utils::MockEthProvider;
use reth_transaction_pool::{
Expand Down
8 changes: 4 additions & 4 deletions crates/net/network/tests/it/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ use alloy_provider::{ext::AdminApi, ProviderBuilder};
use futures::StreamExt;
use reth_discv4::Discv4Config;
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_network::{
test_utils::{enr_to_peer_id, NetworkEventStream, PeerConfig, Testnet, GETH_TIMEOUT},
NetworkConfigBuilder, NetworkEvent, NetworkEvents, NetworkManager, PeersConfig,
};
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_provider::test_utils::NoopProvider;
use reth_transaction_pool::test_utils::testing_pool;
Expand Down
8 changes: 4 additions & 4 deletions crates/net/network/tests/it/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
//! Tests for eth related requests
use rand::Rng;
use reth_interfaces::p2p::{
bodies::client::BodiesClient,
headers::client::{HeadersClient, HeadersRequest},
};
use reth_network::{
test_utils::{NetworkEventStream, Testnet},
NetworkEvents,
};
use reth_network_api::{NetworkInfo, Peers};
use reth_network_p2p::{
bodies::client::BodiesClient,
headers::client::{HeadersClient, HeadersRequest},
};
use reth_primitives::{
Block, BlockBody, Bytes, Header, HeadersDirection, Signature, Transaction, TransactionSigned,
TxEip2930, TxKind, U256,
Expand Down

0 comments on commit de4e0ba

Please sign in to comment.