state: compute primary routes inside NodeStore snapshot

Add primaries and isPrimary maps to Snapshot plus an election
algorithm. No callers yet.

Updates #3203
This commit is contained in:
Kristoffer Dalby 2026-04-28 12:44:58 +00:00
parent 942313a10a
commit da927eb018
2 changed files with 173 additions and 9 deletions

View file

@ -150,7 +150,7 @@ func TestSnapshotFromNodes(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
nodes, peersFunc := tt.setupFunc()
snapshot := snapshotFromNodes(nodes, peersFunc)
snapshot := snapshotFromNodes(nodes, peersFunc, nil)
tt.validate(t, nodes, snapshot)
})
}