Skip to content

Inconsistent JSON-RPC error codes for the same transaction-validation failure modes across methods #817

@MysticRyuujin

Description

@MysticRyuujin

Summary

The spec currently defines two different JSON-RPC error codes for the same transaction-validation failure modes, depending on which method returns the error.

Details

For identical conditions, the two schemes assign different codes:

Failure mode Catalog code (#650) eth_simulateV1 code (execute.yaml)
Nonce too low 1 -38010
Nonce too high 2 -38011
Intrinsic gas too low 800 -38013
Max fee per gas too low 802 -32005
Block gas limit exceeded 803 -38015
Max priority fee per gas higher than max fee per gas 804 -32602 (generic)
Max fee per gas below base fee 806 -38012
Max priority fee per gas higher than 2^256-1 807 -32602 (generic)
Max fee per gas higher than 2^256-1 808 -32602 (generic)
Insufficient funds 809 -38014

The -32602 (generic) rows are conditions for which eth_simulateV1 has no dedicated code and falls back to the generic "invalid params" code, rather than a distinct one. The remaining rows are codes explicitly listed in execute.yaml.

This list may not be exhaustive.

Status

Decision needed

Should a given failure mode use a single error code across all methods? If so, which scheme is authoritative and what is the migration path for the other? Or should per-method codes be retained as they are?

Opening this to gather core-dev feedback before error-code standardization proceeds further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions