Skip to content

fix(sei-global-wallet): follow Dynamic's viem peer to 2.57.19 - #362

Merged
alexander-sei merged 1 commit into
mainfrom
fix/sei-global-wallet-viem-peer-drift
Nov 12, 2026
Merged

alexander-sei merged 1 commit into
mainfrom
fix/sei-global-wallet-viem-peer-drift

Conversation

@alexander-sei

Copy link
Copy Markdown
Collaborator

Fixes the scheduled Sei Global Wallet Consumer Smoke failure, which has been red since November 4. Dynamic published @dynamic-labs/[email protected] on November 3, inside our ^4.96.3 range, and raised the viem peer of the client and of @dynamic-labs/ethereum-aa from ^2.45.3 to ^2.54.2. The verifier still pinned [email protected] in its full consumers, so npm failed with ERESOLVE on all nine nightly runs since then.

Changes

  • Move the verifier's tested viem from 2.45.3 to 2.57.19, the current release, and update the README's verified column.
  • Viem 2.54.2 and later pin [email protected] themselves, so the lockfile assertion on Viem's declared ws moves from 8.18.3 to 8.21.0. The scoped npm viem → ws override stays in the README blocks for applications that hold an older Viem, and the README now says it changes nothing on current Viem.
  • Every Viem inside ^2.54.2 depends on an Ox (0.14.29 through 0.14.65) whose Tempo VirtualMaster miner imports node:worker_threads through a constant in ox/_esm/tempo/internal/virtualMasterPool.js. Vite resolves that while loading the module graph and prints a "has been externalized for browser compatibility" warning, which the old check rejected outright; that is why the README held the verifier on 2.45.3. The miner is tree-shaken out: neither the esbuild nor the Vite bundle contains a worker_threads string, which runBrowserBundle asserts. The Vite check now tolerates only that importer, still fails if Vite externalizes node:worker_threads for any other module, and reports through the usual [waiver] channel once the warning disappears.
  • Narrow the Bun waiver. With [email protected], the Bun AA consumer no longer reports GHSA-58qx-3vcg-4xpx (fixed in 8.20.1) or GHSA-96hv-2xvq-fx4p (fixed in 8.21.0), so both leave acceptedBunAdvisories and the README's Bun list, as the verifier's own progress message asked.
  • Add a @sei-js/sei-global-wallet patch changeset, since the README ships in the package.

Verification

  • bun run test:sei-global-wallet-release (full run, without the fast-check flag) passes locally on Bun 1.4.4 against [email protected] and [email protected], with no [waiver] notices. The wallet-only npm consumer audits clean, the full npm consumer reports only the three waived stream-json advisories, and the Bun AA consumer reports only its waived bn.js and stream-json advisories. The local run used Node 26; this PR's smoke run covers the Node 24 that .nvmrc pins.
  • bun run check and bun run test:scripts (48 tests) pass.

No published dependency or peer range changes.

Dynamic published @dynamic-labs/[email protected] on
November 3, raising the viem peer of the client and of
@dynamic-labs/ethereum-aa from ^2.45.3 to ^2.54.2. The verifier still
installed [email protected], so every nightly consumer smoke since November 4
failed with ERESOLVE. Its full consumers now install [email protected].

Every Viem inside ^2.54.2 depends on an Ox whose Tempo VirtualMaster
miner loads node:worker_threads for its Node worker pool, which Vite
resolves and reports as externalized. The miner is tree-shaken out of
the bundle, so the Vite check tolerates that one importer and still
fails on any other, and the bundle scans still fail on any
worker_threads path.

Viem 2.54.2 and later pin [email protected], so the Bun AA consumer no longer
reports GHSA-58qx-3vcg-4xpx or GHSA-96hv-2xvq-fx4p, and both leave the
Bun waiver.

Co-authored-by: Cursor <[email protected]>
@cursor

cursor Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Changes affect release verification, README consumer guidance, and advisory waivers only; published dependency and peer ranges are unchanged.

Overview
Aligns the Sei Global Wallet consumer verifier with Dynamic’s raised viem peer (^2.54.2+) by testing [email protected] instead of 2.45.3, which restores nightly installs that were failing with ERESOLVE. The README’s optional-peer verified column and a patch changeset document the same.

