Skip to content
Open
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
171 changes: 74 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ fork_choice = { path = "consensus/fork_choice" }
fs2 = "0.4"
futures = "0.3"
genesis = { path = "beacon_node/genesis" }
# This is tracking the sigp-gossipsub branch on sigp/rust-libp2p commit: Aug 20 2025
gossipsub = { package = "libp2p-gossipsub", git = "https://github.com/sigp/rust-libp2p.git", rev = "5acdf89a65d64098f9346efa5769e57bcd19dea9", "features" = ["metrics"] }
graffiti_file = { path = "validator_client/graffiti_file" }
hashlink = "0.9.0"
health_metrics = { path = "common/health_metrics" }
Expand All @@ -173,6 +171,8 @@ initialized_validators = { path = "validator_client/initialized_validators" }
int_to_bytes = { path = "consensus/int_to_bytes" }
itertools = "0.10"
kzg = { path = "crypto/kzg" }
libp2p = { git = "https://github.com/libp2p/rust-libp2p.git", default-features = false, features = ["identify", "yamux", "noise", "dns", "tcp", "tokio", "secp256k1",
"macros", "ecdsa", "metrics", "quic", "upnp", "gossipsub"] }
libsecp256k1 = "0.7"
lighthouse_network = { path = "beacon_node/lighthouse_network" }
lighthouse_tracing = { path = "beacon_node/lighthouse_tracing" }
Expand Down
25 changes: 3 additions & 22 deletions beacon_node/lighthouse_network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
fnv = { workspace = true }
futures = { workspace = true }
gossipsub = { workspace = true }
hex = { workspace = true }
itertools = { workspace = true }
libp2p-mplex = "0.43"
libp2p = { workspace = true }
libp2p-mplex = { git = "https://github.com/libp2p/rust-libp2p.git" }
lighthouse_version = { workspace = true }
local-ip-address = "0.6"
logging = { workspace = true }
Expand All @@ -33,7 +33,7 @@ lru_cache = { workspace = true }
metrics = { workspace = true }
network_utils = { workspace = true }
parking_lot = { workspace = true }
prometheus-client = "0.23.0"
prometheus-client = "0.24.0"
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
Expand All @@ -51,25 +51,6 @@ tracing-subscriber = { workspace = true }
types = { workspace = true }
unsigned-varint = { version = "0.8", features = ["codec"] }

[dependencies.libp2p]
version = "0.56"
default-features = false
features = [
"identify",
"yamux",
"noise",
"dns",
"tcp",
"tokio",
"plaintext",
"secp256k1",
"macros",
"ecdsa",
"metrics",
"quic",
"upnp",
]

