Repository navigation
fix(rpc)!: follow the trace costs and names of execution-apis 32fae20 - #5342
Merged
Merged
Conversation
The pin of ethereum/execution-apis moves from 166e334 to 32fae20. At that commit, ethereum/execution-apis#986 fixes the gasCost and the op of a step of the opcode logger, where EthLib had picked its own rule: - a step that halts its frame exceptionally reports 0, not all the gas left; - CREATE and CREATE2 leave out the gas that they pass on to the initcode; - a call that starts no message, for its value or its depth, counts the gas that it would pass on, without the stipend; - a byte that is no opcode at the fork is named "opcode 0x<byte> not defined", and only 0xfe is INVALID. The debug traces and the lines of EIP-3155 share these entries, so both change. Two points stay open: a CREATE whose address collides still counts the gas of its message (ethereum#5340), and refund still leaves out the refund of EIP-7702 authorizations (ethereum#5341). The suite vendors the opcode-logger fixtures that the new pin adds or changes, and compares a trace value for value apart from the error text, which the source leaves to the client. The call-tracer fixtures wait for the call tracer. The Engine OpenRPC examples move to the same commit. The examples of engine_newPayloadV5 and engine_getPayloadV6 now decode, since upstream fixed their access list and their blob. The bindings read no payload status of version 2, so the status tests leave out the new Bogota examples of engine_newPayloadV6 and engine_forkchoiceUpdatedV5. BREAKING CHANGE: the gasCost and the op of trace entries change as above, in the debug traces and in the EIP-3155 lines. In Lean, mnemonicOf takes the byte of the opcode after the fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tcoratger
added a commit
that referenced
this pull request
Dec 2, 2026
At 32fae20, ethereum/execution-apis#967 adds to the error groups: a server must not include data unless the spec declares a data schema for that error, also for -32602 and -32000, and human-readable detail goes in the message. Only the revert, code 3, declares data. EthLib put the reason of an invalid parameter, of an invalid request and of most codes of the execution API in data. ErrorCode.toRpcError now takes the detail as a string and writes it after the message of the code, and RpcError.invalidParams and invalidRequest do the same. The revert keeps its output as data. The Engine API keeps its own null data. The errors of the Python readers are no JSON-RPC answer, so they keep the reason alone as their message. SOUNDNESS.md also drops the notes on the Engine examples that the pin move of #5342 fixed upstream, and the reader of bytes cites the pattern of ethereum/execution-apis#1023, which now asks for two digits a byte. BREAKING CHANGE: error objects of the execution API lose their data, except the revert, and their message carries the detail. In Lean, ErrorCode.toRpcError takes an Option String instead of an Option Json. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The opcode trace now reports the step costs and the opcode names that execution-apis fixes at
32fae20, and the pin of execution-apis moves to that commit.The change follows ethereum/execution-apis#986; #967 and #855 follow in their own pull requests.
The problem
opcode-tracer.yamlleftgasCostopen, so EthLib picked a rule of its own (stepCostinExecution/Rpc/Trace.lean).#986 fixes the field, and EthLib disagreed with it in four places:
INVALID, where the source names itopcode 0x<byte> not definedand keepsINVALIDfor0xfe.The idea
stepCostreads the result of the step:errorfield,stepError) costs 0;returnedGasreads them fromstepWithCharges, the step of the interpreter that also gives the charges of a call, and adds them back.mnemonicOftakes the byte of the opcode, so it can name a byte that is no opcode.The EIP-3155 lines read the same entries, so they change in the same way.
Example
The account
OTHERholds 1 wei and calls itself with 2 wei and 4096 gas, at Prague (test_call_without_message).For reviewers
returnedGasruns the step a second time, only for a call-family opcode that gave the next frame.Every other step costs nothing more.
The new
eth_simulateV1andeth_estimateGasfixtures pass.The Engine examples of
engine_newPayloadV5andengine_getPayloadV6now decode, since upstream fixed their access list and their blob.The bindings read no payload status of version 2, so the new examples of
engine_newPayloadV6andengine_forkchoiceUpdatedV5stay out of the status tests.out of gas: write protectionwhere EthLib writeswrite protection.calltracer-*fixtures and thedebug_traceCalldirectory are not vendored yet; the call-tracer pull request adds them.TransactionInfo.leannow cites the merged text of proof(consensus): state which block an invalid payload removes #1008 instead of the open report.refundstill leaves out the refund of EIP-7702 authorizations, which the counter of the transaction holds (#5341).Checks
lake build EthLib.Execution.Rpc EthLib.Execution.Proofs.Rpc --wfail: success.lake exe check-decls EthLib.Execution.Rpc EthLib.Execution.Proofs.Rpc: 0 findings, 0 new, 0 stale.lake exe proof-coverage --check: no change.uv run pytest -n 8(whole suite, bindings of this branch): 76481 passed, 674 skipped, 13 xfailed.pytestontests/rpc,tests/engine,tests/transactionsandtest_opcode_coverage.py: 6317 passed, 264 skipped.check_lean_layout.py --all --rule wrap,soundness_facts.py --check,check_fixture_pins.py,sha256sum -c SHA256SUMS: clean.ruff check,ruff format --check,ty check,check_python_comments.py,check_docstrings.pyon the changed tests: clean.🤖 Generated with Claude Code