Skip to content

fix(tempo): return the zero commitment from getConfigCommitment on chains without the precompile - #5497

Merged
jxom merged 2 commits into
mainfrom
fix/tempo-config-commitment-zero-data
Nov 12, 2026
Merged

jxom merged 2 commits into
mainfrom
fix/tempo-config-commitment-zero-data

Conversation

@jxom

@jxom jxom commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Actions.accounts.getConfigCommitment rejected on every chain without the configurable account precompile (0xAACC000000000000000000000000000000000000). It now returns the zero commitment there. Requested by @jxom.

Problem

Tempo mainnet (4217), Moderato (42431), and devnet (31318) hold no code at the precompile, so the eth_call answers 0x and the action rejected with ContractFunctionExecutionError caused by ContractFunctionZeroDataError. A caller that reads the commitment before it trusts a root key's signature had to handle that error itself (tempoxyz/accounts2#313 does).

import { createClient, http } from 'viem'
import { tempoModerato } from 'viem/chains'
import { Actions } from 'viem/tempo'

const client = createClient({ chain: tempoModerato, transport: http() })
await Actions.accounts.getConfigCommitment(client, {
  account: '0x0000000000000000000000000000000000000001',
})
// before: rejects with ContractFunctionExecutionError
// after:  0x0000000000000000000000000000000000000000000000000000000000000000

Change

The action catches a ContractFunctionExecutionError whose cause is ContractFunctionZeroDataError and returns zeroHash, the same check getEip712Domain uses. Every other failure (revert, transport error, unknown block) still rejects.

Why Zero

  • The TSDoc already says the action returns zero when no config has been committed, and TIP-1113 defines zero as "no config". A chain without the precompile cannot hold a commitment, so zero is the true answer for every account on it.
  • It needs no change when T14 activates on a chain: the precompile then answers and the action returns what it says.
  • I did not gate on chain.hardfork. The chain definitions carry a static value that goes stale at activation, and a client without a chain would have no answer.
  • Returning null or undefined would change the return type and make every caller branch on a third state.

Tradeoffs for Review

  • Zero no longer tells "no precompile" apart from "no commitment". A caller that reads a zero commitment as "this account can be upgraded" (the canMigrate check in the migrate guide) reads true on a chain where the upgrade is not available yet. The upgrade itself still fails there.
  • The relay's account_getConfig handler and validateConfig (src/tempo/internal/relay/accounts.ts) call this action, so on such a chain they now see a zero commitment instead of an error.
  • getConfigCommitment.call is unchanged, so a multicall or a direct readContract with it still gets the zero-data failure.

Verification

  • src/tempo/actions/accounts.test.ts is new. behavior: chain without the precompile runs on a T13 node (the T13 job of the Tempo matrix; it is skipped where the precompile exists). It fails without the change with the zero-data error and passes with it. error: failed read checks on every hardfork that an unknown block still rejects.
  • Ran against the public RPCs of mainnet, Moderato, and devnet: all three rejected before the change and return the zero hash after it.
  • Tempo tests of actions/accounts.test.ts and actions/accounts.accounts.test.ts pass on the default node (ghcr.io/tempoxyz/tempo:latest); tsc -b of src and test and Biome are clean; the viem/chains size limits pass locally (import * from 'viem/chains' is 136,494 B of 136.5 kB).

Not run locally: the full test suite, pnpm bench:types, and pnpm docs:build.

#5498 depends on this change.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
viem Error Error Nov 12, 2026 4:43am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 02cc290

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T04:40:58.592844Z 02cc290 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7e6cabe14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tempo/actions/accounts.test.ts Outdated
configurableAccounts,
getClient,
} from '~test/tempo/config.js'
import * as actions from './index.js'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Import the tested action through its public package entrypoint

These tests exercise the public getConfigCommitment API, but import it through the relative actions barrel. The repository explicitly requires public-surface tests to use package entrypoints, reserving relative imports for internal or non-exported members. Import Actions from viem/tempo instead so the regression tests exercise the supported public surface.

AGENTS.md reference: AGENTS.md:L188-L192

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 02cc290: the tests import Actions from viem/tempo.


const client = getClient()

describe('getConfigCommitment', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the primary export tests at the top level

This new file tests only getConfigCommitment, so wrapping every test in a top-level describe conflicts with the repository's explicit requirement to put primary-export tests at the top level and reserve describe for nested scenarios or multiple distinct exports. Remove this wrapper and retain the individual test cases at file scope.

AGENTS.md reference: AGENTS.md:L199-L202

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept as is. accounts.ts exports many actions and this file covers one of them, so the describe names the action under test and does not echo the file. The sibling accounts.accounts.test.ts uses one describe per action the same way, and AGENTS.md allows describe to separate distinct exports. Without it the tests would read behavior: chain without the precompile with no action name.

@jxom
jxom merged commit 08a463a into main Nov 12, 2026
39 of 40 checks passed
@jxom
jxom deleted the fix/tempo-config-commitment-zero-data branch November 12, 2026 04:44

This branch had an error being deployed

1 failed deployment
Preview — 02cc290e Deployed Nov 12, 2026 by vercel[bot]
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