Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pallet-revive] eth-rpc issues: eth_getBlockByNumber / eth_getBlockByHash does not return transactions #6790

Open
2 tasks done
sourabhniyogi opened this issue Dec 8, 2024 · 1 comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@sourabhniyogi
Copy link

sourabhniyogi commented Dec 8, 2024

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

  1. eth_getBlockByNumber does not return transactions
# curl -X POST https://westend-asset-hub-eth-rpc.polkadot.io   -H "Content-Type: application/json"   -d '{"jsonrpc": "2.0","method": "eth_getBlockByNumber","params": ["0x98ec9a", true],"id": 1}'
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x0","extraData":"0x","gasLimit":"0x3567e000000","gasUsed":"0x0","hash":"0xd070b5b0a0b863d4ad28e19a71419b339ed537e7406bb8cd7f809aec1146979c","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x98ec9a","parentHash":"0xc58e5edc54065980ffb078b07b017fc6fa8822ff1f3155f7a347872604ad7616","receiptsRoot":"0x91f9c6bf6394031745ecb2106c2f0994acce54051c379db67e7c5a8be35b5d34","sha3Uncles":"0x0000000000000000000000000000000000000000000000000000000000000000","size":"0x0","stateRoot":"0x567c1c189cc3e3d9bbd416e55d3f70825c3f60bea28f388317781d237f00bda6","timestamp":"0x6752cf34","transactions":[],"transactionsRoot":"0x91f9c6bf6394031745ecb2106c2f0994acce54051c379db67e7c5a8be35b5d34","uncles":[]}}

though 0x98ec9a=10022042 has transactions https://assethub-westend.subscan.io/block/10022042

  1. eth_getBlockByHash does not return transactions
# curl -X POST https://westend-asset-hub-eth-rpc.polkadot.io -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","method": "eth_getBlockByHash","params":["0x5b216d7ffc6e43111842d2ebdeb88ed5a1783321d14015f917b267f71280c4da",false],"id": 1}'
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x0","extraData":"0x","gasLimit":"0x3567e000000","gasUsed":"0x0","hash":"0x5b216d7ffc6e43111842d2ebdeb88ed5a1783321d14015f917b267f71280c4da","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x994219","parentHash":"0x06459b324dfa2af628116e8e1432da69ee4250a7a58f1ab4ee7d5982c5e8bb34","receiptsRoot":"0x5c3401306deb0cfc5bba46233bf0355be6b2a970b4e46c904161ee31319de8e9","sha3Uncles":"0x0000000000000000000000000000000000000000000000000000000000000000","size":"0x0","stateRoot":"0xc4e426b2fb07cac1f1aeca6e62aba34c03db9bf9de6914694f5f09fa6fd9bb3f","timestamp":"0x675508ec","transactions":[],"transactionsRoot":"0x5c3401306deb0cfc5bba46233bf0355be6b2a970b4e46c904161ee31319de8e9","uncles":[]}}

though 0x98ec9a=10022042 has 0x5b216d7ffc6e43111842d2ebdeb88ed5a1783321d14015f917b267f71280c4da block hash.

  1. eth_getTransactionByBlockNumberAndIndex has indexing based on substrate extrinsic index (2..) rather than 0-based
curl -X POST https://westend-asset-hub-eth-rpc.polkadot.io \
-H "Content-Type: application/json" \
-d '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionByBlockNumberAndIndex",
    "params": ["0x994219", "0x2"],
    "id": 1
}'
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x5b216d7ffc6e43111842d2ebdeb88ed5a1783321d14015f917b267f71280c4da","blockNumber":"0x994219","from":"0xdcb4651b5bbd105cda8d3ba5740b6c4f02b9256d","hash":"0xc294056321a85ee38e8efd7f2f7ce8935a0383b16dc0e825fde1adf6caf2a405","transactionIndex":"0x2","chainId":"0x190f1b45","gas":"0x10e5758fc","gasPrice":"0x1","input":"0x6057361d0000000000000000000000000000000000000000000000000000000000bc5c01","nonce":"0x3","to":"0xdb49e85e263614520115e14dbb3cfc85967ffc69","type":"0x0","value":"0x0","r":"0x3d71f0a68e2502d79315240190effacfc1a49d51710d974454d171233f396181","s":"0x73e75f25a534532367f55f9280e3717be1c8b2377ef23541116c7fd95919c317","v":"0x321e36ae"}}

0x994219=10043929 has only 1 transaction
https://assethub-westend.subscan.io/block/10043929

  1. Need bulk tracing debug_traceBlockByNumber
    for etherscan integration

  2. Need bulk receipts eth_getBlockReceipts
    for etherscan integration

Steps to reproduce

Tested out Westend hub RPC methods and have these issues to report

@sourabhniyogi sourabhniyogi added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 8, 2024
@sourabhniyogi sourabhniyogi changed the title [pallet-revive] eth-rpc issues [pallet-revive] eth-rpc issues: eth_getBlockByNumber / eth_getBlockByHash does not return transactions Dec 8, 2024
@Polkadot-Forum
Copy link

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/contracts-on-assethub-roadmap/9513/54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants