Skip to content

fix(account-abstraction): keep falsy per-operation paymasterContext over the client default - #5431

Merged
jxom merged 1 commit into
mainfrom
fix/paymaster-context-presence
Nov 6, 2026
Merged

jxom merged 1 commit into
mainfrom
fix/paymaster-context-presence

Conversation

@jxom

@jxom jxom commented Nov 6, 2026

Copy link
Copy Markdown
Member

Fixes #5418. Supersedes #5421 (thanks @saravanan619, credited as co-author).

prepareUserOperation chose between the per-operation paymasterContext and the bundler client's default with a truthiness check. Because the option is typed unknown, an explicit false, 0, '' or null was silently replaced by the client default, or became undefined if there was no default. It now checks for undefined instead, so the client default applies only when the per-operation option is omitted.

Changes compared with #5421:

  • The regression test now sits in the existing prepareUserOperation.test.ts alongside the other paymasterContext tests, instead of a new sibling file. It uses a function paymaster that echoes the context it receives, so it doesn't need a hand-rolled HTTP server, and it checks all values with one aggregated inline snapshot (undefined, false, 0, '', null).
  • The changeset also covers null, which now overrides the client default as well.

Attention for reviewers

  • test/vitest.config.ts excludes src/account-abstraction/** from every Vitest project, so CI does not run this test, or any account-abstraction test. That is a separate problem from this fix.
  • I checked the test body outside the anvil/bundler harness, using an offline smart account and the same assertions: it passes with the fix, and the snapshot fails on main's prepareUserOperation.ts. I could not run the full anvil + alto suite here.
  • tsc -p src/tsconfig.json reports 11 errors in src/tempo/** (userAddress). The same 11 errors appear on unmodified main in this environment, which has a stale node_modules; main's lockfile currently fails --frozen-lockfile. None of the errors are in changed files. Biome is clean.

Generated by Claude Code

…ver the client default

`prepareUserOperation` chose between the per-operation `paymasterContext`
and the bundler client default with a truthiness check, so `false`, `0`,
`''`, and `null` were replaced by the default. Only `undefined` now falls
back to the client default.

Fixes #5418. Supersedes #5421.

Co-authored-by: Saravanan <76141249+saravanan619@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3nmWjV2LuSbn2SFpBG1hn
@vercel

vercel Bot commented Nov 6, 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 6, 2026 6:06am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f94fba2

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 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T06:07:51.325752Z f94fba2 PR opened
ℹ️ 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.

@jxom
jxom merged commit 8b040a3 into main Nov 6, 2026
12 of 39 checks passed
@jxom
jxom deleted the fix/paymaster-context-presence branch November 6, 2026 06:08

This branch had an error being deployed

1 failed deployment
Preview — f94fba26 Deployed Nov 6, 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.

Falsy per-operation paymasterContext is silently replaced by the bundler client default

2 participants