ethereum / ethereum/execution-apis

Proposal: Error handling specification #2

Open
#288 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Io
Stars
1.1k
Forks
530
Avg merge
5d 8h
Merged PRs (30d)
9

Description

Hi all,

I am working on a project that validates whether four Ethereum client implementations (Geth, Erigon, Nethermind, Besu) behave consistently to one another.

And while doing the experiments, I found out that the clients handle error cases and uncle block arguments in very much different ways:

----------------------------------------------------------------------------------

1. Gas estimation: High max fee
- (Geth, Erigon) returns an `Error`
- (Nethermind, Besu) returns the estimated gas value

2. Gas estimation: Priority fee > max fee
- (Geth, Erigon) returns an `Error`
- (Nethermind, Besu) returns the estimated gas value

3. Gas estimation: Base fee > max fee
- (Geth, Erigon) returns an `Error`
- (Nethermind, Besu) returns the estimated gas value

4. Gas estimation: Low gas limit
- (Geth, Erigon, Besu) returns the estimated gas value
- (Nethermind) returns an `Error`

5. Gas estimation: High gas limit
- (Geth, Nethermind, Besu) returns the estimated gas value
- (Erigon) returns an `Error`

6. Gas estimation: Invalid type
- (Geth, Erigon, Besu) returns the estimated gas value
- (Nethermind) returns an `Error`

7. Gas estimation: Invalid nonce
- (Geth, Erigon, Besu) returns the estimated gas value
- (Nethermind) returns an `Error`

8. Gas estimation: Insufficient funds
- (Geth, Nethermind, Besu) returns the estimated gas value
- (Erigon) returns an `Error`

----------------------------------------------------------------------------------

9. Call: Priority fee > max fee
- (Geth, Erigon, Besu) returns an `Error`
- (Nethermind) returns the execution result value

10. Call: Base fee > max fee
- (Geth, Erigon, Besu) returns an `Error`
- (Nethermind) returns the execution result value

11. Call: Low gas limit
- (Geth, Besu) returns an `Error`
- (Erigon, Nethermind) returns the execution result value

12. Call: Invalid type
- (Geth, Erigon, Besu) returns the execution result value
- (Nethermind) returns an `Error`

13. Call: Invalid nonce
- (Geth, Erigon, Besu) returns the execution result value
- (Nethermind) returns an `Error`

----------------------------------------------------------------------------------

14. Uncle block argument to `getBlock`
- (Geth, Besu) returns an uncle block object
- (Erigon) returns an `Error`
- (Nethermind) returns `null`

15. Uncle block argument to `getUncle`
- (Geth, Besu) returns an uncle block object
- (Erigon) returns `null`
- (Nethermind) returns an `Error`

16. Uncle block argument to `getTransactionFromBlock`
- (Geth) returns `null`
- (Erigon, Nethermind) returns an `Error`
- (Besu) returns a transaction object

17. Uncle block argument to `getBlockTransactionCount`
- (Geth, Besu) returns the number of block transactions
- (Erigon) returns `null`
- (Nethermind) returns an `Error`

18. Uncle block argument to `getBlockUncleCount`
- (Geth, Besu) returns the number of uncle blocks
- (Erigon) returns `null`
- (Nethermind) returns an `Error`

I assume these discrepancies derived from the lack of error and uncle handling specification in this document. So, how about specifying the expected results (e.g., Error, null, estimated gas, execution result, ...) so that different client implementations behave consistently in error cases and uncle block arguments as well?

Example test cases can be found in the following link: [https://github.com/JosephK95/RPCTests](url)

Thanks and please let me know if there is anything I can help you with.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.