Skip to content

fix(zetaclient): keep signing when the keygen record is reset (backport v37) - #4626

Merged
kingpinXD merged 1 commit into
release/zetaclient/v37from
hotfix/zetaclient-ignore-blanked-keygen-v37
Aug 19, 2026
Merged

fix(zetaclient): keep signing when the keygen record is reset (backport v37)#4626
kingpinXD merged 1 commit into
release/zetaclient/v37from
hotfix/zetaclient-ignore-blanked-keygen-v37

Conversation

@kingpinXD

@kingpinXD kingpinXD commented Aug 14, 2026

Copy link
Copy Markdown
Member

Backport of #4618 to release/zetaclient/v37. Do not merge before #4618.

Summary

  • Whitelist p2p peers from TSS.TssParticipantList rather than the keygen record, which zetacore erases on any observer set change.
  • Skip the keygen ceremony when a TSS already exists, instead of waiting on a record scheduled for a block that never arrives.
  • Delete the keygen watcher that restarted every signer at once.
  • Retry every zetacore query on the startup path with a constant backoff, so a contended RPC during a mass restart does not kill startup.

Scope

Production code only, matching the drain backports (#4614 / #4615). Five files: zetaclient/tss/setup.go, service.go, zetaclient/maintenance/tss_listener.go and the two test files. The e2e harness, CI wiring and changelog stay on main — 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. Setup runs before startDrainIfArmed in cmd/zetaclientd/start.go, so a signer that died in Setup never reached the drain at all — this fix is a prerequisite for the drain rather than a conflict.

Verified on this branch: build clean, zetaclient/tss and zetaclient/maintenance green, and the drain suites still green under -tags drain.

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.

Greptile Summary

This backport keeps signers operational when observer-set changes reset the keygen record.

  • Derives the p2p whitelist from finalized TSS participants when available.
  • Skips key generation when a finalized TSS already exists.
  • Removes keygen-record-triggered signer restarts.
  • Retries startup-time zetacore queries with constant backoff.
  • Adds focused coverage for whitelist resolution and TSS listener behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
zetaclient/tss/setup.go Resolves peers from finalized TSS state, avoids unnecessary keygen, and retries startup queries without leaving an eligible follow-up defect.
zetaclient/tss/service.go Adds constant-backoff retrying to the startup keygen query used for metrics configuration.
zetaclient/maintenance/tss_listener.go Removes keygen-record restart monitoring while retaining TSS-address and history watchers.
zetaclient/tss/setup_test.go Covers finalized, blanked, imported, failed-query, and invalid-peer whitelist cases.
zetaclient/maintenance/tss_listener_test.go Verifies keygen records are ignored while genuine TSS changes still trigger shutdown.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start zetaclient TSS setup] --> B[Query keygen and current TSS with retries]
    B --> C{Finalized TSS exists?}
    C -->|Yes| D[Whitelist TSS participants]
    D --> E[Skip keygen ceremony]
    C -->|No| F[Whitelist keygen grantees]
    F --> G[Run keygen ceremony]
    E --> H[Start signing service]
    G --> H
    I[TSS listener] --> J{TSS address or history changes?}
    J -->|Yes| K[Restart signer]
    J -->|No| I
Loading

Reviews (2): Last reviewed commit: "fix(zetaclient): keep signing when the k..." | Re-trigger Greptile

…rt v37)

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
@kingpinXD
kingpinXD requested a review from a team as a code owner August 14, 2026 03:32
@kingpinXD kingpinXD added the no-changelog Skip changelog CI check label Aug 14, 2026
Comment thread zetaclient/tss/setup.go

@ws4charlie ws4charlie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.55102% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
zetaclient/tss/setup.go 80.85% 9 Missing ⚠️
zetaclient/tss/service.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kingpinXD
kingpinXD marked this pull request as draft August 14, 2026 04:12
@kingpinXD
kingpinXD marked this pull request as ready for review August 19, 2026 04:40
@kingpinXD
kingpinXD merged commit 11a8a39 into release/zetaclient/v37 Aug 19, 2026
48 of 51 checks passed
@kingpinXD
kingpinXD deleted the hotfix/zetaclient-ignore-blanked-keygen-v37 branch August 19, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Skip changelog CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants