Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename net-common to banlist #9016

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ members = [
"crates/exex/types/",
"crates/metrics/",
"crates/metrics/metrics-derive/",
"crates/net/common/",
"crates/net/banlist/",
"crates/net/discv4/",
"crates/net/discv5/",
"crates/net/dns/",
Expand Down Expand Up @@ -288,7 +288,7 @@ reth-libmdbx = { path = "crates/storage/libmdbx-rs" }
reth-mdbx-sys = { path = "crates/storage/libmdbx-rs/mdbx-sys" }
reth-metrics = { path = "crates/metrics" }
reth-metrics-derive = { path = "crates/metrics/metrics-derive" }
reth-net-common = { path = "crates/net/common" }
reth-net-banlist = { path = "crates/net/banlist" }
reth-net-nat = { path = "crates/net/nat" }
reth-network = { path = "crates/net/network" }
reth-network-api = { path = "crates/net/network-api" }
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-net-common.workspace = true
reth-net-banlist.workspace = true
reth-network-api.workspace = true
reth-downloaders.workspace = true
reth-tracing.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "reth-net-common"
name = "reth-net-banlist"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "Types shared across network code"
description = "Banlist for peers and IPs"

[lints]
workspace = true
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
//! Support for banning peers.

#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

type PeerId = alloy_primitives::B512;

use std::{collections::HashMap, net::IpAddr, time::Instant};
Expand Down
11 changes: 0 additions & 11 deletions crates/net/common/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/net/discv4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true

[dependencies]
# reth
reth-net-common.workspace = true
reth-net-banlist.workspace = true
reth-ethereum-forks.workspace = true
reth-net-nat.workspace = true
reth-network-peers = { workspace = true, features = ["secp256k1"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/net/discv4/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use alloy_primitives::bytes::Bytes;
use alloy_rlp::Encodable;
use reth_net_common::ban_list::BanList;
use reth_net_banlist::BanList;
use reth_net_nat::{NatResolver, ResolveNatInterval};
use reth_network_peers::NodeRecord;
#[cfg(feature = "serde")]
Expand Down
1 change: 0 additions & 1 deletion crates/net/eth-wire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ snap = "1.0.5"
arbitrary = { workspace = true, features = ["derive"], optional = true }

[dev-dependencies]
reth-net-common.workspace = true
reth-primitives = { workspace = true, features = ["arbitrary"] }
reth-tracing.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-net-common.workspace = true
reth-net-banlist.workspace = true
reth-network-api.workspace = true
reth-network-p2p.workspace = true
reth-discv4.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/net/network/src/peers/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
};
use futures::StreamExt;
use reth_eth_wire::{errors::EthStreamError, DisconnectReason};
use reth_net_common::ban_list::BanList;
use reth_net_banlist::BanList;
use reth_network_api::{PeerKind, ReputationChangeKind};
use reth_network_peers::{NodeRecord, PeerId};
use reth_primitives::ForkId;
Expand Down Expand Up @@ -1555,7 +1555,7 @@ mod tests {
errors::{EthHandshakeError, EthStreamError, P2PHandshakeError, P2PStreamError},
DisconnectReason,
};
use reth_net_common::ban_list::BanList;
use reth_net_banlist::BanList;
use reth_network_api::{Direction, ReputationChangeKind};
use reth_network_peers::PeerId;
use reth_primitives::B512;
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/tests/it/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use futures::StreamExt;
use reth_chainspec::net::mainnet_nodes;
use reth_discv4::Discv4Config;
use reth_eth_wire::DisconnectReason;
use reth_net_common::ban_list::BanList;
use reth_net_banlist::BanList;
use reth_network::{
test_utils::{enr_to_peer_id, NetworkEventStream, PeerConfig, Testnet, GETH_TIMEOUT},
NetworkConfigBuilder, NetworkEvent, NetworkEvents, NetworkManager, PeersConfig,
Expand Down
2 changes: 1 addition & 1 deletion docs/repo/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The networking component mainly lives in [`net/network`](../../crates/net/networ

#### Common

- [`net/common`](../../crates/net/common): Shared types used across multiple networking crates.
- [`net/banlist`](../../crates/net/banlist): A simple peer banlist that can be used to ban peers or IP addresses.
- Contains: Peer banlist.
- [`net/network-api`](../../crates/net/network-api): Contains traits that define the networking component as a whole. Other components that interface with the network stack only need to depend on this crate for the relevant types.
- [`net/nat`](../../crates/net/nat): A small helper crate that resolves the external IP of the running node using various methods (such as a manually provided IP, using UPnP etc.)
Expand Down
Loading