Skip to content

fix: derive Tempo zone IDs for non-production source chains - #681

Open
bdchatham wants to merge 1 commit into
wevm:mainfrom
bdchatham:fix/zone-id-generic-chain-ids
Open

bdchatham wants to merge 1 commit into
wevm:mainfrom
bdchatham:fix/zone-id-generic-chain-ids

Conversation

@bdchatham

Copy link
Copy Markdown

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.

This branch has not been deployed

No deployments
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