fix(eth_simulateV1): return spec-compliant message for out-of-order block number (-38020)#11403
Conversation
…mbers and add regression test - Updated error message for out-of-order block numbers to use a constant for clarity. - Introduced a new constant for the error message related to block ordering. - Added a regression test to ensure compliance with the specification when block numbers do not increase in the simulation sequence.
|
@claude review |
|
Claude finished @svlachakis's task in 1m 51s —— View job Review: fix(eth_simulateV1) — out-of-order block number message (-38020)
SummaryA clean, minimal fix. The changed files are correct and well-structured. No Critical or High findings. FindingsLow — multi-line XML doc comment on test method
Note (pre-existing, out of scope) —
What's correct
Verdict: Mergeable — no Critical, High, or Medium findings introduced by this PR. |
|
I am sorry @svlachakis, will keep in mind from next time to tackle unassigned issues |
|
@divi2806 please cross check with go-ethereum the second point from claude review
|
|
@svlachakis from https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/errors.go and https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/simulate.go, Should i implement a fixed spec for |
There was a problem hiding this comment.
@divi2806 hold on a sec, let's not merge yet because I see some discrepancy on the official docs
|
Sure, waiting for your clarification on what the correct spec message should be, will update accordingly. |
|
@svlachakis, |
|
@svlachakis quick cross-check from my side:
Given that, I can proceed either way you prefer: |
|
@divi2806 we can't proceed I need to clarify with geth team and change either the spec or the test. Feel free to pick up something else for now. |
|
got it, Thankyou for the update :D |
Fixes #11219
Changes
eth_simulateV1now returns the spec-mandated fixed message"Block number in sequence did not increase"for error code-38020instead of the verbose internal message"Block number out of order {n} is <= than previous block number of {m}!"SimulateErrorMessages.BlocksOutOfOrderconstant to keep the spec string as a single-point definition shared between the executor and testseth_simulateV1_blocks_out_of_order_returns_spec_error_code_and_messageasserting the correct code and message when block numbers in the simulation sequence do not increaseTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
eth_simulateV1_blocks_out_of_order_returns_spec_error_code_and_messageinEthSimulateTestsBlocksAndTransactions.cs— sends two blocks where the second has a lower number than the first and asserts error code-38020and message"Block number in sequence did not increase"Documentation
Requires documentation update
Requires explanation in Release Notes