proxyRpc() in src/background/index.js (lines 290-307) turns a node's JSON-RPC error into new Error(message), and the read-only proxy answers the page with { message } alone (line 1065). A transaction that cannot be prepared fails back with a message and no code too (src/shared/approvalTx.js, lines 191-200).
What happens
On next (8e52528), release build, Chrome, local chain with chain id 11155111, from a connected site:
eth_call to a reverting token transfer: the node answers code 3 with the revert data. The page gets "execution reverted: bal" with no code and no data.
eth_getBalance with a malformed address: "invalid string length", no code.
eth_sendTransaction whose gas estimate reverts: "The transaction could not be prepared: ...", no code.
A site cannot tell these failures apart, or from a rejection, and cannot decode a custom revert error.
What should happen
EIP-1193, Errors: a rejected request's error carries a numeric code, and may carry data. A node's error should reach the page with the node's code and data; an error the wallet raises itself should carry an EIP-1193 or EIP-1474 code, as its rejection and unsupported-method answers already do.
Severity: minor
Definition of done
Every rejected request reaches the page with a numeric code.
A node error reaches the page with the node's code and data unchanged.
Tests cover a reverting eth_call and a failed transaction preparation.
Model: opus-5-5
## Where
`proxyRpc()` in `src/background/index.js` (lines 290-307) turns a node's JSON-RPC error into `new Error(message)`, and the read-only proxy answers the page with `{ message }` alone (line 1065). A transaction that cannot be prepared fails back with a message and no code too (`src/shared/approvalTx.js`, lines 191-200).
## What happens
On `next` (8e52528), release build, Chrome, local chain with chain id 11155111, from a connected site:
- `eth_call` to a reverting token `transfer`: the node answers code 3 with the revert data. The page gets "execution reverted: bal" with no `code` and no `data`.
- `eth_getBalance` with a malformed address: "invalid string length", no `code`.
- `eth_sendTransaction` whose gas estimate reverts: "The transaction could not be prepared: ...", no `code`.
A site cannot tell these failures apart, or from a rejection, and cannot decode a custom revert error.
## What should happen
EIP-1193, Errors: a rejected request's error carries a numeric `code`, and may carry `data`. A node's error should reach the page with the node's `code` and `data`; an error the wallet raises itself should carry an EIP-1193 or EIP-1474 code, as its rejection and unsupported-method answers already do.
Severity: minor
## Definition of done
- [ ] Every rejected request reaches the page with a numeric `code`.
- [ ] A node error reaches the page with the node's `code` and `data` unchanged.
- [ ] Tests cover a reverting `eth_call` and a failed transaction preparation.
Model: opus-5-5
clawbot
self-assigned this 2026-10-14 05:05:22 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Where
proxyRpc()insrc/background/index.js(lines 290-307) turns a node's JSON-RPC error intonew Error(message), and the read-only proxy answers the page with{ message }alone (line 1065). A transaction that cannot be prepared fails back with a message and no code too (src/shared/approvalTx.js, lines 191-200).What happens
On
next(8e52528), release build, Chrome, local chain with chain id 11155111, from a connected site:eth_callto a reverting tokentransfer: the node answers code 3 with the revert data. The page gets "execution reverted: bal" with nocodeand nodata.eth_getBalancewith a malformed address: "invalid string length", nocode.eth_sendTransactionwhose gas estimate reverts: "The transaction could not be prepared: ...", nocode.A site cannot tell these failures apart, or from a rejection, and cannot decode a custom revert error.
What should happen
EIP-1193, Errors: a rejected request's error carries a numeric
code, and may carrydata. A node's error should reach the page with the node'scodeanddata; an error the wallet raises itself should carry an EIP-1193 or EIP-1474 code, as its rejection and unsupported-method answers already do.Severity: minor
Definition of done
code.codeanddataunchanged.eth_calland a failed transaction preparation.Model: opus-5-5