diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 38a083eec..cd9e48880 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1514,7 +1514,7 @@ proc tryReconstructingDataColumns* (self: BeaconNode, root = signed_block.root custodiedColumnIndices = get_custody_columns( self.network.nodeId, - localCustodySubnetCount) + max(SAMPLES_PER_SLOT.uint64, localCustodySubnetCount)) var finalisedDataColumns: seq[DataColumnSidecar] diff --git a/beacon_chain/sync/request_manager.nim b/beacon_chain/sync/request_manager.nim index 1134fc3cb..adc618ed2 100644 --- a/beacon_chain/sync/request_manager.nim +++ b/beacon_chain/sync/request_manager.nim @@ -282,7 +282,8 @@ proc constructValidCustodyPeers(rman: RequestManager, let localNodeId = rman.network.nodeId localCustodyColumns = - localNodeId.get_custody_columns(localCustodySubnetCount) + localNodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64, + localCustodySubnetCount)) var validPeers: seq[Peer] @@ -296,8 +297,9 @@ proc constructValidCustodyPeers(rman: RequestManager, let remoteNodeId = getNodeIdFromPeer(peer) remoteCustodyColumns = - remoteNodeId.get_custody_columns(remoteCustodySubnetCount) - + remoteNodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64, + localCustodySubnetCount)) + # If the remote peer custodies less columns than # our local node # We skip it diff --git a/beacon_chain/sync/sync_manager.nim b/beacon_chain/sync/sync_manager.nim index 5303db758..7fcd58a2f 100644 --- a/beacon_chain/sync/sync_manager.nim +++ b/beacon_chain/sync/sync_manager.nim @@ -286,7 +286,8 @@ proc getDataColumnSidecars[A, B](man: SyncManager[A, B], peer: A, let remoteNodeId = getNodeIdFromPeer(peer) remoteCustodyColumns = - remoteNodeId.get_custody_column_list(remoteCustodySubnetCount) + remoteNodeId.get_custody_column_list(max(SAMPLES_PER_SLOT.uint64, + remoteCustodySubnetCount)) doAssert(not(req.isEmpty()), "Request must not be empty!") debug "Requesting data column sidecars from peer", request = req diff --git a/beacon_chain/validators/message_router.nim b/beacon_chain/validators/message_router.nim index 20e5297a0..c28242dd3 100644 --- a/beacon_chain/validators/message_router.nim +++ b/beacon_chain/validators/message_router.nim @@ -196,7 +196,8 @@ proc routeSignedBeaconBlock*( notice "Data columns sent", data_column = shortLog(dataColumnsOpt[].get()[i]) let metadata = router[].network.metadata.custody_subnet_count.uint64 - custody_columns = router[].network.nodeId.get_custody_columns(metadata) + custody_columns = router[].network.nodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64, + metadata)) for dc in data_columns: if dc.index in custody_columns: