You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❌ Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.21%. Comparing base (099ce78) to head (6d1d30c).
XinyuCRO
changed the title
tests: validate JSON-RPC schema against execution-api fixtures
test: validate JSON-RPC schema against execution-api fixtures
Jun 24, 2026
PR Review — test: validate JSON-RPC schema against execution-api fixtures
Gather context and understand the PR
Read CLAUDE.md (not present)
Review changed Go files (rpc/, x/evm/)
Review new Python test files
Check for state-breaking changes
Post inline comments on issues found
Write final review summary
Summary
This PR adds:
A new eth_baseFee RPC method
A fix for eth_getStorageAt key parsing
Stricter block number parsing (hex-only)
txHash in debug_traceBlock results
A fix to getAccessListExcludes guard condition
A comprehensive JSON-RPC schema test suite against upstream execution-apis fixtures
Overall the code quality is good and the test infrastructure is well-designed. See findings below.
Findings
🔴 Breaking Change — Stricter Block Number Parsing (rpc/types/block.go)
The removal of the decimal fallback is a client-facing breaking change. Before, BlockNumber.UnmarshalJSON accepted decimal strings like "12345" by falling back to cast.ToUint64. Now any non-hex input (missing 0x prefix) returns an error.
Any client relying on decimal block number inputs will break silently. The PR description calls it "stricter" but doesn't highlight this as a compatibility concern. This is acceptable if there are no known users of that path, but should be explicitly acknowledged.
🟡 Unused Return Value in decodeStorageKey (rpc/backend/account_info.go:140)
storageKey, _, err:=decodeStorageKey(key)
The inputLength int return value is discarded everywhere it's called. If it was intended for future use (e.g., detecting right-vs-left padding for legacy compat), it should be documented; otherwise simplify the signature.
🟡 No Unit Test for eth_baseFee (rpc/namespaces/ethereum/eth/api.go)
The BaseFee() method has 0% coverage per Codecov. This method has two code paths (head.BaseFee == nil and non-nil) — a unit test would be straightforward given the existing backend.go interface.
The original code checked args.Gas == nil unconditionally when AuthorizationList was set. The new code wraps it in if len(args.AuthorizationList) > 0, which is correct — but note this means that if a caller passes authorizationList: [] (empty slice), gas is no longer checked. This is intentional per the fix, but worth confirming the behavior is consistent with go-ethereum.
🟡 CodeQL: Implicit string concatenation (_schema_constants.py:162-165 and :166-168)
Python implicitly concatenates adjacent string literals. These aren't inside a list so there's no actual bug, but using an explicit + or a single long string removes the CodeQL noise and makes intent clearer.
🟡 CodeQL: Bare except Exception: pass without comment (conftest.py:117)
The _w3_wait_for_block function silently swallows all exceptions in the polling loop. Line 207 has a good comment explaining why ("The RPC endpoint can reject early requests..."); the identical pattern at line 117 does not. A brief comment here would satisfy CodeQL and aid future readers.
This is a clean, minimal fix. TxTraceResult.TxHash was already defined in types/tracer.go but never populated. The addition is correct and non-breaking.
🟢 decodeStorageKey implementation
Leniently accepts keys with or without 0x prefix and handles odd-length hex. common.BytesToHash right-aligns the bytes as expected for storage slot addressing. The error paths return a structured InvalidParamsError with the offending key in the message. Well done.
🟢 eth_baseFee implementation
Returns new(big.Int) (zero) when head.BaseFee == nil (pre-EIP-1559 contexts) rather than nil, which avoids a null pointer in the JSON response. Correct behavior.
🟢 Python Test Infrastructure
The fixture sync architecture (_execution_apis_sync.py, genesis overlay injection, conftest.py setup) is well-structured. The separate normalizers, rewriters, constants, and report files follow good separation of concerns. The SCHEMA_MISMATCH_WHITELIST and EXCLUDED_SCHEMA_SPEC_CASES allow-lists are explicitly documented with reasons.
One note: _execution_apis_sync.py fetches from main branch of ethereum/execution-apis at runtime — consider pinning to a specific commit/tag for reproducibility (or exposing a EXECUTION_APIS_REF env var alongside the existing EXECUTION_APIS_ARCHIVE_URL).
State-Breaking Changes
None detected. All changes are either:
Read-only RPC handlers (no state mutations)
Trace/debug query improvements (no consensus impact)
Defensive guard clauses in getAccessListExcludes (no state change)
The stricter block number parsing is API-breaking for RPC clients, not a consensus/state-breaking change. It is safe to merge to non-release branches.
@JayT106 the deleted simulateV1 specs files are copied from execution specs, this pr introduce a way to sync all specs fixtures including simulateV1 ones into the test context without needing to track them in git, should have no behavior changes
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
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.
Dependent PR:
eth_baseFeeJSON RPC method #1027debug_traceBlockJSON RPC response #1031doc update PR:
Tests: