Skip to content

perf: use literal ABIs for deployless calls in call - #5511

Merged
jxom merged 1 commit into
wevm:mainfrom
backseats:perf/call-literal-abis
Nov 15, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
backseats:perf/call-literal-abis

Conversation

@backseats

Copy link
Copy Markdown
Contributor

Summary

call.ts builds two constructor ABIs for deployless calls with parseAbi at runtime:

parseAbi(['constructor(bytes, bytes)'])
parseAbi(['constructor(address, bytes, address, bytes)'])

Because call is on every read path, this pulls abitype's human-readable ABI parser into any bundle that reads contracts, even when the app never uses parseAbi or deployless calls. This replaces both with the literal ABIs that parseAbi returns for those signatures (checked by printing its output), so behavior is unchanged.

Bundle size

A tree-shaken read path (createClient, http, readContract from viem/actions), bundled with esbuild (minify, ESM, browser) against the published 2.57.19 build, with call.js patched the same way:

Minified Gzipped
Before 121,648 B 36,453 B
After 109,228 B 33,280 B

That is −12.4 KB minified and −3.2 KB gzipped for any app that reads contracts and doesn't import parseAbi itself.

Tests

  • pnpm test --run src/actions/public/{call,readContract,simulateContract}.test.ts: 120 passed, 8 skipped. The deployless code and factory paths are covered in call.test.ts.
  • Two tests fail locally both with and without this change (call > errors > gas fee is less than block base fee, simulateContract > node errors > fee cap too low), so they are environment-related, not from this change.
  • tsc -b and Biome are clean.

@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: aedff22

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

@jxom
jxom merged commit 5f60d1d into wevm:main Nov 15, 2026
45 of 60 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 15, 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.

2 participants