mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
update libp2p dependency to upstream (#8200)
Co-Authored-By: João Oliveira <hello@jxs.pt>
This commit is contained in:
@@ -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};
|
||||
|
||||
@@ -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, identity, multiaddr};
|
||||
pub use libp2p::{PeerId, Swarm, core::ConnectedPoint};
|
||||
pub use peer_manager::{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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::identity::Keypair;
|
||||
use libp2p::multiaddr::{self, Multiaddr, Protocol as MProtocol};
|
||||
use libp2p::swarm::behaviour::toggle::Toggle;
|
||||
@@ -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(_)))
|
||||
@@ -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)) => {
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user