-
-
Notifications
You must be signed in to change notification settings - Fork 810
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: calldatasize < 4 reverting instead of going to fallback #3408
fix: calldatasize < 4 reverting instead of going to fallback #3408
Conversation
in the case that a selector matches calldata with less than 4 bytes, it currently will revert instead of going to the fallback. this commit fixes the behavior in the special case where no data besides the method id is expected in the calldata. note this change in behavior was originally introduced in 02339df.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3408 +/- ##
==========================================
- Coverage 88.96% 88.90% -0.07%
==========================================
Files 86 86
Lines 10765 10804 +39
Branches 2445 2454 +9
==========================================
+ Hits 9577 9605 +28
- Misses 786 801 +15
+ Partials 402 398 -4
... and 15 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
in the case that a selector matches calldata with less than 4 bytes, it currently will revert instead of going to the fallback. this commit fixes the behavior in the special case where no data besides the method id is expected in the calldata.
note this regression was originally introduced in 02339df.
What I did
How I did it
in the case where expected calldatasize == 4, we do not expect any extra data. therefore, if calldatasize < 4, we can assume the selector is wrong and go to fallback instead of reverting as if we were doing calldata validation.
How to verify it
see the test. calling
fow()
with the leading 3 bytes of the selector (i.e.,0xd88e0b
instead of0xd88e0b00
) currently reverts on master, while on this branch it correctly goes to the fallback function.Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture