Skip to content

feat: Include support for getblockreceipts #3521

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

Merged
merged 27 commits into from
Mar 27, 2025

Conversation

konstantinabl
Copy link
Contributor

@konstantinabl konstantinabl commented Feb 27, 2025

Description:

This PR implements the eth_getBlockReceipts JSON-RPC method, which returns an array of all transaction receipts for a given block.

Implementation details:

  • New getBlockReceipts route added to ethRoutes
  • Added validation for the new endpoint
  • Added new getBlockReceipts method in EthImpl
  • Created unit tests in getBlockReceipts.spec.ts
  • Created e2e acceptance tests

Related issue(s):

Fixes #2613

Notes for reviewer:

Current implementation does not include synthtetic transactions

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@konstantinabl konstantinabl linked an issue Feb 27, 2025 that may be closed by this pull request
Copy link

github-actions bot commented Feb 27, 2025

Test Results

 19 files   -   4  245 suites   - 70   38m 55s ⏱️ - 34m 23s
623 tests +  4  617 ✅ + 15  4 💤 ±0  2 ❌  - 11 
722 runs   - 220  716 ✅  - 203  4 💤  - 2  2 ❌  - 15 

For more details on these failures, see this check.

Results for commit 8c39bea. ± Comparison against base commit d6d04e2.

This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both.
"before all" hook in "Debug API Test Suite" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests Debug API Test Suite "before all" hook in "Debug API Test Suite"
should execute "eth_getBlockReceipts" with block hash successfully ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests Block related RPC calls should execute "eth_getBlockReceipts" with block hash successfully
should execute "eth_getBlockReceipts" with block number successfully ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests Block related RPC calls should execute "eth_getBlockReceipts" with block number successfully
should execute "eth_getBlockReceipts" with tag "earliest" successfully ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests Block related RPC calls should execute "eth_getBlockReceipts" with tag "earliest" successfully
should execute "eth_getBlockReceipts" with tag "latest" successfully ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests Block related RPC calls should execute "eth_getBlockReceipts" with tag "latest" successfully
should throw error on "eth_getBlockReceipts" with invalid parameter passed ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests Block related RPC calls should throw error on "eth_getBlockReceipts" with invalid parameter passed

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl force-pushed the 2613-include-support-for-eth_getblockreceipts branch from 32fc01a to a4dae7e Compare March 5, 2025 09:06
@konstantinabl konstantinabl added this to the 0.68.0 milestone Mar 5, 2025
@konstantinabl konstantinabl force-pushed the 2613-include-support-for-eth_getblockreceipts branch from aebf800 to 56713b0 Compare March 5, 2025 19:56
@konstantinabl konstantinabl added the enhancement New feature or request label Mar 6, 2025
@konstantinabl konstantinabl marked this pull request as ready for review March 6, 2025 17:28
@konstantinabl konstantinabl requested review from Nana-EC and a team as code owners March 6, 2025 17:28
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.

LG left some questions.

Also, didn't see this eth_getBlockReceipts added to the list of rate limit methodConfig

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.

I’ve noticed that execution time is quite long. I haven’t analyzed it in depth yet, but I tested eth_getBlockReceipts with the hash 0xec04afbe85d980c67723e18121499dd9c32fce65ca06522baf4433d39ef00164, and it takes around 3000ms for e2e execution. eth_getBlockByHash with the same hash takes roughly 250ms.

I understand that retrieving receipts requires additional operations, but 3000ms is still quite high. Our performance tests show that most methods complete within a few hundred milliseconds.

Let’s review the implementation to ensure there are no unnecessary calls or inefficiencies.

Also with that said please add this to k6 as well.

@konstantinabl
Copy link
Contributor Author

konstantinabl commented Mar 17, 2025

I’ve noticed that execution time is quite long. I haven’t analyzed it in depth yet, but I tested eth_getBlockReceipts with the hash 0xec04afbe85d980c67723e18121499dd9c32fce65ca06522baf4433d39ef00164, and it takes around 3000ms for e2e execution. eth_getBlockByHash with the same hash takes roughly 250ms.

I understand that retrieving receipts requires additional operations, but 3000ms is still quite high. Our performance tests show that most methods complete within a few hundred milliseconds.

Let’s review the implementation to ensure there are no unnecessary calls or inefficiencies.

Also with that said please add this to k6 as well.

The request took 1 second for me with this hash. How did you send it ?
@quiet-node

