fix(bifrost): gate GG20 keysign leader rotation at 3.21.2 and wait out every rotated join

🔎 Visual review of e72ca325: explainer, review flags and prompts to ask an AI about the change

What

Two bifrost-only follow-ups to the GG20 keysign leader rotation (bifrost/tss/go-tss/tss/keysign_leader_rotation.go):

  1. Gate at 3.21.2. keysignLeaderRotationVersion was 3.21.1. The gate is compared against the network version, which is the lowest version among active validators (/thorchain/version current). The mainnet 3.21.1 release doesn't include the rotation code. If the network were already at 3.21.1, the next release that carries rotation would switch it on node by node as each node upgraded. Rotating and non-rotating nodes can't form a GG20 party together. With the gate at 3.21.2, the first release that ships the code, rotation turns on for the whole fleet once the last active node is on 3.21.2.
  2. Signature wait covers every rotated join. With rotation on, a party can form on any of the 3 join attempts (frostMaxJoinLeaderAttempts), and each attempt can take up to PartyTimeout, all before signing starts. The peer-signature wait was KeySignTimeout only. A signature from a party formed on a later attempt could therefore arrive after this node had stopped listening. That left non-selected nodes with an empty result and lagging nodes reporting a failed join. When rotation is on, the wait is now KeySignTimeout + 5s + 3 × PartyTimeout (185s with the default 45s/45s), which is still within the signer's RemoteSignTimeout (5m). The 5s slack matches FROST's result wait and covers peers that start a little later. This is a best-effort budget: KeySignTimeout is an idle timeout, so a ceremony that keeps exchanging messages can run past it. The legacy pre-gate wait is unchanged.

Notes

  • No consensus or state changes; bifrost only.
  • Trade-off: when a ceremony fails, nodes that weren't selected for the party keep waiting for the full rotated budget (185s instead of 45s). Failure notices don't resolve the signature wait.
  • 3.21.2 must ship this code for the gate to be correct.

Tests

  • TestKeysignLeaderRotationVersionGate: 3.21.1 is now pre-gate and 3.21.2 is where the gate opens.
  • TestKeysignSignatureWaitTimeoutCoversRotatedJoins: wait sizing pre-gate, post-gate (185s) and for an unparsable version.
  • TestWaitForSignaturesReceivesSignatureFromRotatedParty: a peer signature that arrives after KeySignTimeout is delivered with the rotation wait and times out with the pre-gate wait. With the wait change reverted, this test fails (checked locally).
  • go test -tags=mocknet ./bifrost/tss/go-tss/... passes locally.
Edited by Huginn Ai

Merge request reports

Loading
Loading