mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rename net-common to banlist (#9016)
This commit is contained in:
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -6234,7 +6234,7 @@ dependencies = [
|
||||
"reth-execution-types",
|
||||
"reth-exex",
|
||||
"reth-fs-util",
|
||||
"reth-net-common",
|
||||
"reth-net-banlist",
|
||||
"reth-network",
|
||||
"reth-network-api",
|
||||
"reth-network-p2p",
|
||||
@ -6686,7 +6686,7 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"reth-chainspec",
|
||||
"reth-ethereum-forks",
|
||||
"reth-net-common",
|
||||
"reth-net-banlist",
|
||||
"reth-net-nat",
|
||||
"reth-network-peers",
|
||||
"reth-tracing",
|
||||
@ -6890,7 +6890,6 @@ dependencies = [
|
||||
"reth-ecies",
|
||||
"reth-eth-wire-types",
|
||||
"reth-metrics",
|
||||
"reth-net-common",
|
||||
"reth-network-peers",
|
||||
"reth-primitives",
|
||||
"reth-tracing",
|
||||
@ -7221,7 +7220,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-net-common"
|
||||
name = "reth-net-banlist"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
@ -7269,7 +7268,7 @@ dependencies = [
|
||||
"reth-ecies",
|
||||
"reth-eth-wire",
|
||||
"reth-metrics",
|
||||
"reth-net-common",
|
||||
"reth-net-banlist",
|
||||
"reth-network",
|
||||
"reth-network-api",
|
||||
"reth-network-p2p",
|
||||
|
||||
@ -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/",
|
||||
@ -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" }
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
0
crates/net/banlist/src/ban_list.rs
Normal file
0
crates/net/banlist/src/ban_list.rs
Normal file
@ -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};
|
||||
@ -1,11 +0,0 @@
|
||||
//! Shared types across `reth-net`.
|
||||
|
||||
#![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))]
|
||||
|
||||
pub mod ban_list;
|
||||
@ -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"] }
|
||||
|
||||
@ -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")]
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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.)
|
||||
|
||||
Reference in New Issue
Block a user