mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Merge remote-tracking branch 'origin/stable' into unstable
This commit is contained in:
@@ -109,7 +109,7 @@ pub use discovery::Eth2Enr;
|
||||
pub use discv5;
|
||||
pub use gossipsub::{IdentTopic, MessageAcceptance, MessageId, Topic, TopicHash};
|
||||
pub use libp2p;
|
||||
pub use libp2p::{Multiaddr, multiaddr};
|
||||
pub use libp2p::{Multiaddr, identity, multiaddr};
|
||||
pub use libp2p::{PeerId, Swarm, core::ConnectedPoint};
|
||||
pub use peer_manager::{
|
||||
ConnectionDirection, PeerConnectionStatus, PeerInfo, PeerManager, SyncInfo, SyncStatus,
|
||||
|
||||
@@ -26,6 +26,7 @@ use gossipsub::{
|
||||
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;
|
||||
use libp2p::swarm::{NetworkBehaviour, Swarm, SwarmEvent};
|
||||
@@ -171,11 +172,10 @@ impl<E: EthSpec> Network<E> {
|
||||
executor: task_executor::TaskExecutor,
|
||||
mut ctx: ServiceContext<'_>,
|
||||
custody_group_count: u64,
|
||||
local_keypair: Keypair,
|
||||
) -> Result<(Self, Arc<NetworkGlobals<E>>), String> {
|
||||
let config = ctx.config.clone();
|
||||
trace!("Libp2p Service starting");
|
||||
// initialise the node's ID
|
||||
let local_keypair = utils::load_private_key(&config);
|
||||
|
||||
// Trusted peers will also be marked as explicit in GossipSub.
|
||||
// Cfr. https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#explicit-peering-agreements
|
||||
|
||||
@@ -16,6 +16,7 @@ use types::{
|
||||
|
||||
type E = MinimalEthSpec;
|
||||
|
||||
use lighthouse_network::identity::secp256k1;
|
||||
use lighthouse_network::rpc::config::InboundRateLimiterConfig;
|
||||
use tempfile::Builder as TempBuilder;
|
||||
|
||||
@@ -138,10 +139,15 @@ pub async fn build_libp2p_instance(
|
||||
libp2p_registry: None,
|
||||
};
|
||||
Libp2pInstance(
|
||||
LibP2PService::new(executor, libp2p_context, custody_group_count)
|
||||
.await
|
||||
.expect("should build libp2p instance")
|
||||
.0,
|
||||
LibP2PService::new(
|
||||
executor,
|
||||
libp2p_context,
|
||||
custody_group_count,
|
||||
secp256k1::Keypair::generate().into(),
|
||||
)
|
||||
.await
|
||||
.expect("should build libp2p instance")
|
||||
.0,
|
||||
signal,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user