The release script narrows the Bun security waiver by dropping Viem’s two ws GHSA entries now that Viem ≥2.54.2 pins [email protected], and updates the npm lock assertion accordingly. Vite checks no longer fail on every node:worker_threads externalization warning: only ox/.../virtualMasterPool.js is tolerated (tree-shaken, unused in wallet paths); other importers or bundle leaks still fail, with a [waiver] hint if upstream removes the warning.

Reviewed by Cursor Bugbot for commit b823652. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.53%. Comparing base (2f746a0) to head (b823652).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #362   +/-   ##
=======================================
  Coverage   96.53%   96.53%           
=======================================
  Files          81       81           
  Lines        5563     5563           
=======================================
  Hits         5370     5370           
  Misses        193      193           
Flag Coverage Δ
mcp-server 95.15% <ø> (ø)
precompiles 99.85% <ø> (ø)
registry 100.00% <ø> (ø)
sei-global-wallet 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seidroid seidroid 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.

This PR is a well-scoped fix for the nightly consumer-smoke ERESOLVE caused by Dynamic 4.104.0 raising its viem peer. It bumps the verifier's tested viem to 2.57.19 and only tolerates the one known Vite worker_threads warning, from Ox's virtualMasterPool.js; any other externalization still fails. It also trims the Bun waiver to match [email protected] and includes a changeset. I found no blocking problems, only small follow-ups.

Findings: 0 blocking | 6 non-blocking | 2 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • The Codex (codex-review.md) and Cursor (cursor-review.md) second-opinion files were both empty, so this review has no input from them.
  • packages/sei-global-wallet/package.json still has viem: 2.45.3 in devDependencies. The in-repo build and tests therefore run against a different viem than the 2.57.19 the verifier and README now list as verified. Consider bumping it to match, or say why it is kept, so local tests exercise the version the docs promise.
  • The tested viem pin is still a hard-coded constant. The next time Dynamic raises its viem peer, the nightly run will again fail with an opaque npm ERESOLVE. resolveDynamicContract() already reads the client's peerDependencies. It could also assert that makeTestedPeerVersions().viem satisfies the client's and ethereum-aa's viem peer, so the failure would name the cause directly.
  • No guideline concerns: there is no change to the published peer or dependency ranges, the patch changeset is present, and the narrowed Bun waiver is backed by viem's own [email protected] pin. That pin is asserted in the npm lockfile check.
  • 2 suggestion(s)/nit(s) flagged inline on specific lines.

.split('\n')
.filter((line) => /(?:node:)?worker_threads.*externaliz|externaliz.*(?:node:)?worker_threads/i.test(line));
const unexpectedExternalizations = workerThreadsExternalizations.filter(
(line) => !toleratedWorkerThreadsImporter.test(line.match(/imported by "([^"]+)"/)?.[1]?.replaceAll('\\', '/') ?? '')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] This fails closed when a matching line has no imported by "..." clause (the importer becomes '', so the line counts as unexpected), which is the right default. But Vite's warning format and ANSI colouring vary by version, and a future format change would produce a confusing failure. Consider adding a short comment saying the parse is deliberately fail-closed, and printing only unexpectedExternalizations in the assertion message rather than the full viteOutput, so the failing line is easy to find.

// wallet path reaches the miner and it is tree-shaken out, which the bundle
// scan in runBrowserBundle enforces, so it is the only importer the Vite check
// tolerates.
const toleratedWorkerThreadsImporter = /(?:^|\/)node_modules\/ox\/_esm\/tempo\/internal\/virtualMasterPool\.js$/;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] (?:^|\/)node_modules\/ox\/... also matches a nested copy such as node_modules/viem/node_modules/ox/..., which seems intended. Note that the safety argument depends on the bundle scans in runBrowserBundle/edge (!bundle.includes('node:worker_threads')) staying in place. If those scans are ever relaxed, this tolerance should be revisited too.

@alexander-sei
alexander-sei merged commit 84a1509 into main Nov 12, 2026
15 of 16 checks passed
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