Skip to content

Pin Base to viem 2.58.10 so consumers get patched ws - #82

Merged
tzarebczan merged 23 commits into
mainfrom
fix/base-viem-ws
Dec 5, 2026
Merged

tzarebczan merged 23 commits into
mainfrom
fix/base-viem-ws

Conversation

@tzarebczan

@tzarebczan tzarebczan commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Pin @z-stack/base and the base-wallet example to viem 2.58.10. A fresh npm install of viem 2.44.4 resolves [email protected] because viem depends on that release directly. viem 2.58.10 depends on [email protected].
  • GHSA-37g9-w4hg-h9qr needs ws >= 8.23.0. The workspace ws override does not publish to consumers, so the pin has to move.
  • The release-age gate excludes exactly [email protected] (published 2026-12-04).
  • viem's legacy estimateOperatorFee now fails an HTTP 429 gas request instead of resolving a missing operator fee to 0. The strict oracle still rejects with "network is unavailable".
  • Package versions are 0.1.0-alpha.14. The archive publishes that version.

This does not close #64. A fresh install of @solana/[email protected] with @solana/[email protected] still resolves [email protected] (no patched release) and, through [email protected], [email protected] and [email protected]. [email protected] drops those two packages, but a workspace override does not replace an application's transitive tree.

Test plan

viem 2.44.4 depends on ws 8.18.3, so a fresh install of that pin still
resolves the vulnerable release. 2.58.10 depends on ws 8.23.1, which
covers GHSA-37g9-w4hg-h9qr. The release-age gate excludes that exact
version.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 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-12-05T07:38:25.687930Z 5921547 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.

viem 2.58 infers a private chain module for the frozen Base definitions.
Typing BASE_MAINNET and BASE_SEPOLIA as BaseChain keeps the published
declarations on viem's public Chain type.
@tzarebczan

Copy link
Copy Markdown
Owner Author

Declaration emit failed on viem 2.58.10 with TS2742: BASE_MAINNET and BASE_SEPOLIA inferred a private viem chain module. Both constants are now annotated as BaseChain, and packages/base/dist/network.d.ts imports Chain from viem.

pnpm --filter @z-stack/base build, pnpm --filter @z-stack/base typecheck, and pnpm test:base (226 passed) all succeeded on d1f19d3.

Declaration emit must name viem's own chain types. The sponsored flow
only needs a few public-client actions, so an older client stays
assignable when viem adds members.
viem 2.58 chain and account types do not substitute for viem 2.44, so the
public boundary exposes the fields this package calls.
deriveBaseAccount stays a wallet-client account, preset chains keep the explorer and multicall metadata, and the 7702 adapter no longer exposes one release's private-key account or drops a class signer's receiver.
Preset and frozen chains expose the explorer, testnet flag, and multicall address. Derived accounts return the key shape both viem releases share, and the smart-account declarations import a resolvable signer type.
Authorization requests reject a delegate address and a contract address together. Derived keys keep derive and deriveChild. Preset chains expose the source id and portal address. OP Stack receipt formatters stay on viem's own chain objects.
The 7702 owner converts raw message bytes to hex before signing. Derived accounts reject a numeric message and a decimal transaction value. Preset chain ids stay 8453 and 84532.
Scaffolding checks that peer on the base-only path and on --with-base. The install guide uses the archive from pnpm pack:base together with that viem release.
Named mainnet and Sepolia contracts no longer carry an optional numeric index, so a withdrawal accepts them when the L1 client is Chain. A full viem chain literal remains a valid network input. The install example quotes the packed archive name.
The base-wallet template includes the withdrawal target assertions, so the archive consumer build typechecks them against the shipped declarations.
…p domain-only requests and the block formatter.
@tzarebczan
tzarebczan merged commit 4ca1023 into main Dec 5, 2026
9 checks passed
@tzarebczan
tzarebczan deleted the fix/base-viem-ws branch December 5, 2026 17:07
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.

Triage pnpm production dependency advisories in alpha.12

1 participant