-
Notifications
You must be signed in to change notification settings - Fork 140
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(state-transition): enforce valid eth1 withdrawal credentials #2231
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2231 +/- ##
==========================================
- Coverage 29.56% 29.53% -0.04%
==========================================
Files 353 353
Lines 16103 16149 +46
Branches 20 20
==========================================
+ Hits 4761 4769 +8
- Misses 11026 11062 +36
- Partials 316 318 +2
|
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.
I have a major concern about handling of deposit with wrong credentails. I think we should skip them, not fail the whole block
// Verify that the deposit has the ETH1 withdrawal credentials. | ||
if dep.GetWithdrawalCredentials()[0] != types.EthSecp256k1CredentialPrefix { | ||
return errors.New( | ||
"deposit does not have ETH1 withdrawal credentials", | ||
) | ||
} |
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.
not sure we should err here. Similarly to what we do with faulty signature, I think this deposit should be skipped and the others be duly processed
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.
done
State Transition Changes:
0x01
byte prefix in their withdrawal credentialsExpectedWithdrawals
only convert Credentials to Address if we know for sure it has the0x01
byte prefix (to avoid erroring out)No explicit backwards compatibility handling technically required since on bartio and boonet we do not encounter any deposits with a non
0x01
byte prefix in their withdrawal credentials