feat: redistribution toggle - #5580
Conversation
gacevicljubisa
left a comment
There was a problem hiding this comment.
Implementation looks correct. A few suggestions:
- Move the toggle onto the existing resource — the flag is already read from GET /redistributionstate, so the write belongs there too:
GET /redistributionstate
PATCH /redistributionstate {"enabled": false}
Matches the repo convention (PATCH /stamps/{batch_id}, /tags/{id}, /grantee/{address}). Tried it locally, tests green, diff net smaller.
-
If you take PATCH, add it to Access-Control-Allow-Methods (api.go:618) — currently "GET, HEAD, OPTIONS, POST, PUT, DELETE", so PATCH is blocked by preflight.
-
Expose a "safe to stop" flag on GET /redistributionstate — hasCommittedThisRound / hasRevealedThisRound. RoundData already holds CommitKey and HasRevealed. Without it, step 2 of #5313 is a ~12.7 min blind wait.
-
Add a redistribution_enabled gauge — while disabled, lastSelectedRound keeps advancing while lastPlayedRound stalls, so a disabled node looks identical to a broken one in Grafana.
Checklist
Description
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5313
Screenshots (if appropriate):
AI Disclosure