From 3f69fb377656302855d95b278bff123f6eb17f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rich=CE=9Brd?= Date: Mon, 8 Apr 2024 06:21:43 -0400 Subject: [PATCH] fix: remove max number of shards verif (#1081) --- waku/v2/protocol/shard.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/waku/v2/protocol/shard.go b/waku/v2/protocol/shard.go index 8b101484..9ef30840 100644 --- a/waku/v2/protocol/shard.go +++ b/waku/v2/protocol/shard.go @@ -4,7 +4,6 @@ import ( "encoding/binary" "errors" "fmt" - "math" "strings" "github.com/waku-org/go-waku/waku/v2/hash" @@ -20,7 +19,6 @@ const ClusterIndex = 1 const GenerationZeroShardsCount = 8 var ( - ErrTooManyShards = errors.New("too many shards") ErrInvalidShard = errors.New("invalid shard") ErrInvalidShardCount = errors.New("invalid shard count") ErrExpected130Bytes = errors.New("invalid data: expected 130 bytes") @@ -32,10 +30,6 @@ type RelayShards struct { } func NewRelayShards(clusterID uint16, shardIDs ...uint16) (RelayShards, error) { - if len(shardIDs) > math.MaxUint8 { - return RelayShards{}, ErrTooManyShards - } - shardIDSet := make(map[uint16]struct{}) for _, index := range shardIDs { if index > MaxShardIndex { @@ -142,10 +136,6 @@ func (rs RelayShards) ContainsTopic(topic string) bool { } func (rs RelayShards) ShardList() ([]byte, error) { - if len(rs.ShardIDs) > math.MaxUint8 { - return nil, ErrTooManyShards - } - var result []byte result = binary.BigEndian.AppendUint16(result, rs.ClusterID)