Closed m-Peter closed 1 month ago
[!WARNING]
Rate limit exceeded
@sideninja has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 26 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between f084214f0f318a9f2ed2202bab836fcc08dd280c and 2ba5919c4db4667b8e6acbd71dd5ac231ed59635.
The recent changes enhance the accuracy of the gas usage calculation in the blockchain API. The method prepareBlockResponse
now relies on the GasUsed
property from transaction receipts instead of the Gas
property specified in transactions. This adjustment ensures that the gas consumed reflects actual usage during block execution. Additionally, test cases have been expanded to validate both transactions and their receipts, increasing the robustness of the testing framework.
Files | Change Summary |
---|---|
api/api.go |
Modified prepareBlockResponse to calculate total gas used from the transaction receipt instead of the transaction. |
tests/web3js/eth_non_interactive_test.js |
Expanded tests to validate both transactions and their receipts, ensuring correct gas usage tracking. |
Objective | Addressed | Explanation |
---|---|---|
Calculation of gasUsed field for blocks is inaccurate (#443) |
✅ |
🐇 In the meadow, I hop with delight,
New gas calculations shine oh so bright!
From receipts we learn what truly was spent,
A clearer picture, our API's new intent.
With tests that are stronger, our code is now sound,
Hopping through changes, joyfully bound! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes: https://github.com/onflow/flow-evm-gateway/issues/443
Description
When calculating the block's
gasUsed
, we mistakenly used thegas
limit set by the transaction author, and not thegasUsed
from the transaction's receipt.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes