-
Notifications
You must be signed in to change notification settings - Fork 97
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(MessageValidation): first slot proposals [stage] #1886
base: stage
Are you sure you want to change the base?
Conversation
test TBD |
@@ -155,7 +155,7 @@ func (mv *messageValidator) validatePartialSigMessagesByDutyLogic( | |||
} | |||
} | |||
|
|||
if err := mv.validateBeaconDuty(signedSSVMessage.SSVMessage.GetID().GetRoleType(), messageSlot, committeeInfo.indices); err != nil { | |||
if err := mv.validateBeaconDuty(role, messageSlot, committeeInfo.indices, &partialSignatureMessages.Type); err != nil { |
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.
following the above comment
if err := mv.validateBeaconDuty(role, messageSlot, committeeInfo.indices, &partialSignatureMessages.Type); err != nil { | |
if err := mv.validateBeaconDuty(role, messageSlot, committeeInfo.indices, &partialSignatureMessages.Type == spectypes.RandaoPartialSig); err != nil { |
message/validation/common_checks.go
Outdated
// Rule: For a proposal duty message, we check if the validator is assigned to it | ||
if role == spectypes.RoleProposer { | ||
epoch := mv.netCfg.Beacon.EstimatedEpochAtSlot(slot) | ||
if partialMessageType != nil && *partialMessageType == spectypes.RandaoPartialSig { |
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.
following other comments
if partialMessageType != nil && *partialMessageType == spectypes.RandaoPartialSig { | |
if rando && !mv.dutyStore.Proposer.IsEpochSet(epoch) { |
message/validation/common_checks.go
Outdated
@@ -117,10 +117,20 @@ func (mv *messageValidator) validateBeaconDuty( | |||
role spectypes.RunnerRole, | |||
slot phase0.Slot, | |||
indices []phase0.ValidatorIndex, | |||
partialMessageType *spectypes.PartialSigMsgType, |
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 feel this could be just replaced with a boolean? and do the check outside. since you only use it to see if its a randao message. this could just be randao bool
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.
just a simplification. and we need to ad some test in msg validation code I guess.
close #1827
Solution:
Don't ignore first slot proposal pre-consensus messages (randao) as long as the ProposerHandler has not fetched the duties.
The impact of this change from an attack perspective is minor, as the attacker must be part of the committee (i.e., possess a private key)