diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 955c7842..154f7e5c 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -328,7 +328,7 @@ func createVersionsRegistryTestOrProduction( ValStatsCacheValidityDurationSec: 60, EconomicsMetricsCacheValidityDurationSec: 6, FaucetValue: "10000000000", - NumberOfShards: 2, + NumberOfShards: 3, }, ApiLogging: config.ApiLoggingConfig{ LoggingEnabled: true, diff --git a/observer/baseNodeProvider.go b/observer/baseNodeProvider.go index 00210b6a..82ebe82c 100644 --- a/observer/baseNodeProvider.go +++ b/observer/baseNodeProvider.go @@ -34,7 +34,7 @@ func (bnp *baseNodeProvider) initNodes(nodes []*data.NodeData) error { continue } - if shardId > bnp.numOfShards { + if shardId >= bnp.numOfShards { return fmt.Errorf("%w for observer %s, provided shard %d, number of shards configured %d", ErrInvalidShard, observer.Address, diff --git a/observer/baseNodeProvider_test.go b/observer/baseNodeProvider_test.go index 9ac5cfef..34db5660 100644 --- a/observer/baseNodeProvider_test.go +++ b/observer/baseNodeProvider_test.go @@ -43,7 +43,7 @@ func TestBaseNodeProvider_InvalidNodesConfiguration(t *testing.T) { } bnp := baseNodeProvider{ - numOfShards: 1, + numOfShards: 2, } err := bnp.initNodes(nodes) require.Contains(t, err.Error(), "observers for shard 1 must include at least one historical (non-snapshotless) observer") @@ -60,7 +60,7 @@ func TestBaseNodeProvider_InvalidShardForObserver(t *testing.T) { }, { Address: "addr1", - ShardId: 2, + ShardId: 1, IsSnapshotless: true, }, } diff --git a/observer/testdata/config.toml b/observer/testdata/config.toml index c82a7ee4..ec117fd6 100644 --- a/observer/testdata/config.toml +++ b/observer/testdata/config.toml @@ -30,5 +30,5 @@ Address = "full-history-observer-shard-1" [[FullHistoryNodes]] - ShardId = 1 + ShardId = 4294967295 Address = "full-history-observer-shard-4294967295"