From 46a1839ec33ca235ae5be2af58a5205b0e8294f9 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Tue, 24 Sep 2024 14:00:50 +0200 Subject: [PATCH] Use `SubnetSamplingSize` instead of `CustodySubnetCount` where needed. --- beacon-chain/sync/pending_blocks_queue.go | 4 ++-- beacon-chain/sync/rpc_beacon_blocks_by_root.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beacon-chain/sync/pending_blocks_queue.go b/beacon-chain/sync/pending_blocks_queue.go index 638026135b1f..e75140929b87 100644 --- a/beacon-chain/sync/pending_blocks_queue.go +++ b/beacon-chain/sync/pending_blocks_queue.go @@ -346,9 +346,9 @@ func (s *Service) sendBatchRootRequest(ctx context.Context, roots [][32]byte, ra if peerDASIsActive { var err error - bestPeers, err = s.cfg.p2p.DataColumnsAdmissibleCustodyPeers(bestPeers) + bestPeers, err = s.cfg.p2p.DataColumnsAdmissibleSubnetSamplingPeers(bestPeers) if err != nil { - return errors.Wrap(err, "get valid custody peers") + return errors.Wrap(err, "data columns admissible subnet sampling peers") } } diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_root.go b/beacon-chain/sync/rpc_beacon_blocks_by_root.go index c041bfc44b74..e4b8635cf5d9 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_root.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_root.go @@ -274,8 +274,8 @@ func (s *Service) pendingBlobsRequestForBlock(root [32]byte, b interfaces.ReadOn return blobIdentifiers, nil } -// buildRequestsForMissingDataColumns looks at the data columns we should custody and we don't actually store for a given block, -// and construct the corresponding data column sidecars by root requests. +// buildRequestsForMissingDataColumns looks at the data columns we should custody and have via subnet sampling +// and that we don't actually store for a given block, and construct the corresponding data column sidecars by root requests. func (s *Service) buildRequestsForMissingDataColumns(root [32]byte, block interfaces.ReadOnlySignedBeaconBlock) (types.DataColumnSidecarsByRootReq, error) { // Block before deneb has nor blobs neither data columns. if block.Version() < version.Deneb { @@ -301,7 +301,7 @@ func (s *Service) buildRequestsForMissingDataColumns(root [32]byte, block interf // Retrieve the columns we should custody. nodeID := s.cfg.p2p.NodeID() - custodySubnetCount := peerdas.CustodySubnetCount() + custodySubnetCount := peerdas.SubnetSamplingSize() custodyColumns, err := peerdas.CustodyColumns(nodeID, custodySubnetCount) if err != nil {