Repository navigation
fix(sei-global-wallet): follow Dynamic's viem peer to 2.57.19 - #362
Conversation
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]>
PR SummaryLow Risk Overview The release script narrows the Bun security waiver by dropping Viem’s two Reviewed by Cursor Bugbot for commit b823652. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.jsonstill hasviem: 2.45.3in 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'speerDependencies. It could also assert thatmakeTestedPeerVersions().viemsatisfies the client's and ethereum-aa'sviempeer, 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('\\', '/') ?? '') |
There was a problem hiding this comment.
[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$/; |
There was a problem hiding this comment.
[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.
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.3range, and raised theviempeer of the client and of@dynamic-labs/ethereum-aafrom^2.45.3to^2.54.2. The verifier still pinned[email protected]in its full consumers, so npm failed withERESOLVEon all nine nightly runs since then.Changes
viemfrom2.45.3to2.57.19, the current release, and update the README's verified column.[email protected]themselves, so the lockfile assertion on Viem's declaredwsmoves from8.18.3to8.21.0. The scoped npmviem→wsoverride stays in the README blocks for applications that hold an older Viem, and the README now says it changes nothing on current Viem.^2.54.2depends on an Ox (0.14.29 through 0.14.65) whose TempoVirtualMasterminer importsnode:worker_threadsthrough a constant inox/_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 aworker_threadsstring, whichrunBrowserBundleasserts. The Vite check now tolerates only that importer, still fails if Vite externalizesnode:worker_threadsfor any other module, and reports through the usual[waiver]channel once the warning disappears.[email protected], the Bun AA consumer no longer reportsGHSA-58qx-3vcg-4xpx(fixed in 8.20.1) orGHSA-96hv-2xvq-fx4p(fixed in 8.21.0), so both leaveacceptedBunAdvisoriesand the README's Bun list, as the verifier's own progress message asked.@sei-js/sei-global-walletpatch 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 waivedstream-jsonadvisories, and the Bun AA consumer reports only its waivedbn.jsandstream-jsonadvisories. The local run used Node 26; this PR's smoke run covers the Node 24 that.nvmrcpins.bun run checkandbun run test:scripts(48 tests) pass.No published dependency or peer range changes.