-
Notifications
You must be signed in to change notification settings - Fork 363
fix(tests): Fix estimate gas tests and linter #1394
Conversation
Warning Rate Limit Exceeded@itsdevbear has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 23 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. 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. WalkthroughThe updates involve changes to Ethereum's gas estimation for simple contracts and transfers, reducing the estimated gas required. Additionally, refactoring has been done in the Ethereum core precompile validation method to enhance code readability and modularity by introducing helper functions for argument validation. Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit's AI:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io (1 hunks)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-transfer.io (1 hunks)
- eth/core/precompile/method_validation.go (1 hunks)
Additional comments: 7
e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io (1)
- 2-2: The gas estimate for a simple contract deployment has been updated. Please ensure this new value is consistent with the actual gas used for these operations across the codebase.
Verification successful
The new gas value
0x520b
is found in two places within thee2e/hive/simulators/rpc-compat/tests
directory: in theestimate-simple-contract.io
file, which is part of theeth_estimateGas
test, and in thecreate-al-simple-contract.io
file, which is part of theeth_createAccessList
test. This indicates that the new gas value is being used consistently in at least two tests related to Ethereum RPC compatibility.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other occurrences of the old and new gas values to ensure consistency. rg --type json '0x6273' e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/ rg --type json '0x520b' e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/Length of output: 155
Script:
#!/bin/bash # Search for occurrences of the new gas value '0x520b' across the entire codebase. rg '0x520b'Length of output: 299
e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-transfer.io (1)
- 2-2: The gas estimate for a simple Ether transfer has been updated. Please ensure this new value is consistent with the actual gas used for these operations across the codebase.
Verification successful
The new gas estimate value '0x5208' is consistently used in at least two test files within the codebase, and there are no occurrences of the old value '0x6270'. This suggests that the update to the gas estimate is consistent with other parts of the codebase.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other occurrences of the old and new gas values to ensure consistency. rg --type json '0x6270' e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/ rg --type json '0x5208' e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/Length of output: 155
Script:
#!/bin/bash # Search for occurrences of the old and new gas values across the entire codebase. rg '0x6270' rg '0x5208'Length of output: 311
eth/core/precompile/method_validation.go (5)
43-55: The
validateArg
function has been refactored to delegate to new helper functions. Ensure that all cases are covered and that the switch statement is exhaustive.58-80: The new
validateArrayOrSlice
function checks for type mismatches and validates struct fields if necessary. Ensure that the logic correctly handles all array and slice types.82-91: The
validateSameKind
function checks for struct fields if the type is a struct. Confirm that this function is called correctly and that it handles all cases where the types should be the same.93-110: The
validatePointer
function ensures that pointer types are correctly matched and that struct fields are validated. Verify that the function is correctly used in all relevant cases.111-111: The
validateStruct
function is critical for ensuring that struct fields match between implementation and ABI. Confirm that it is robust and handles all struct comparisons correctly.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1394 +/- ##
==========================================
+ Coverage 48.19% 48.36% +0.16%
==========================================
Files 84 84
Lines 4959 4971 +12
==========================================
+ Hits 2390 2404 +14
+ Misses 2392 2391 -1
+ Partials 177 176 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- e2e/hive/simulators/rpc-compat/tests/eth_estimateGas/estimate-simple-contract.io
removing eth_estimateGas tests for now, due to the reduced depth of the bin search introduced into geth, I think they are always going to be flakey. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method validation refactor lgtm, utACK
Summary by CodeRabbit
Bug Fixes
Refactor