Skip to content

Commit

Permalink
CustodyColumnSubnets: Include i in the for loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
nalepae committed Apr 24, 2024
1 parent 0c92512 commit 039f9eb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions beacon-chain/core/peerdas/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ func CustodyColumnSubnets(nodeId enode.ID, custodySubnetCount uint64) (map[uint6

// First, compute the subnet IDs that the node should participate in.
subnetIds := make(map[uint64]bool, custodySubnetCount)
i := uint64(0)

for uint64(len(subnetIds)) < custodySubnetCount {
for i := uint64(0); uint64(len(subnetIds)) < custodySubnetCount; i++ {
nodeIdUInt256, nextNodeIdUInt256 := new(uint256.Int), new(uint256.Int)
nodeIdUInt256.SetBytes(nodeId.Bytes())
nextNodeIdUInt256.Add(nodeIdUInt256, uint256.NewInt(i))
Expand All @@ -96,8 +95,6 @@ func CustodyColumnSubnets(nodeId enode.ID, custodySubnetCount uint64) (map[uint6
if _, exists := subnetIds[subnetId]; !exists {
subnetIds[subnetId] = true
}

i++
}

return subnetIds, nil
Expand Down

0 comments on commit 039f9eb

Please sign in to comment.