Skip to content

feat: batch matching stateOverrides in call#4337

Merged
jxom merged 4 commits into
wevm:mainfrom
haydenshively:main
May 17, 2026
Merged

feat: batch matching stateOverrides in call#4337
jxom merged 4 commits into
wevm:mainfrom
haydenshively:main

Conversation

@haydenshively
Copy link
Copy Markdown
Contributor

When client.batch.multicall is enabled, call() skips batching entirely for any call that includes a stateOverride. However, the downstream multicall action already supports forwarding stateOverride to eth_call, so there's no fundamental reason calls sharing the same stateOverride can't be batched together.

This PR removes the blanket !rpcStateOverride guard and instead groups batched calls by their serialized stateOverride value. Calls with the same override batch together; calls with different overrides (or no override) go to separate batches. The stateOverride is then forwarded as the third param in the batched eth_call.

Changes:

  • Removed the !rpcStateOverride check that prevented all state-overridden calls from batching
  • Forward rpcStateOverride through scheduleMulticall and include it in the batched eth_call params
  • Include JSON.stringify(rpcStateOverride) in the batch scheduler ID so calls are grouped by identical overrides
  • Added test covering same-override batching and different-override separation

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 12, 2026

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

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 1271756

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

@haydenshively
Copy link
Copy Markdown
Contributor Author

@jxom is there anything I can do to help get this merged?

@jxom jxom force-pushed the main branch 2 times, most recently from bdf8494 to 69e0d6e Compare March 13, 2026 22:42
@haydenshively
Copy link
Copy Markdown
Contributor Author

bump, how can I help?

@spennyp
Copy link
Copy Markdown

spennyp commented Apr 8, 2026

+1 would be great for this to be supported

@jxom jxom merged commit fd2fbd5 into wevm:main May 17, 2026
16 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request May 17, 2026
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