Skip to content

QA: add tests for eth_getHeaderByNumber() eth_getHeaderByHash() - #24094

Merged
AskAlexSharov merged 4 commits into
mainfrom
lupin012/add_rpc_tests_for_eth_getHeaderByNumber_eth_getHeaderByHash
Sep 18, 2026
Merged

AskAlexSharov merged 4 commits into
mainfrom
lupin012/add_rpc_tests_for_eth_getHeaderByNumber_eth_getHeaderByHash

Conversation

@lupin012

@lupin012 lupin012 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

QA integration tests for eth_getHeaderByNumber and eth_getHeaderByHash, the two APIs added in #23717.

The fixtures live in erigontech/rpc-tests#603; this PR only pins RPC_VERSION to that branch so the QA workflows pick them up.

eth_getHeaderByNumber

test param case
01 0x41b57c pre-London: no baseFeePerGas, no post-Merge fields
02 0xC65D40 London: baseFeePerGas set, difficulty still non-zero
03 0x1036640 post-Merge pre-Shanghai: difficulty 0x0, no withdrawalsRoot
04 0x112A880 Shanghai: withdrawalsRoot set, no blob fields
05 0x12C135B Cancun: blobGasUsed, excessBlobGas, parentBeaconBlockRoot
06 0x1600000 Prague: requestsHash
07 earliest resolves to the genesis header
08 latest head header (metadata.latest, runs only with -L)
09 pending null, the pending block is not exposed
10 0x7FFFFFFFFFFFFF unknown number: null, not an error
11 abc invalid number: hex without 0x prefix, error

eth_getHeaderByHash

test case
01 pre-London: no baseFeePerGas, no post-Merge fields
02 London: baseFeePerGas set, difficulty still non-zero
03 post-Merge pre-Shanghai: difficulty 0x0, no withdrawalsRoot
04 Shanghai: withdrawalsRoot set, no blob fields
05 Cancun: blobGasUsed, excessBlobGas, parentBeaconBlockRoot
06 Prague: requestsHash
07 genesis block hash
08 unknown hash: null, not an error
09 invalid hash: wrong length, error
10 invalid hash: not a string, error

The same blocks are used by number and by hash, so the two APIs are compared on identical headers.

Integration-Tests

Compared eth_getHeaderByNumber() and eth_getHeaderByHash() for historical block automatically on QA - RPC Integration Tests / mainnet-rpc-integ-tests
Compared eth_getHeaderByNumber() output with geth on the latest block — results match. Dispatched manually: CI run.

@lupin012
lupin012 marked this pull request as ready for review September 17, 2026 11:25
@lupin012

Copy link
Copy Markdown
Contributor Author

@MysticRyuujin I have added rpc-tests for the new RPC methods eth_getHeaderByNumber() and eth_getHeaderByHash() of your PR

@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 5777c5a Sep 18, 2026
140 checks passed
@AskAlexSharov
AskAlexSharov deleted the lupin012/add_rpc_tests_for_eth_getHeaderByNumber_eth_getHeaderByHash branch September 18, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants