fix: F-2026-18191 | [Dual Defense] Byzantine TSS Coordinator Can Freeze Outbound Withdrawals via Gap Nonce - #306
Merged
Merged
Conversation
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.
F-2026-18191 Gap-nonce freeze by a byzantine coordinator
Problem
req.Nonce < finalizedNonce. No upper bound.What I did
checkNonceInRangeandnonceBounds, used byverifyOutboundSigningRequestandverifyFundMigrationSigningRequest.finalized <= assigned <= pending + 2*PerChainCap.finalizedas the lower bound, since it is consensus stable and followers do not diverge on it.finalized, and the ceiling base is clamped up tofinalized, so a stale pending read cannot widen the window.Why the ceiling uses pending, not finalized
GetInFlightSignEventscounts onlyIN_PROGRESSandSIGNED. ABROADCASTEDevent stops counting towardPerChainCapbut still holds a mempool nonce.PerChainCapper poll andpending - finalizedgrows without bound.finalizedwould reject honest coordinators during a stall. Pending tracks congestion on its own and is real chain state an attacker cannot inflate.Tests
TestCheckNonceInRange: accepts equal to finalized, within cap, at the gap limit, congestion (pending = finalized + 500), and nonce 0 on SVM. Rejects below finalized, one past the limit,finalized + 2^32when congested, and a stale ceiling base below finalized.TestNonceBounds: pending above finalized becomes the base; pending failure and pending below finalized fall back to finalized; finalized failure errors so the caller skips.Deliberately not added
With the gap nonce rejected at verify, none of these recovery paths are needed for this vector.