-
Notifications
You must be signed in to change notification settings - Fork 342
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
fix(eth): Fix issue with validateArg() under certain scenarios #1393
Conversation
…Solidity functions
WalkthroughThe update introduces a new validation check to ensure that array types in Ethereum smart contract precompiles match their corresponding ABI definitions. If there's a type mismatch for arrays or slices, the system now catches this error and provides a detailed message. Additionally, the test suite has been expanded to include a scenario that verifies this new validation logic is functioning correctly. 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 (2)
- eth/core/precompile/method_validation.go (1 hunks)
- eth/core/precompile/method_validation_test.go (1 hunks)
Additional comments: 2
eth/core/precompile/method_validation_test.go (1)
- 65-72: The new test case correctly checks for a type mismatch error when an array (
sliceA
) and a scalar (sliceB
) are compared. This aligns with the PR objectives to enhance robustness in type checking.eth/core/precompile/method_validation.go (1)
- 43-48: The added code correctly checks for type mismatches between arrays or slices, returning a detailed error if they do not match. This is a crucial update for preventing runtime panics due to type mismatches.
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.
fire af lfg
…hain#1393) Certain overloaded solidity functions in precompiles can cause `validateArg()` to panic <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Enhanced validation for argument types in smart contract methods to prevent mismatches, ensuring that arrays and slices are correctly checked for type consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Certain overloaded solidity functions in precompiles can cause
validateArg()
to panicSummary by CodeRabbit