Skip to content

fix(0.x): derive Tempo zone IDs for non-production source chains - #682

Merged
jxom merged 1 commit into
wevm:0.xfrom
bdchatham:fix/zone-id-generic-chain-ids-0x
Nov 15, 2026
Merged

jxom merged 1 commit into
wevm:0.xfrom
bdchatham:fix/zone-id-generic-chain-ids-0x

Conversation

@bdchatham

Copy link
Copy Markdown
Contributor

Tempo zone chain IDs for mainnet (4217) and Moderato (42431) use a base offset, but zones of other Tempo chains (devnets, local networks) carry the source chain ID in the high 32 bits: chainId = sourceChainId * 2^32 + zoneId (see zone_chain_id in https://github.com/tempoxyz/tempo/blob/main/crates/zones/primitives/src/constants.rs).

ZoneId.fromChainId subtracted the mainnet base from those IDs, so viem's signAuthorizationToken, which derives the zone ID from chain.id, produced an out-of-range zone ID and threw ("Number ... is not in safe 32-bit unsigned integer range").

This returns the low 32 bits for chain IDs at or above 2^32. Mainnet and Moderato ranges and toChainId are unchanged.

Tested: pnpm test --project tempo-unit src/tempo/ZoneId, lint/format, and type checks.

@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@jxom
jxom merged commit 4c0eb9f into wevm:0.x Nov 15, 2026
2 of 3 checks passed
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