Skip to content

fix(celo): map cip64 and deposit transaction types in blocks - #5546

Merged
jxom merged 1 commit into
wevm:mainfrom
gomesalexandre:fix_celo_block_tx_types
Nov 16, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
gomesalexandre:fix_celo_block_tx_types

Conversation

@gomesalexandre

Copy link
Copy Markdown
Contributor

On Celo, getBlock({ includeTransactions: true }) returns CIP-64 and deposit transactions with type: undefined, and deposits keep mint as a raw hex string. getTransaction on the same hash gives type: 'cip64' / type: 'deposit' and mint: 0n, so the two paths disagree on the same tx. CeloBlock already types its transactions as CeloTransaction (which includes the CIP-64 and deposit variants), so the runtime value didn't match the declared type.

The Celo block formatter runs plain formatTransaction (its type table stops at 0x4) and only adds gatewayFee / feeCurrency, so the Celo type mapping in the transaction formatter never runs for block transactions. The OP Stack and zkSync block formatters already map their own types inline. This one now does the same: 0x7e gets isSystemTx, mint, sourceHash and type: 'deposit' (and no fee currency keys, same as getTransaction), 0x7b gets cip64, 0x7c gets cip42. Output for 0x0-0x4 transactions is unchanged.

Live getBlock on Celo mainnet (block 82961459 via celo-rpc.publicnode.com, includeTransactions: true), typeHex -> type counts:

main:   {"0x7e->undefined":1,"0x7b->undefined":5}   deposit mint: "0x0" (string)
branch: {"0x7e->deposit":1,"0x7b->cip64":5}         deposit mint: 0n (same as getTransaction)

The new test in src/celo/formatters.test.ts uses a real deposit and a real CIP-64 tx from Celo block 82961459 and fails on main (type: undefined twice, mint: "0x0"). One thing to flag: src/celo/** is excluded from the core vitest project and no other project picks it up, so I ran the file with a scratch config.

🤖 Generated with Claude Code

The Celo block formatter ran plain formatTransaction and only added
gatewayFee/feeCurrency, so getBlock with includeTransactions returned
CIP-64 and deposit transactions with `type` undefined and deposit `mint`
as a hex string, while getTransaction mapped them. Mirror the
transaction formatter for 0x7e/0x7b/0x7c, like the OP Stack and zkSync
block formatters do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

@gomesalexandre is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3cbc2e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxom
jxom merged commit ffbbc7e into wevm:main Nov 16, 2026
22 of 33 checks passed
This was referenced Nov 16, 2026
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.

2 participants