Skip to content

feat(tempo): default channel salt to configurable signer commitment - #5545

Merged
jxom merged 3 commits into
mainfrom
feat/tip-1166-configurable-vouchers
Nov 17, 2026
Merged

jxom merged 3 commits into
mainfrom
feat/tip-1166-configurable-vouchers

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

Client-side support in viem/tempo channels for TIP-1166 (configurable account voucher signers for the TIP-1034 channel reserve, activating at T15).

  • ABI: tip20ChannelReserve gains the SignerSnapshotCached(bytes32 indexed channelId, address indexed signer, bytes32 commitment) event and the SignerConfigChanged(address signer) and SaltNotSignerCommitment(address signer, bytes32 commitment) errors. Both errors are also in coreErrors, with messages and hints in ExecutionError.
  • channel.open / channel.openSync: when salt is omitted and the voucher signer (authorizedSigner, else the acting account) is a configurable account (Account.fromConfig), the salt defaults to the signer's config commitment if it is nonzero, read with accounts.getConfigCommitment. Otherwise the salt is Hex.random(32), as it is today. authorizedSigner now also accepts an Account, so a configurable signer can be passed directly.
  • channel.getOpenSalt(client, { signer }) (new): returns the signer's nonzero commitment, else a random 32-byte salt. Use it when the signer is known only by address, or with channel.open.call.
  • channel.open.call makes no RPC calls, so callers pass salt there. This is now in its docs.
  • Typed errors: ChannelSaltNotSignerCommitmentError (open) and ChannelSignerConfigChangedError (topUp after the signer's config changed; the fix is to close and reopen, which is not done automatically). Both are added to channel.ExecutionErrorType.
  • Docs: a new channel.getOpenSalt page, a "Configurable Account Signers" section in channel.open, and a sidebar entry. Changeset included.

Why

From T15, when a channel's voucher signer has a nonzero configurable-account commitment, the salt must equal that commitment, or open reverts with SaltNotSignerCommitment. A topUp after the signer's config changes reverts with SignerConfigChanged. Protocol change: tempoxyz/tempo#9293. TIP text: tempoxyz/tempo#9133.

Backward compatibility

Every change adds something new, and the defaults behave as before:

  • Accounts that are not configurable, and signers passed as a plain address, still get a random salt. No extra RPC call is made.
  • An explicit salt always wins.
  • A zero authorizedSigner still means the payer signs.
  • open.call is unchanged.

The new salt default only matters once tempoxyz/tempo#9293 lands for T15. Before then, configurable accounts read a zero commitment (or the precompile is absent), so they fall back to a random salt.

Tests

  • New src/tempo/actions/channel.salt.test.ts (13 unit tests on a mocked transport). It covers getOpenSalt with a nonzero commitment, a zero commitment and a missing precompile. It checks that open keeps the defaults (random salt, no extra read) for regular accounts and address signers, that a configurable signer's salt defaults to its commitment, that a zero commitment falls back to random, that an explicit salt wins, that a zero authorizedSigner still means the payer, and that open.call stays pure. It also checks that SaltNotSignerCommitment and SignerConfigChanged reverts decode to the typed errors.
  • Ran vitest on channel.salt.test.ts, ExecutionError.test.ts, Selectors.test.ts and Abis.test.ts (87 passed), scripts/checkTempoErrors.ts, biome check, tsc -p src/tsconfig.json, and a tsc check of the new test file.
  • Not run: the tempo e2e suites, which need a live node.

Adds client-side support for TIP-1166 (configurable account voucher signers for the TIP-1034 channel reserve) to viem/tempo channels.\n\n- ABI: SignerSnapshotCached event, SignerConfigChanged and SaltNotSignerCommitment errors on tip20ChannelReserve (and coreErrors), with messages and hints.\n- channel.open / openSync: when salt is omitted and the voucher signer (authorizedSigner, else the account) is a configurable account, salt defaults to its nonzero config commitment; otherwise random as before. authorizedSigner also accepts an Account.\n- channel.getOpenSalt: returns the signer's nonzero commitment, else a random 32-byte salt.\n- Typed ChannelSaltNotSignerCommitmentError and ChannelSignerConfigChangedError.\n- open.call stays pure (no RPC); callers pass salt there.
@vercel

vercel Bot commented Nov 16, 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 16, 2026 10:47pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-16T22:46:22.635525Z 97273d2 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.

@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 97273d2

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 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: 5cafd35ae4

ℹ️ 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/channel.salt.test.ts Outdated
Comment on lines +43 to +47
transport: custom({
async request(request: Request) {
requests.push(request)
if (request.method === 'eth_chainId') return toHex(chain.id)
if (request.method === 'eth_call') {

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 Replace the mocked transport with real chain coverage

The new salt suite uses a fake client transport that fabricates commitment reads, transaction hashes, and reverts, so none of these tests exercise the channel reserve's actual commitment enforcement. This directly violates the root AGENTS.md prohibition on mocks, stubs, and fake clients. Replace this helper with tests against the configured Tempo test chain, initializing configurable signers and asserting actual channel outcomes and reverts.

AGENTS.md reference: AGENTS.md:L155-L158

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Published [email protected] under the pr-5545 dist-tag, which follows this pull request until it closes.

pnpm add viem@pr-5545
pnpm add [email protected]

…keys

An access key signs as its parent account, which can be a configurable
account, so channel.open now reads the parent's commitment for access key
signers too. Points the SaltNotSignerCommitment hint at channel.getOpenSalt,
documents the salt default on openSync and the decorator, and aligns the
channel.getOpenSalt page with the action page layout.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1e539-38a8-772b-bb1c-b71e34a5bd2e
Co-authored-by: jxom <[email protected]>

@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: 97273d2864

ℹ️ 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 on lines +28 to +29
const signerSnapshots =
Number(/^T(\d+)$/.exec(import.meta.env.VITE_TEMPO_HARDFORK ?? '')?.[1]) >= 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enable signer snapshot tests for Tnext and default local runs

When VITE_TEMPO_HARDFORK is Tnext or unset, this expression evaluates to false, skipping all six tests covering registered configurable signers, access keys, initial registration, and the new reserve errors. The test-tempo job in .github/workflows/verify.yml only runs T13 and Tnext; test/vitest.config.ts excludes this entire file on T13, so none of those tests execute in CI. Treat Tnext and the unset default as the latest fork, consistent with the existing test harness, while retaining the numeric version check for explicitly pinned forks.

Useful? React with 👍 / 👎.

@jxom
jxom merged commit 0764641 into main Nov 17, 2026
33 of 38 checks passed
@jxom
jxom deleted the feat/tip-1166-configurable-vouchers branch November 17, 2026 00:18
This was referenced Nov 17, 2026

This branch had an error being deployed

1 failed deployment
Preview — 97273d28 Deployed Nov 16, 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.

3 participants