Igor Sirotin ab99c15358 feat: allow overriding actual shard values in auto-sharding
Auto-sharding currently produces shard ids in the range
[0..NUM_SHARDS_IN_NETWORK-1], derived from the content topic hash. To
interoperate with Status, which uses a specific set of shard values, we
need to be able to force the actual shard values while keeping the
auto-sharding distribution.

This adds an optional shard override array (length NUM_SHARDS_IN_NETWORK):
auto-sharding still hashes the content topic to an index, but the shard id
placed in the pubsub topic becomes shardOverride[index] instead of the
index itself.

Wired through:
- Sharding.getGenZeroShard remaps the computed index via shardOverride
- ShardingConf gains a shardOverride field; default subscribe shards and
  shard validation use the actual (override) shard values
- WakuConfBuilder.withShardOverride + buildShardingConf threading
- CLI arg --shard-override (repeatable)
- mountAutoSharding accepts the override (validates length)
- api_conf AutoShardingConfig gains shardOverride (+ JSON)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 23:06:46 +00:00
..
2026-05-16 00:09:07 +02:00