Skip to content

fix: send and decode sequences above 2^63-1 - #17

Merged
jmgilman merged 2 commits into
mainfrom
fix/uint64-sequence
Oct 7, 2026
Merged

jmgilman merged 2 commits into
mainfrom
fix/uint64-sequence

Conversation

@jmgilman

@jmgilman jmgilman commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Sequences are uint64, but the served spec gives integers no format. The generated client therefore took path sequences as int and decoded sequence fields as int64. Governance sequences are random uint64, so many are above 2^63-1, and they failed in three ways:

  • explorer methods (GetVAA, observations, operations, relays, global tx) refused them with "exceeds path integer range";
  • guardian methods (GetSignedVAA, GetSignedBatchVAA, IsVAAEnqueued) wrapped them negative, and the server answered 400 MALFORMED SEQUENCE NUMBER;
  • a JSON number such as "sequence":18220114619187442754 could not decode into int64.

The server is fine: GET /api/v1/vaas/1/0000…0004/18220114619187442754 and /api/v1/observations/… with the same id answer 200.

Changes:

  • api/spec/patch.jq rule 42: every seq/sequence path parameter and every integer sequence property is uint64. Rules 7 and 31 now say uint64 too. api/api.gen.go is regenerated.
  • The hand-written range checks (pathSequence, sequenceParam, vaaIDPath) and the int→uint64 sequence conversions are removed; VAAID.Sequence goes straight into the path.
  • Tests use live responses for 1/0000…0004/18220114619187442754 (the Core upgrade to guardian set 5): GetVAA, ListObservationsByVAA and guardian.GetSignedVAA each send the decimal sequence in the path and decode it back.

The root package's API is unchanged. Generated api method signatures change int → uint64 for sequence parameters, and api sequence fields change from *int64/*int to *uint64.

Needed by wormhole-foundation/wormctl#15 (vaa trace on governance messages).

Verification

  • moon exec --ignore-ci-checks root:check passes, including gen-check.
  • The new tests run against origin/main fail with sequence 18220114619187442754: exceeds path integer range (explorer) and a wrong path (guardian). With this branch they pass.
  • wormctl built against this branch (local replace only), on live Wormholescan:
$ wormctl vaa trace 1/0000000000000000000000000000000000000000000000000000000000000004/18220114619187442754
signed VAA │ cleared │ signed VAA is available: module Core, action 2, target chain 0 (all chains)
signatures │ cleared │ 13 guardians of set 4 signed: RockawayX, Staked, ChainodeTech, Inotel, 0x11b397…5e2343, …
Governance proposal: the signed VAA is available

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.
@jmgilman
jmgilman merged commit a6577aa into main Oct 7, 2026
2 checks passed
@jmgilman
jmgilman deleted the fix/uint64-sequence branch October 7, 2026 21:26
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.

1 participant