Enabling archiver in CI#163
Merged
Merged
Conversation
ludamad
approved these changes
Apr 4, 2023
spypsy
pushed a commit
that referenced
this pull request
Jun 8, 2026
…rs (A-818) (#23919) Fixes A-818 (Audit #163). ## Problem `formatViemError` (`yarn-project/ethereum/src/utils.ts`) called `structuredClone(error)` unguarded, before the `instanceof Error` formatting fallback. `structuredClone` throws `DataCloneError` on values it cannot clone — and viem RPC/contract errors routinely attach plain-object context holding functions (e.g. transport request methods). When that happened, the formatter itself threw, and since several call sites do `throw formatViemError(...)` (`rollup.ts`, `l1_tx_utils.ts`), the original L1 revert/RPC error was replaced by a `DataCloneError` and lost — degrading operator diagnostics. ## Fix Wrap the clone (and the `stripAbis` call that depends on it) in a `try/catch`. On clone failure, fall back to formatting the original error untouched (skipping `stripAbis` so we don't mutate the caller's object). The `cause` still carries the original error in all paths. ## Test Added a `formatViemError` test in `utils.test.ts` covering an error whose `cause` holds a function-valued `request` field. It throws `DataCloneError` without the fix and returns a `FormattedViemError` (preserving the message and `cause`) with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enabling archiver in CI
Checklist: