You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/extensions/README.md
+6-70Lines changed: 6 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A standard for JSON-RPC error codes & ship a shared catalog of JSON-RPC error co
8
8
Client implementations and EVM-compatible chains currently reuse codes or return generic error messages, making cross-client debugging brittle.
9
9
10
10
#### Solution
11
-
The solution incorporates [OpenRPC's extension schemas](https://github.com/open-rpc/specification-extension-spec) feature, specifically `x-error-group`[extension](https://github.com/open-rpc/tools/blob/main/packages/extensions/src/x-error-groups/x-error-groups.json), so common scenarios can be bundled into reusable categories, each backed by a reserved range of **200 codes**between **-31999 and -30000** (outside the JSON-RPC 2.0 reserved bands).
11
+
The solution incorporates [OpenRPC's extension schemas](https://github.com/open-rpc/specification-extension-spec) feature, specifically `x-error-group`[extension](https://github.com/open-rpc/tools/blob/main/packages/extensions/src/x-error-groups/x-error-groups.json), so common scenarios can be bundled into reusable categories, each backed by a reserved range of **200 codes** outside the JSON-RPC 2.0 reserved bands.
12
12
With the error grouping and inline provisioning offered by the extension schemas, we could onboard methods over time with granular control over the errors or groups each method would need to handle without copy pasting in the final spec.
13
13
14
14
The corresponding PR definition frames these groups as the canonical vocabulary for wallets, infra providers, and execution clients.
@@ -31,11 +31,10 @@ Currently, only below methods import all the error groups via `$ref` and may inc
31
31
| --- | --- | --- | --- |
32
32
| JSON-RPC standard | — | $-32768$ to $-32000$ | JSON-RPC 2.0 spec |
| Gas errors |`GAS_ERRORS`| $-31999$ to $-31800$ |`gas-error-groups.yaml`|
35
-
| Execution errors |`EXECUTION_ERRORS`| $-31799$ to $-31600$ |`execution-errors.yaml`|
36
-
| (Future) consensus | — | $-31599$ to $-31400$ |
37
-
| (Future) networking | — | $-31399$ to $-31200$ |
38
-
| TxPool errors |`TXPOOL_ERRORS`| $-31199$ to $-31000$ |`txpool-errors.yaml`|
34
+
| Gas errors |`GAS_ERRORS`| $800$ to $999$ |`gas-error-groups.yaml`|
35
+
| Execution errors |`EXECUTION_ERRORS`| $1$ to $999$ |`execution-errors.yaml`|
36
+
| TxPool errors |`TXPOOL_ERRORS`| $1000$ to $1200$ |`txpool-errors.yaml`|
37
+
| ZK execution errors |`ZK_EXECUTION_ERRORS`| $2000$ to $2200$ |`zk-execution-errors.yaml`|
39
38
40
39
41
40
**Validation** of these bands happens through `XErrorGroupsJSON.schema` in `scripts/build.js`, so build failures flag any out-of-range additions early.
@@ -47,67 +46,4 @@ Currently, only below methods import all the error groups via `$ref` and may inc
47
46
3. Reference the group from the relevant method spec via `$ref: '#/components/x-error-group/<GroupName>'` and layer any bespoke errors inline.
48
47
4. Run the documentation build (e.g. `node scripts/build.js`) to regenerate `refs-openrpc.json` / `openrpc.json` and confirm validation passes.
49
48
50
-
Following this flow keeps the execution client surface aligned with the standard and preserves interoperability for downstream consumers.
51
-
52
-
53
-
## Catalog reference
54
-
55
-
### [JSON-RPC standard errors](https://www.jsonrpc.org/specification) (`rpc-standard-errors.yaml`)
56
-
| Code | Message | Notes |
57
-
| --- | --- | --- |
58
-
| $-32700$ | Parse error | An error occurred on the server while parsing the JSON text |
59
-
| $-32600$ | Invalid request | The JSON sent is not a valid request object |
60
-
| $-32601$ | Method not found | The method does not exist / is not available |
0 commit comments