Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Sep 4, 2024
1 parent 05660f8 commit fa067f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func createVersionsRegistryTestOrProduction(
ValStatsCacheValidityDurationSec: 60,
EconomicsMetricsCacheValidityDurationSec: 6,
FaucetValue: "10000000000",
NumberOfShards: 2,
NumberOfShards: 3,
},
ApiLogging: config.ApiLoggingConfig{
LoggingEnabled: true,
Expand Down
2 changes: 1 addition & 1 deletion observer/baseNodeProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions observer/baseNodeProvider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -60,7 +60,7 @@ func TestBaseNodeProvider_InvalidShardForObserver(t *testing.T) {
},
{
Address: "addr1",
ShardId: 2,
ShardId: 1,
IsSnapshotless: true,
},
}
Expand Down
2 changes: 1 addition & 1 deletion observer/testdata/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
Address = "full-history-observer-shard-1"

[[FullHistoryNodes]]
ShardId = 1
ShardId = 4294967295
Address = "full-history-observer-shard-4294967295"

0 comments on commit fa067f8

Please sign in to comment.