Also added a k6 test, tell me if its good enough https://github.com/hashgraph/hedera-json-rpc-relay/pull/3521/files#diff-ea2bf404fda3277c2324aa1ca400f86a65e4a433dc59a4710e086dfdc39f2bdcR9

@quiet-node
Copy link
Contributor

quiet-node commented Mar 17, 2025

I’ve noticed that execution time is quite long. I haven’t analyzed it in depth yet, but I tested eth_getBlockReceipts with the hash 0xec04afbe85d980c67723e18121499dd9c32fce65ca06522baf4433d39ef00164, and it takes around 3000ms for e2e execution. eth_getBlockByHash with the same hash takes roughly 250ms.
I understand that retrieving receipts requires additional operations, but 3000ms is still quite high. Our performance tests show that most methods complete within a few hundred milliseconds.
Let’s review the implementation to ensure there are no unnecessary calls or inefficiencies.
Also with that said please add this to k6 as well.

The request took 1 second for me with this hash. How did you send it ? @quiet-node

Also added a k6 test, tell me if its good enough https://github.com/hashgraph/hedera-json-rpc-relay/pull/3521/files#diff-ea2bf404fda3277c2324aa1ca400f86a65e4a433dc59a4710e086dfdc39f2bdcR9

@konstantinabl Hmmm I tried it with a random hash 0x94621f0983144976ef7636314e755535185220ade81e0a9b7bd91c78d17be9e3 and got to 2900ms
image

edited: Might have been network congestion or something similar. Tested it again and got around 1200 ms. I was pretty sure it consistently reached up to 3000 ms back then. Your new updates might have reduced the end-to-end time.

@konstantinabl
Copy link
Contributor Author

konstantinabl commented Mar 17, 2025

I’ve noticed that execution time is quite long. I haven’t analyzed it in depth yet, but I tested eth_getBlockReceipts with the hash 0xec04afbe85d980c67723e18121499dd9c32fce65ca06522baf4433d39ef00164, and it takes around 3000ms for e2e execution. eth_getBlockByHash with the same hash takes roughly 250ms.
I understand that retrieving receipts requires additional operations, but 3000ms is still quite high. Our performance tests show that most methods complete within a few hundred milliseconds.
Let’s review the implementation to ensure there are no unnecessary calls or inefficiencies.
Also with that said please add this to k6 as well.

The request took 1 second for me with this hash. How did you send it ? @quiet-node
Also added a k6 test, tell me if its good enough https://github.com/hashgraph/hedera-json-rpc-relay/pull/3521/files#diff-ea2bf404fda3277c2324aa1ca400f86a65e4a433dc59a4710e086dfdc39f2bdcR9

@konstantinabl Hmmm I tried it with a random hash 0x94621f0983144976ef7636314e755535185220ade81e0a9b7bd91c78d17be9e3 and got to 2900ms image

edited: Might have been network congestion or something similar. Tested it again and got around 1200 ms. I was pretty sure it consistently reached up to 3000 ms back then. Your new updates might have reduced the end-to-end time.

So are we fine with this or should I try improving it, its kinda slow really, but could be worse @quiet-node @Ferparishuertas

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.

Left some questions and suggestions

@konstantinabl konstantinabl force-pushed the 2613-include-support-for-eth_getblockreceipts branch from 57c9dc0 to ef26ec9 Compare March 18, 2025 08:34
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.

Great! Definitely less cluttered now! Just left some small suggestions and we should be good to go

@konstantinabl konstantinabl force-pushed the 2613-include-support-for-eth_getblockreceipts branch from 15dd46e to 7ba57d2 Compare March 19, 2025 11:27
Konstantina and others added 20 commits March 26, 2025 19:56
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
…t tests

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
This reverts commit cad15bb.

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
@konstantinabl konstantinabl force-pushed the 2613-include-support-for-eth_getblockreceipts branch from 99357d6 to 8c39bea Compare March 26, 2025 17:57
@konstantinabl konstantinabl merged commit 9d0534e into main Mar 27, 2025
38 of 40 checks passed
@konstantinabl konstantinabl deleted the 2613-include-support-for-eth_getblockreceipts branch March 27, 2025 07:58
@github-project-automation github-project-automation bot moved this from Backlog to Done in Smart Contract Sprint Board Mar 27, 2025
@acuarica acuarica modified the milestones: 0.68.0, 0.67.0 Apr 22, 2025
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.

Include support for eth_getBlockReceipts
5 participants