Skip to content

Fix invalid eth_simulate schema #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/eth/execute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,42 @@
name: Result of calls
schema:
$ref: '#/components/schemas/EthSimulateResult'
errors:
- code: -32000
message: Invalid request
- code: -32602
message: Missing or invalid parameters
- code: -32005
message: Transactions maxFeePerGas is too low
- code: -32015
message: Execution error
- code: -32016
message: Timeout
- code: -32603
message: The Ethereum node encountered an internal error
- code: -38010
message: Transactions nonce is too low
- code: -38011
message: Transactions nonce is too high
- code: -38012
message: Transactions baseFeePerGas is too low
- code: -38013
message: Not enough gas provided to pay for intrinsic gas for a transaction
- code: -38014
message: Insufficient funds to pay for gas fees and value for a transaction
- code: -38015
message: Block gas limit exceeded by the block's transactions
- code: -38020
message: Block number in sequence did not increase
- code: -38021
message: Block timestamp in sequence did not increase or stay the same
- code: -38022
message: MovePrecompileToAddress referenced itself in replacement
- code: -38023
message: Multiple MovePrecompileToAddress referencing the same address to replace
- code: -38024
message: Sender is not an EOA
- code: -38025
message: Max init code size exceeded
- code: -38026
message: Client adjustable limit exceeded
1 change: 0 additions & 1 deletion src/schemas/block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Block:
- size
- transactions
- uncles
additionalProperties: false
properties:
hash:
title: Hash
Expand Down
86 changes: 24 additions & 62 deletions src/schemas/execute.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EthSimulatePayload:
title: Arguments for multi call
title: Arguments for eth_simulate
required:
- blockStateCalls
properties:
Expand Down Expand Up @@ -149,7 +149,7 @@ Withdrawals:
description: This array can have a maximum length of 16.
type: array
items:
- $ref: '#/components/schemas/Withdrawal'
$ref: '#/components/schemas/Withdrawal'
Withdrawal:
title: A withdrawal made by a validator
type: object
Expand All @@ -167,13 +167,10 @@ Withdrawal:
title: Amount
$ref: '#/components/schemas/uint64'
EthSimulateResult:
title: Full results of multi call
type: object
oneOf:
- $ref: '#/components/schemas/EthSimulateBlockResultInvalid'
- $ref: '#/components/schemas/EthSimulateBlockResultSuccess'
title: Full results of eth_simulate
$ref: '#/components/schemas/EthSimulateBlockResultSuccess'
EthSimulateBlockResultSuccess:
Comment on lines 169 to 172
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably just delete EthSimulateResult and rename EthSimulateResultSuccess to EthSimulateResult now?

Suggested change
EthSimulateResult:
title: Full results of multi call
type: object
oneOf:
- $ref: '#/components/schemas/EthSimulateBlockResultInvalid'
- $ref: '#/components/schemas/EthSimulateBlockResultSuccess'
title: Full results of eth_simulate
$ref: '#/components/schemas/EthSimulateBlockResultSuccess'
EthSimulateBlockResultSuccess:
EthSimulateResult:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that, but I would rather keep this minimal and refactor the naming / organization next. I want to generally drop the Eth prefix on all the methods / types since it is self evident.

title: Full results of multi call
title: Full results of eth_simulate
type: array
items:
$ref: '#/components/schemas/EthSimulateBlockResultSingleSuccess'
Expand All @@ -182,62 +179,16 @@ EthSimulateBlockResultSingleSuccess:
type: object
allOf:
- $ref: '#/components/schemas/Block'
- title: Eth Simulate call results
- type: object
title: Eth Simulate call results
required:
- calls
properties:
calls:
title: Call Results
$ref: '#/components/schemas/CallResults'
EthSimulateBlockResultInvalid:
title: Result of eth_simulate not being valid
description: The error messages are suggestions and a client might decide to return a different errror message than specified here. However, the error codes are enforced by this specification.
type: object
required:
- error
properties:
error:
oneOf:
- code: -32000
message: Invalid request
- code: -32602
message: Missing or invalid parameters
- code: -32005
message: Transactions maxFeePerGas is too low
- code: -32015
messagE: Execution error
- code: -32016
message: Timeout
- code: -32603
message: The Ethereum node encountered an internal error
- code: -38010
message: Transactions nonce is too low
- code: -38011
message: Transactions nonce is too high
- code: -38012
message: Transactions baseFeePerGas is too low
- code: -38013
message: Not enough gas provided to pay for intrinsic gas for a transaction
- code: -38014
message: Insufficient funds to pay for gas fees and value for a transaction
- code: -38015
message: Block gas limit exceeded by the block's transactions
- code: -38020
message: Block number in sequence did not increase
- code: -38021
message: Block timestamp in sequence did not increase or stay the same
- code: -38022
message: MovePrecompileToAddress referenced itself in replacement
- code: -38023
message: Multiple MovePrecompileToAddress referencing the same address to replace
- code: -38024
message: Sender is not an EOA
- code: -38025
message: Max init code size exceeded
- code: -38026
message: Client adjustable limit exceeded
CallResults:
title: Results of multi call within block
title: Results of eth_simulate within block
type: array
items:
oneOf:
Expand Down Expand Up @@ -265,10 +216,21 @@ CallResultFailure:
$ref: '#/components/schemas/uint64'
error:
oneOf:
- code: -32000
message: 'Execution reverted'
- code: -32015
message: 'VM execution error'
- type: object
properties:
code:
const: -32000
message:
type: string
pattern: "^execution reverted.*"
required: [code, message]
- type: object
properties:
code:
const: -32015
message:
type: string
pattern: "^vm execution error.*"
CallResultSuccess:
title: Result of call success
type: object
Expand Down Expand Up @@ -298,7 +260,7 @@ CallResultLog:
type: object
required:
- logIndex
- blockhash
- blockHash
- blockNumber
- transactionHash
- transactionIndex
Expand Down
1 change: 0 additions & 1 deletion src/schemas/transaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ TransactionInfo:
- from
- hash
- transactionIndex
unevaluatedProperties: false
properties:
blockHash:
title: block hash
Expand Down
3 changes: 0 additions & 3 deletions tests/eth_simulateV1/ethSimulate-empty-ethSimulate.io

This file was deleted.