mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 23:04:26 +00:00
enable filtering of peers during data column root request
This commit is contained in:
parent
5b8abc5f1b
commit
e163aa08c0
@ -281,7 +281,7 @@ proc lookupCscFromPeer(peer: Peer):
|
||||
peer_id = peer.peerId
|
||||
return 0
|
||||
|
||||
else:
|
||||
elif enrOpt.isOk:
|
||||
let
|
||||
enr = enrOpt.get
|
||||
enrFieldOpt =
|
||||
@ -293,6 +293,9 @@ proc lookupCscFromPeer(peer: Peer):
|
||||
else:
|
||||
return(enrFieldOpt.get)
|
||||
|
||||
else:
|
||||
return(peer.metadata.get.custody_subnet_count)
|
||||
|
||||
proc constructValidCustodyPeers(rman: RequestManager,
|
||||
peers: openArray[Peer]):
|
||||
seq[Peer] =
|
||||
@ -349,11 +352,11 @@ proc fetchDataColumnsFromNetwork(rman: RequestManager,
|
||||
try:
|
||||
peer = await rman.network.peerPool.acquire()
|
||||
|
||||
# # Create a peer list, which shall be later trimmed off as to which
|
||||
# # of the peers have the valid custody columns
|
||||
# peers.add(peer)
|
||||
# let validPeers = rman.constructValidCustodyPeers(peers)
|
||||
# if peer in validPeers:
|
||||
# Create a peer list, which shall be later trimmed off as to which
|
||||
# of the peers have the valid custody columns
|
||||
peers.add(peer)
|
||||
let validPeers = rman.constructValidCustodyPeers(peers)
|
||||
if peer in validPeers:
|
||||
debug "Requesting data columns by root", peer = peer, columns = shortLog(colIdList),
|
||||
peer_score = peer.getScore()
|
||||
let columns = await dataColumnSidecarsByRoot(peer, DataColumnIdentifierList colIdList)
|
||||
|
Loading…
x
Reference in New Issue
Block a user