[guardian-hardening][watcher] make WithdrawalSignedEvent applies idempotent#570
Merged
Merged
Conversation
4acf0ae to
6bfd737
Compare
6bfd737 to
c6dd36e
Compare
db82103 to
7d1e4c9
Compare
c6dd36e to
585d572
Compare
7d1e4c9 to
d6e7673
Compare
585d572 to
efd99f9
Compare
7d8b386 to
3043f68
Compare
6ef4a4b to
f199c45
Compare
bmwill
approved these changes
May 27, 2026
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.
ab1cc55 to
55cfd4d
Compare
4faa6a1 to
e34f586
Compare
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.
Sui's
SubscribeCheckpointscan redeliver a checkpoint, which can cause a sequence drift between the local-limiter and the guardian.so we are making the
WithdrawalSignedEventapplies idempotent in the watcher.Changes:
txn.signatures.is_none()guardian_limiter_anchor_events_skipped_totalto track skipped events