Skip to content

Conversation

natanasow
Copy link
Contributor

Description

The eth_getBlockReceipts method is not working as expected.

On the mainnet, 0x511b8ee block has 2 transactions.
You can get info about those transactions correctly via eth_getBlockByNumber or via
eth_getTransactionReceipt, but the eth_getBlockReceipts has an empty response instead.

This seems related to managing synthetic transactions.

I experience the same issue with a default local JSON-RPC relay, so this does not seem due to a specific Hashio configuration.

Steps to reproduce

curl --request POST \
--url https://mainnet.hashio.io/api \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","method":"eth_getBlockReceipts","params":["0x511b8ee"],"id":2727}'

{"result":[],"jsonrpc":"2.0","id":2727}

curl --request POST \
  --url https://mainnet.hashio.io/api \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x511b8ee", true],"id":2727}'

{"result":{"timestamp":"0x68d54072","difficulty":"0x0","extraData":"0x","gasLimit":"0x1c9c380","baseFeePerGas":"0x5acdcfbc00","gasUsed":"0x0","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","receiptsRoot":"0x5db375d8dd1c1f85a496a7038255d2867a944222e3e94bacd224b6c9777b51df","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x6f1","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","totalDifficulty":"0x0","transactions":[{"blockHash":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","blockNumber":"0x511b8ee","chainId":"0x127","from":"0x000000000000000000000000000000000038b3db","gas":"0x61a80","gasPrice":"0xfe","hash":"0x7ddfc09a95b3bc890543b4f15504fccaa79e951c96ff721ed73a92834ed2c0e2","input":"0x0000000000000000","nonce":"0x0","r":"0x0","s":"0x0","to":"0x000000000000000000000000000000000038b3db","transactionIndex":"0x4","type":"0x2","v":"0x0","value":"0x0","yParity":"0x0","accessList":[],"maxPriorityFeePerGas":"0x0","maxFeePerGas":"0x0"},{"blockHash":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","blockNumber":"0x511b8ee","chainId":"0x127","from":"0x000000000000000000000000000000000038b3db","gas":"0x61a80","gasPrice":"0xfe","hash":"0xc874aa783fdeb3acdbb3628ee14d7248a475cc66af8997b213bcfa717c1173a1","input":"0x0000000000000000","nonce":"0x0","r":"0x0","s":"0x0","to":"0x000000000000000000000000000000000038b3db","transactionIndex":"0x6","type":"0x2","v":"0x0","value":"0x0","yParity":"0x0","accessList":[],"maxPriorityFeePerGas":"0x0","maxFeePerGas":"0x0"}],"transactionsRoot":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","uncles":[],"withdrawals":[],"withdrawalsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","number":"0x511b8ee","hash":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","parentHash":"0x923a0d67c314c8641af9d8c36ba0d7fb6b16212127591de1e9c5a312145e5c10"},"jsonrpc":"2.0","id":2727}

curl https://mainnet.hashio.io/api \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionReceipt","params":["0xc874aa783fdeb3acdbb3628ee14d7248a475cc66af8997b213bcfa717c1173a1"],"id":1,"jsonrpc":"2.0"}'

{"result":{"blockHash":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","blockNumber":"0x511b8ee","contractAddress":"0x000000000000000000000000000000000038b3db","cumulativeGasUsed":"0x0","effectiveGasPrice":"0x5d21dba000","from":"0x0000000000000000000000000000000000000000","gasUsed":"0x0","logs":[{"address":"0x000000000000000000000000000000000038b3db","blockHash":"0x6c3386b77706dd41ad5362b81415424bec8b5260441e16ed279c6f89224510de","blockNumber":"0x511b8ee","data":"0x0000000000000000000000000000000000000000000000000000000004edbc4c","logIndex":"0x1","removed":false,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000094f78","0x000000000000000000000000000000000000000000000000000000000048f7ac"],"transactionHash":"0xc874aa783fdeb3acdbb3628ee14d7248a475cc66af8997b213bcfa717c1173a1","transactionIndex":"0x6"}],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000024040000000200000000000000000000000000000000000000000000000000000000020000000000000000002000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000","root":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","status":"0x1","to":"0x000000000000000000000000000000000038b3db","transactionHash":"0xc874aa783fdeb3acdbb3628ee14d7248a475cc66af8997b213bcfa717c1173a1","transactionIndex":"0x6","type":null},"jsonrpc":"2.0","id":1}

