Summary
The trusted dealer DKG produces 0-indexed share indices (0, 1, 2, 3), but cli.rs assumed 1-indexed and did checked_sub(1). This caused the validator with share_index=0 to crash on startup:
Error: DKG share_index is 0 but must be >= 1 (1-indexed)
The remaining 3 validators started with incorrect validator indices (off by 1), causing wrong leader election.
Status: Fixed
cli.rs: Replaced checked_sub(1) with direct use of share_index plus bounds check.
output.rs: Updated doc comment from "1-indexed" to "0-indexed".
Both trusted dealer and interactive DKG produce 0-indexed shares, so both paths are covered.
Observed Impact
On the remote devnet (4 validators):
- node2 (share_index=0): crash-looped continuously
- node0 (share_index=2): ran as validator_index=1 instead of 2
- node1 (share_index=3): ran as validator_index=2 instead of 3
- node3 (share_index=1): ran as validator_index=0 instead of 1
See tmp/issues/31-dkg-share-index-zero-indexed.md for full details.
Summary
The trusted dealer DKG produces 0-indexed share indices (0, 1, 2, 3), but
cli.rsassumed 1-indexed and didchecked_sub(1). This caused the validator with share_index=0 to crash on startup:The remaining 3 validators started with incorrect validator indices (off by 1), causing wrong leader election.
Status: Fixed
cli.rs: Replacedchecked_sub(1)with direct use ofshare_indexplus bounds check.output.rs: Updated doc comment from "1-indexed" to "0-indexed".Both trusted dealer and interactive DKG produce 0-indexed shares, so both paths are covered.
Observed Impact
On the remote devnet (4 validators):
See
tmp/issues/31-dkg-share-index-zero-indexed.mdfor full details.