Skip to content

fix(cctp): decode the V2 burn event, and stop expiring quotes mid-payment - #209

Merged
0xdevcollins merged 1 commit into
mainfrom
fix/cctp-v2-burn-and-quote-ttl
Aug 9, 2026
Merged

fix(cctp): decode the V2 burn event, and stop expiring quotes mid-payment#209
0xdevcollins merged 1 commit into
mainfrom
fix/cctp-v2-burn-and-quote-ttl

Conversation

@0xdevcollins

Copy link
Copy Markdown
Owner

Two separate faults, both hit paying from MetaMask on Sepolia.


1. A real, successful burn reported as "not a CCTP burn"

burn tx 0xce93dc50…c46ca1c9 not found on ethereum (or not a CCTP burn)

TOKEN_MESSENGER_V2_ABI declared DepositForBurn V1-shaped, with a leading uint64 indexed nonce. CCTP V2 does not emit that field, and one extra parameter changes the whole topic hash:

topic0
ABI as written (V1-style) 0xe3db7593…
what chains actually emit 0x0c8c1cbd…

So no log ever matched, and every EVM burn came back as "not a CCTP burn" — successful ones included.

Verified against the actual transaction (Sepolia, block 11454876, status 0x1). It now decodes to 0.01 USDC, destination domain 27 (Stellar), depositor intact. Iris had it the whole time — cctpVersion: 2, its own eventNonce, waiting on confirmations.

The nonce goes with it

V2 assigns no nonce at burn time: the on-chain MessageSent payload carries a zero placeholder (confirmed by decoding the message header), and Circle stamps the real one during attestation. So ParsedBurn.nonce is now bigint | null, and the processor prefers Iris's eventNonce, falling back to the burn's own — Stellar still surfaces one. cctpNonce keeps getting populated instead of quietly becoming a column of nulls.

Diagnosability

The two null paths in parseBurnReceipt shared one message that led with "not found", so a real burn that merely failed to decode sent you auditing RPC config instead of the ABI. Each now logs what it actually saw, and the no-match case names the topic it wanted.


2. Quotes expiring during the payment they were quoted for

The TTL was 30 seconds for everything. A wallet payment is read-quote → approve (a transaction, mined) → burn — comfortably longer than 30s on a busy testnet, so the quote died mid-flow and the payer got an error for doing nothing wrong.

30 seconds prices in rate risk. That risk is real across assets and absent within one: USDC → USDC quotes at exactly 1 now and in ten minutes, and the only other variable is a fixed bps of the merchant's own config.

Same-asset quotes now get 600s; anything cross-asset keeps 30. Live check: the crypto path went from expiresInSeconds: 29 to 599.


Verification

  • Burn parse run through the compiled client against the real tx — decodes correctly.
  • select-crypto live: quote window 599s, chainId: 11155111, Sepolia USDC.
  • Tests: 303 (+6). The burn spec is pinned to the real Sepolia log and imports the client's own ABI rather than a copy — reverting the ABI fails all three of its cases, which I checked rather than assumed.
  • 0 lint errors.

…ment

Two separate faults, both hit while paying from MetaMask on Sepolia.

## "not found on ethereum (or not a CCTP burn)" for a real, successful burn

`TOKEN_MESSENGER_V2_ABI` declared `DepositForBurn` V1-shaped, with a leading
`uint64 indexed nonce`. CCTP V2 does not emit that field. One extra parameter
changes the whole topic hash — 0xe3db7593… instead of the 0x0c8c1cbd… chains
actually log — so no receipt ever matched and every EVM burn was reported as
"not a CCTP burn". Successful ones included.

Verified against tx 0xce93dc50…c46ca1c9 on Sepolia (block 11454876, status
0x1): it now decodes to 0.01 USDC, destination domain 27 (Stellar), with the
depositor intact. Iris had the burn all along — cctpVersion 2, its own
eventNonce, waiting on confirmations.

The nonce goes with it. V2 assigns no nonce at burn time: the on-chain
MessageSent payload carries a zero placeholder, and Circle stamps the real one
during attestation. `ParsedBurn.nonce` is `bigint | null` accordingly, and the
processor now prefers Iris's `eventNonce`, falling back to the burn's own —
Stellar still surfaces one — so `cctpNonce` keeps being populated rather than
quietly becoming a column of nulls.

Also split the two null paths in `parseBurnReceipt`. They shared one message
that led with "not found", so a real burn that merely failed to decode sent you
auditing RPC config instead of the ABI. Each now logs what it actually saw, and
the no-match case names the topic it wanted.

## Quotes expiring during the payment they were quoted for

The TTL was 30 seconds for everything. A wallet payment is read-quote, approve
(a transaction, mined), then burn — comfortably longer than that on a busy
testnet, so the quote died mid-flow and the payer got an error for doing
nothing wrong.

30 seconds prices in rate risk. That risk is real across assets and absent
within one: USDC → USDC quotes at exactly 1 now and in ten minutes, and the
only other variable is a fixed bps of the merchant's own config. Same-asset
quotes now get 600s; anything cross-asset keeps 30.

Tests: 303 (+6). The burn spec is pinned to the real Sepolia log and imports
the client's own ABI rather than a copy — reverting the ABI fails all three of
its cases, which was checked rather than assumed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
useroutr-www Ready Ready Preview Aug 9, 2026 10:23pm

@0xdevcollins
0xdevcollins merged commit 14d1616 into main Aug 9, 2026
8 checks passed
@0xdevcollins
0xdevcollins deleted the fix/cctp-v2-burn-and-quote-ttl branch August 9, 2026 22:44
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