-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Majority Fork Protection #695
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
base: unstable
Are you sure you want to change the base?
Conversation
Claude finished @dknopik's task —— View job Code Review CompleteI've reviewed the Majority Fork Protection implementation. Here's my detailed analysis: Critical Bug Found 🐛Lines 689-692 in if value.target != our_value.target {
return Err(BeaconVoteValidationError::DifferentTarget {
our: our_value.source, // ❌ BUG: Should be our_value.target
proposed: value.source, // ❌ BUG: Should be value.target
});
} The error construction uses Fix: if value.target != our_value.target {
return Err(BeaconVoteValidationError::DifferentTarget {
our: our_value.target,
proposed: value.target,
});
} Code Quality AssessmentPositive aspects:
Issues identified:
Security Analysis ✓The implementation adds important Byzantine fault tolerance by preventing operators from proposing different source/target checkpoints. This protects against:
The validation correctly occurs before slashing protection checks, ensuring invalid proposals are rejected early. Performance ✓No performance concerns. The checkpoint comparisons are simple equality checks on fixed-size structures. Recommendations
VerdictThe implementation approach is sound and addresses the security issue correctly, but contains a critical bug in error reporting and lacks test coverage for the new validation logic. Action required: Please fix the bug and add tests before merging. |
@claude review this PR |
Claude encountered an error —— View job I'll analyze this and get back to you. |
@claude review this PR |
Claude finished @diegomrsantos's task —— View job Code Review In Progress
Tasks
Initial FindingsGood News: The critical bug identified in the previous review has been fixed! ✓ The error fields in lines 693-696 now correctly reference our: our_value.target,
proposed: value.target, The previous bug had |
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.
makes sense, looks good to me!
Issue Addressed
Proposed Changes
In the
BeaconVoteValidator
, which validatesBeaconVote
s proposed by other nodes, add a step to compare the source, and a step to compare the target, including epoch and checkpoing for each.Additional Info
Implements ssvlabs/ssv-spec#555.
See also the Go-SSV implementation: ssvlabs/ssv#2358