Skip to content

[guardian-hardening][watcher] make WithdrawalSignedEvent applies idempotent#570

Merged
0xsiddharthks merged 3 commits into
mainfrom
siddharth/watcher-dedup-signed-events
May 28, 2026
Merged

[guardian-hardening][watcher] make WithdrawalSignedEvent applies idempotent#570
0xsiddharthks merged 3 commits into
mainfrom
siddharth/watcher-dedup-signed-events

Conversation

@0xsiddharthks
Copy link
Copy Markdown
Contributor

@0xsiddharthks 0xsiddharthks commented May 19, 2026

Sui's SubscribeCheckpoints can redeliver a checkpoint, which can cause a sequence drift between the local-limiter and the guardian.

so we are making the WithdrawalSignedEvent applies idempotent in the watcher.

Changes:

  • Gate the apply on txn.signatures.is_none()
    • the first apply sets it, so duplicates are skipped
  • Add a new metric guardian_limiter_anchor_events_skipped_total to track skipped events

@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from 4acf0ae to 6bfd737 Compare May 19, 2026 18:08
@0xsiddharthks 0xsiddharthks changed the title [watcher] dedup WithdrawalSignedEvent applies via signatures.is_some() [guardian-hardening][watcher] dedup WithdrawalSignedEvent applies via signatures.is_some() May 19, 2026
@0xsiddharthks 0xsiddharthks marked this pull request as ready for review May 19, 2026 18:11
@0xsiddharthks 0xsiddharthks requested a review from bmwill as a code owner May 19, 2026 18:11
@0xsiddharthks 0xsiddharthks changed the title [guardian-hardening][watcher] dedup WithdrawalSignedEvent applies via signatures.is_some() [guardian-hardening][watcher] dedup WithdrawalSignedEvent applies from checkpoint subscription May 19, 2026
@0xsiddharthks 0xsiddharthks marked this pull request as draft May 19, 2026 18:24
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from 6bfd737 to c6dd36e Compare May 20, 2026 19:20
@0xsiddharthks 0xsiddharthks changed the base branch from main to siddharth/guardian-committee-handoff May 20, 2026 19:20
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/guardian-committee-handoff branch from db82103 to 7d1e4c9 Compare May 20, 2026 20:54
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from c6dd36e to 585d572 Compare May 20, 2026 20:54
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/guardian-committee-handoff branch from 7d1e4c9 to d6e7673 Compare May 27, 2026 06:21
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from 585d572 to efd99f9 Compare May 27, 2026 06:21
@0xsiddharthks 0xsiddharthks changed the title [guardian-hardening][watcher] dedup WithdrawalSignedEvent applies from checkpoint subscription [guardian-hardening][watcher] make WithdrawalSignedEvent applies idempotent May 27, 2026
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/guardian-committee-handoff branch from 7d8b386 to 3043f68 Compare May 27, 2026 11:54
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from 6ef4a4b to f199c45 Compare May 27, 2026 11:54
@0xsiddharthks 0xsiddharthks changed the base branch from siddharth/guardian-committee-handoff to main May 27, 2026 13:18
@0xsiddharthks 0xsiddharthks changed the base branch from main to siddharth/guardian-committee-handoff May 27, 2026 13:18
@0xsiddharthks 0xsiddharthks marked this pull request as ready for review May 27, 2026 15:21
@0xsiddharthks 0xsiddharthks requested a review from mskd12 May 27, 2026 15:22
Sui's SubscribeCheckpoints stream can redeliver a checkpoint, which made
every pod's watcher apply the same WithdrawalSignedEvent twice — the
second apply correctly hit InsufficientCapacity but tripped the sticky
guardian_limiter_drifted bit even though the local limiter was still in
lockstep with the guardian. Gate the apply on signatures.is_some(); the
same gate also skips historical events that the bootstrap snapshot
already counted via GetGuardianInfo's next_seq.
Replace 4-line block with a 1-line comment to match the rest of the file.
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/guardian-committee-handoff branch from ab1cc55 to 55cfd4d Compare May 28, 2026 14:18
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/watcher-dedup-signed-events branch from 4faa6a1 to e34f586 Compare May 28, 2026 14:35
@0xsiddharthks 0xsiddharthks changed the base branch from siddharth/guardian-committee-handoff to main May 28, 2026 14:36
@0xsiddharthks 0xsiddharthks merged commit 58be14d into main May 28, 2026
5 checks passed
@0xsiddharthks 0xsiddharthks deleted the siddharth/watcher-dedup-signed-events branch May 28, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants