Repository navigation
fix: send and decode sequences above 2^63-1 - #17
Merged
Merged
Conversation
Sequences are uint64, but the spec gives integers no format, so the generated client took path sequences as int and decoded sequence fields as int64. Governance sequences are random uint64, so many are above 2^63-1: the explorer methods refused them ("exceeds path integer range"), the guardian client wrapped them negative (server 400), and a JSON number such as 18220114619187442754 could not decode. Patch rule 42 types every sequence path parameter and integer sequence property as uint64; the hand-written range checks and conversions go.
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.
Summary
Sequences are uint64, but the served spec gives integers no format. The generated client therefore took path sequences as
intand decodedsequencefields asint64. Governance sequences are random uint64, so many are above 2^63-1, and they failed in three ways:GetVAA, observations, operations, relays, global tx) refused them with "exceeds path integer range";guardianmethods (GetSignedVAA,GetSignedBatchVAA,IsVAAEnqueued) wrapped them negative, and the server answered400 MALFORMED SEQUENCE NUMBER;"sequence":18220114619187442754could not decode intoint64.The server is fine:
GET /api/v1/vaas/1/0000…0004/18220114619187442754and/api/v1/observations/…with the same id answer 200.Changes:
api/spec/patch.jqrule 42: everyseq/sequencepath parameter and every integersequenceproperty isuint64. Rules 7 and 31 now sayuint64too.api/api.gen.gois regenerated.pathSequence,sequenceParam,vaaIDPath) and the int→uint64 sequence conversions are removed;VAAID.Sequencegoes straight into the path.1/0000…0004/18220114619187442754(the Core upgrade to guardian set 5):GetVAA,ListObservationsByVAAandguardian.GetSignedVAAeach send the decimal sequence in the path and decode it back.The root package's API is unchanged. Generated
apimethod signatures changeint→uint64for sequence parameters, andapisequence fields change from*int64/*intto*uint64.Needed by wormhole-foundation/wormctl#15 (
vaa traceon governance messages).Verification
moon exec --ignore-ci-checks root:checkpasses, includinggen-check.origin/mainfail withsequence 18220114619187442754: exceeds path integer range(explorer) and a wrong path (guardian). With this branch they pass.replaceonly), on live Wormholescan: