Report connected peers before fork choice
This commit is contained in:
parent
894816fa0c
commit
ca49ae9b5a
|
@ -281,6 +281,9 @@ proc getAttachedValidator(node: BeaconNode, idx: int): AttachedValidator =
|
|||
|
||||
proc updateHead(node: BeaconNode): BlockRef =
|
||||
# TODO move all of this logic to BlockPool
|
||||
info "Preparing for fork choice",
|
||||
connectedPeers = node.network.connectedPeers
|
||||
|
||||
let
|
||||
justifiedHead = node.blockPool.latestJustifiedBlock()
|
||||
|
||||
|
|
|
@ -435,6 +435,7 @@ proc updateHead*(pool: BlockPool, state: var StateData, blck: BlockRef) =
|
|||
debug "No head update this time",
|
||||
headBlockRoot = shortLog(blck.root),
|
||||
headBlockSlot = humaneSlotNum(blck.slot)
|
||||
|
||||
return
|
||||
|
||||
pool.head = blck
|
||||
|
|
|
@ -8,7 +8,8 @@ const
|
|||
when useRLPx:
|
||||
import
|
||||
os,
|
||||
eth/[rlp, p2p, keys], gossipsub_protocol
|
||||
eth/[rlp, p2p, keys], gossipsub_protocol,
|
||||
eth/p2p/peer_pool # for log on connected peers
|
||||
|
||||
export
|
||||
p2p, rlp, gossipsub_protocol
|
||||
|
@ -74,6 +75,9 @@ when useRLPx:
|
|||
proc init*(T: type BootstrapAddr, str: string): T =
|
||||
initENode(str)
|
||||
|
||||
func connectedPeers*(enode: EthereumNode): int =
|
||||
enode.peerPool.len
|
||||
|
||||
else:
|
||||
import
|
||||
libp2p/daemon/daemonapi, chronicles,
|
||||
|
|
Loading…
Reference in New Issue