diff --git a/beacon_chain/libp2p_backend.nim b/beacon_chain/libp2p_backend.nim index 87e384a2a..18a54d7da 100644 --- a/beacon_chain/libp2p_backend.nim +++ b/beacon_chain/libp2p_backend.nim @@ -188,7 +188,10 @@ proc dialPeer*(node: Eth2Node, peerInfo: PeerInfo) {.async.} = discard await node.switch.dial(peerInfo) var peer = node.getPeer(peerInfo) peer.wasDialed = true + debug "Initializing connection" await initializeConnection(peer) + debug "Subscribing to pubsub" + await peer.network.switch.subscribeToPeer(peer.info) inc libp2p_successful_dials debug "Network handshakes completed" @@ -201,6 +204,7 @@ proc runDiscoveryLoop*(node: Eth2Node) {.async.} = if currentPeerCount < node.wantedPeers: try: let discoveredPeers = await node.discovery.lookupRandom() + debug "Discovered peers", peer = $discoveredPeers for peer in discoveredPeers: debug "Discovered peer", peer = $peer try: diff --git a/beacon_chain/sync_protocol.nim b/beacon_chain/sync_protocol.nim index f94fbaaea..48e5f1bf2 100644 --- a/beacon_chain/sync_protocol.nim +++ b/beacon_chain/sync_protocol.nim @@ -163,7 +163,7 @@ proc handleInitialStatus(peer: Peer, # will allow us to implement the subscription earlier. # The root of the problem is that both sides must call `subscribeToPeer` # before any GossipSub traffic will flow between them. - await peer.network.switch.subscribeToPeer(peer.info) + discard if theirStatus.forkVersion != state.forkVersion: notice "Irrelevant peer",