Skip to content

error-groups, tools, tests: add spec-mandated error-code fixtures for methods#784

Open
simsonraj wants to merge 2 commits into
ethereum:mainfrom
simsonraj:main
Open

error-groups, tools, tests: add spec-mandated error-code fixtures for methods#784
simsonraj wants to merge 2 commits into
ethereum:mainfrom
simsonraj:main

Conversation

@simsonraj
Copy link
Copy Markdown
Contributor

@simsonraj simsonraj commented Apr 19, 2026

Follow-up to #650 that turns the new error-code catalog into a forcing function for client adoption via hive's rpc-compat simulator.

  • Adds code 1002 "Replacement transaction underpriced" to txpool-errors.yaml.
  • Adds ExpectErrorCode to the testgen. When set, rpctestgen rewrites the captured error.code in the generated .io fixture to the spec-mandated value
  • Adds eth_sendRawTransaction error scenarios, each tagged with its catalog code.
  • Extends speccheck to validate each fixture's error.code against the method's resolved errors[]; emits [WARN] on unknown codes.

Scenarios

Fixture Spec code Group
send-nonce-too-low 1 ExecutionErrors
send-intrinsic-gas-too-low 800 GasErrors
send-tx-gas-exceeds-block-limit 803 GasErrors
send-tip-above-fee-cap 804 GasErrors
send-insufficient-funds 809 GasErrors
send-already-known 1000 TxPoolErrors
send-replacement-underpriced 1002 TxPoolErrors

Measured on docker-ized go-ethereum, hyperledger/besu, nethermind/nethermind (full data and fixtures: simsonraj/eth-err-tests).

Deferred

Four scenarios that can't yet be reliably reproduced across all clients because hive doesn't expose the relevant client-launch flags. (commented currently)

@MysticRyuujin
Copy link
Copy Markdown
Contributor

From RPC Standards call: Ideally, we need to get a go-ethereum PR to fix, so we can remove the error code overwriting logic from the generator, and then update the go-ethereum target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants