fix(zetaclient): keep signing when the keygen record is reset (backport v38) - #4627
Draft
kingpinXD wants to merge 1 commit into
Draft
fix(zetaclient): keep signing when the keygen record is reset (backport v38)#4627kingpinXD wants to merge 1 commit into
kingpinXD wants to merge 1 commit into
Conversation
…rt v38) Backport of #4618. Production code only, same scope as the drain backports: the e2e harness, CI wiring and changelog stay on main. zetacore blanks the keygen record on any observer set change, which took every mainnet signer down on 2026-08-11 and stopped them restarting. Three changes: the p2p whitelist now comes from TssParticipantList instead of the erased grantee list, Setup skips the keygen ceremony when a TSS already exists, and the keygen watcher that triggered the mass restart is gone. Every zetacore query on the startup path is retried with a constant backoff, so a contended RPC during a mass restart does not kill startup. Note for operators: while a finalized TSS exists, a keygen scheduled via MsgUpdateKeygen will not run. Rotating requires removing the current TSS first. Tracked in #4623. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cd1ZRjpN5br7NRYA9sCp7G
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ws4charlie
approved these changes
Aug 14, 2026
ws4charlie
left a comment
Contributor
There was a problem hiding this comment.
LGTM — diffed this against #4618 and all five files are byte-identical, and the pre-patch baselines match across main/v37/v38 so the cherry-pick is clean. Built it and ran the tss + maintenance unit tests locally, both green.
kingpinXD
marked this pull request as draft
August 14, 2026 04:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #4618 to
release/zetaclient/v38. Do not merge before #4618.Summary
TSS.TssParticipantListrather than the keygen record, which zetacore erases on any observer set change.Scope
Production code only, matching the drain backports (#4614 / #4615). Five files:
zetaclient/tss/setup.go,service.go,zetaclient/maintenance/tss_listener.goand the two test files. The e2e harness, CI wiring and changelog stay onmain— they conflict on this branch and carry no runtime behaviour.Compatibility with the drain
No shared files, and no drain code reads the keygen record.
Setupruns beforestartDrainIfArmedincmd/zetaclientd/start.go, so a signer that died inSetupnever reached the drain at all — this fix is a prerequisite for the drain rather than a conflict.Verified on this branch: build clean,
zetaclient/tssandzetaclient/maintenancegreen, and the drain suites still green under-tags drain.This branch is what testnet signers run, and it already carries the testnet drain anchors, so a build cut from here carries both the drain and this fix.
For operators
While a finalized TSS exists, a keygen scheduled via
MsgUpdateKeygenwill not run. Rotating requires removing the current TSS first. Tracked in #4623.Greptile Summary
This backport changes signer startup to derive its p2p whitelist from the finalized TSS, skip unnecessary keygen ceremonies, remove keygen-record restart monitoring, and retry startup RPC queries.
Confidence Score: 4/5
The PR should not merge until GetTSS query failures stop being treated as TSS absence, because that can strand an otherwise usable signer in a pending or failed keygen ceremony.
The new fallback loses the distinction between an unavailable TSS query and an absent TSS, allowing a transient RPC failure to override finalized-key detection and select the wrong startup path.
Files Needing Attention: zetaclient/tss/setup.go
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Setup starts] --> B[Fetch keygen record] B --> C[Fetch current TSS with retries] C -->|Success with pubkey| D[Whitelist TSS participants] D --> E[Skip keygen ceremony] C -->|Retries exhausted| F[Replace current TSS with empty value] F --> G[Whitelist keygen grantees] G --> H[Mark key as not finalized] H --> I[Enter KeygenCeremony] I -->|Pending or failed record| J[Wait, retry, or run unintended keygen] I -->|Successful record| K[No-op and continue startup]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(zetaclient): keep signing when the k..." | Re-trigger Greptile