[dev-dependencies]
async-channel = { workspace = true }
logging = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{Enr, PeerIdSerialized};
use directory::{
DEFAULT_BEACON_NODE_DIR, DEFAULT_HARDCODED_NETWORK, DEFAULT_NETWORK_DIR, DEFAULT_ROOT_DIR,
};
use libp2p::Multiaddr;
use libp2p::{Multiaddr, gossipsub};
use local_ip_address::local_ipv6;
use network_utils::listen_addr::{ListenAddr, ListenAddress};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ pub use prometheus_client;
pub use config::Config as NetworkConfig;
pub use discovery::Eth2Enr;
pub use discv5;
pub use gossipsub::{IdentTopic, MessageAcceptance, MessageId, Topic, TopicHash};
pub use libp2p;
pub use libp2p::gossipsub::{IdentTopic, MessageAcceptance, MessageId, Topic, TopicHash};
pub use libp2p::{Multiaddr, multiaddr};
pub use libp2p::{PeerId, Swarm, core::ConnectedPoint};
pub use peer_manager::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::TopicHash;
use crate::types::{GossipEncoding, GossipKind, GossipTopic};
use gossipsub::{IdentTopic as Topic, PeerScoreParams, PeerScoreThresholds, TopicScoreParams};
use libp2p::gossipsub::{
IdentTopic as Topic, PeerScoreParams, PeerScoreThresholds, TopicScoreParams,
};
use std::cmp::max;
use std::collections::HashMap;
use std::marker::PhantomData;
Expand Down
18 changes: 9 additions & 9 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use crate::types::{
use crate::{Enr, NetworkGlobals, PubsubMessage, TopicHash, metrics};
use api_types::{AppRequestId, Response};
use futures::stream::StreamExt;
use gossipsub::{
IdentTopic as Topic, MessageAcceptance, MessageAuthenticity, MessageId, PublishError,
use gossipsub_scoring_parameters::{PeerScoreSettings, lighthouse_gossip_thresholds};
use libp2p::gossipsub::{
self, IdentTopic as Topic, MessageAcceptance, MessageAuthenticity, MessageId, PublishError,
TopicScoreParams,
};
use gossipsub_scoring_parameters::{PeerScoreSettings, lighthouse_gossip_thresholds};
use libp2p::multiaddr::{self, Multiaddr, Protocol as MProtocol};
use libp2p::swarm::behaviour::toggle::Toggle;
use libp2p::swarm::{NetworkBehaviour, Swarm, SwarmEvent};
Expand Down Expand Up @@ -1764,9 +1764,9 @@ impl<E: EthSpec> Network<E> {

fn inject_upnp_event(&mut self, event: libp2p::upnp::Event) {
match event {
libp2p::upnp::Event::NewExternalAddr(addr) => {
info!(%addr, "UPnP route established");
let mut iter = addr.iter();
libp2p::upnp::Event::NewExternalAddr { external_addr, .. } => {
info!(%external_addr, "UPnP route established");
let mut iter = external_addr.iter();
let is_ip6 = {
let addr = iter.next();
matches!(addr, Some(MProtocol::Ip6(_)))
Expand All @@ -1781,7 +1781,7 @@ impl<E: EthSpec> Network<E> {
}
}
_ => {
trace!(%addr, "UPnP address mapped multiaddr from unknown transport");
trace!(%external_addr, "UPnP address mapped multiaddr from unknown transport");
}
},
Some(multiaddr::Protocol::Tcp(tcp_port)) => {
Expand All @@ -1790,11 +1790,11 @@ impl<E: EthSpec> Network<E> {
}
}
_ => {
trace!(%addr, "UPnP address mapped multiaddr from unknown transport");
trace!(%external_addr, "UPnP address mapped multiaddr from unknown transport");
}
}
}
libp2p::upnp::Event::ExpiredExternalAddr(_) => {}
libp2p::upnp::Event::ExpiredExternalAddr { .. } => {}
libp2p::upnp::Event::GatewayNotFound => {
info!("UPnP not available");
}
Expand Down
5 changes: 2 additions & 3 deletions beacon_node/lighthouse_network/src/service/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ use crate::rpc::{MetaData, MetaDataV2, MetaDataV3};
use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield, GossipEncoding, GossipKind};
use crate::{GossipTopic, NetworkConfig};
use futures::future::Either;
use gossipsub;
use libp2p::core::{multiaddr::Multiaddr, muxing::StreamMuxerBox, transport::Boxed};
use libp2p::identity::{Keypair, secp256k1};
use libp2p::metrics::Registry;
use libp2p::{PeerId, Transport, core, noise, yamux};
use libp2p::{PeerId, Transport, core, gossipsub, noise, yamux};
use ssz::Decode;
use std::collections::HashSet;
use std::fs::File;
Expand Down Expand Up @@ -41,7 +40,7 @@ pub fn build_transport(
quic_support: bool,
) -> std::io::Result<BoxedTransport> {
// mplex config
let mut mplex_config = libp2p_mplex::MplexConfig::new();
let mut mplex_config = libp2p_mplex::Config::new();
mplex_config.set_max_buffer_size(256);
mplex_config.set_max_buffer_behaviour(libp2p_mplex::MaxBufferBehaviour::Block);

Expand Down
1 change: 1 addition & 0 deletions beacon_node/lighthouse_network/src/types/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::TopicHash;
use crate::types::{GossipEncoding, GossipKind, GossipTopic};
use libp2p::gossipsub;
use snap::raw::{Decoder, Encoder, decompress_len};
use ssz::{Decode, Encode};
use std::io::{Error, ErrorKind};
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/types/topics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gossipsub::{IdentTopic as Topic, TopicHash};
use libp2p::gossipsub::{IdentTopic as Topic, TopicHash};
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use strum::AsRefStr;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ bls = { workspace = true }
eth2 = { workspace = true }
eth2_network_config = { workspace = true }
genesis = { workspace = true }
gossipsub = { workspace = true }
k256 = "0.13.4"
kzg = { workspace = true }
libp2p = { workspace = true }
matches = "0.1.8"
rand_08 = { package = "rand", version = "0.8.5" }
rand_chacha = "0.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use beacon_chain::test_utils::{
};
use beacon_chain::{BeaconChain, WhenSlotSkipped};
use beacon_processor::{work_reprocessing_queue::*, *};
use gossipsub::MessageAcceptance;
use itertools::Itertools;
use libp2p::gossipsub::MessageAcceptance;
use lighthouse_network::rpc::InboundRequestId;
use lighthouse_network::rpc::methods::{
BlobsByRangeRequest, DataColumnsByRangeRequest, MetaDataV3,
Expand Down
1 change: 1 addition & 0 deletions beacon_node/network/src/service/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use beacon_chain::BeaconChainTypes;
use beacon_chain::test_utils::BeaconChainHarness;
use beacon_processor::{BeaconProcessorChannels, BeaconProcessorConfig};
use futures::StreamExt;
use libp2p::gossipsub;
use lighthouse_network::types::{GossipEncoding, GossipKind};
use lighthouse_network::{Enr, GossipTopic};
use std::str::FromStr;
Expand Down
Loading