mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 04:42:34 +00:00
update libp2p dependency to upstream (#8200)
Co-Authored-By: João Oliveira <hello@jxs.pt>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user