mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 22:06:21 +00:00
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 =
|
proc updateHead(node: BeaconNode): BlockRef =
|
||||||
# TODO move all of this logic to BlockPool
|
# TODO move all of this logic to BlockPool
|
||||||
|
info "Preparing for fork choice",
|
||||||
|
connectedPeers = node.network.connectedPeers
|
||||||
|
|
||||||
let
|
let
|
||||||
justifiedHead = node.blockPool.latestJustifiedBlock()
|
justifiedHead = node.blockPool.latestJustifiedBlock()
|
||||||
|
|
||||||
|
@ -435,6 +435,7 @@ proc updateHead*(pool: BlockPool, state: var StateData, blck: BlockRef) =
|
|||||||
debug "No head update this time",
|
debug "No head update this time",
|
||||||
headBlockRoot = shortLog(blck.root),
|
headBlockRoot = shortLog(blck.root),
|
||||||
headBlockSlot = humaneSlotNum(blck.slot)
|
headBlockSlot = humaneSlotNum(blck.slot)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
pool.head = blck
|
pool.head = blck
|
||||||
|
@ -8,7 +8,8 @@ const
|
|||||||
when useRLPx:
|
when useRLPx:
|
||||||
import
|
import
|
||||||
os,
|
os,
|
||||||
eth/[rlp, p2p, keys], gossipsub_protocol
|
eth/[rlp, p2p, keys], gossipsub_protocol,
|
||||||
|
eth/p2p/peer_pool # for log on connected peers
|
||||||
|
|
||||||
export
|
export
|
||||||
p2p, rlp, gossipsub_protocol
|
p2p, rlp, gossipsub_protocol
|
||||||
@ -74,6 +75,9 @@ when useRLPx:
|
|||||||
proc init*(T: type BootstrapAddr, str: string): T =
|
proc init*(T: type BootstrapAddr, str: string): T =
|
||||||
initENode(str)
|
initENode(str)
|
||||||
|
|
||||||
|
func connectedPeers*(enode: EthereumNode): int =
|
||||||
|
enode.peerPool.len
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import
|
import
|
||||||
libp2p/daemon/daemonapi, chronicles,
|
libp2p/daemon/daemonapi, chronicles,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user