Additional context

No response

Hedera network

No response

Version

v0.71.0

Operating system

None

Related issue(s)

Fixes #4423

Testing Guide

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

Signed-off-by: nikolay <[email protected]>
@natanasow natanasow added the enhancement New feature or request label Oct 9, 2025
@natanasow natanasow self-assigned this Oct 9, 2025
@natanasow natanasow added this to the 0.73.0 milestone Oct 9, 2025
Copy link

github-actions bot commented Oct 9, 2025

Test Results

 20 files  + 2  265 suites  +27   20m 22s ⏱️ - 5m 42s
763 tests +41  758 ✅ +43  5 💤 ±0  0 ❌  - 2 
779 runs  +42  774 ✅ +44  5 💤 ±0  0 ❌  - 2 

Results for commit 3c6187b. ± Comparison against base commit 2d3dc80.

This pull request removes 1 and adds 42 tests. Note that renamed tests count towards both.
"after all" hook for "@release should return the code through a websocket" ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-2 eth_getCode "after all" hook for "@release should return the code through a websocket"
@release Expect Unsupported Method Error message when subscribing for "other" method ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Connection @release Expect Unsupported Method Error message when subscribing for "other" method
@release Socket server responds to the eth_chainId event ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Connection @release Socket server responds to the eth_chainId event
@release Subscribes for contract logs for a specific contract address (using evmAddress) ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Subscribes to log events @release Subscribes for contract logs for a specific contract address (using evmAddress)
@release Subscribes for contract logs for a specific contract address (using long zero address) ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Subscribes to log events @release Subscribes for contract logs for a specific contract address (using long zero address)
@release captures approve and transferFrom events ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Subscribes to hts tokens and listens for synthetic log events @release captures approve and transferFrom events
@release captures transfer events ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe Subscribes to hts tokens and listens for synthetic log events @release captures transfer events
@release should subscribe to newHeads and receive a valid JSON RPC response ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe newHeads Configuration given WS_NEW_HEADS_ENABLED=false are set @release should subscribe to newHeads and receive a valid JSON RPC response
Calling eth_subscribe Logs with a non existent address should fail ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe ethSubscribe Logs Params Validations Calling eth_subscribe Logs with a non existent address should fail
Calling eth_subscribe Logs with an empty address should fail ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe ethSubscribe Logs Params Validations Calling eth_subscribe Logs with an empty address should fail
Calling eth_subscribe Logs with an invalid topics should fail ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-3 eth_subscribe ethSubscribe Logs Params Validations Calling eth_subscribe Logs with an invalid topics should fail
…

♻️ This comment has been updated with latest results.

Signed-off-by: nikolay <[email protected]>
@natanasow natanasow marked this pull request as ready for review October 9, 2025 14:03
@natanasow natanasow requested review from a team as code owners October 9, 2025 14:03
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice on point test case!

@natanasow natanasow requested a review from a team October 10, 2025 07:03
Copy link
Contributor

@simzzz simzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@natanasow natanasow merged commit f98df70 into main Oct 13, 2025
49 of 50 checks passed
@natanasow natanasow deleted the 4423-fix-get-block-receipts-method branch October 13, 2025 12:37
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main    #4456      +/-   ##
==========================================
+ Coverage   96.13%   96.23%   +0.10%     
==========================================
  Files         121      121              
  Lines       19941    19943       +2     
  Branches     1743     1754      +11     
==========================================
+ Hits        19170    19193      +23     
+ Misses        751      728      -23     
- Partials       20       22       +2     
Flag Coverage Δ
config-service 98.80% <ø> (ø)
relay 91.23% <100.00%> (+<0.01%) ⬆️
server 88.82% <ø> (ø)
ws-server 98.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...b/services/ethService/blockService/BlockService.ts 96.63% <100.00%> (+0.01%) ⬆️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eth_getBlockReceipts is not working as expected

3 participants