Skip to content
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

Open
wants to merge 5 commits into
base: stage
Choose a base branch
from

Conversation

olegshmuelov
Copy link
Contributor

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)

@olegshmuelov olegshmuelov self-assigned this Nov 27, 2024
@olegshmuelov olegshmuelov linked an issue Nov 27, 2024 that may be closed by this pull request
@olegshmuelov olegshmuelov marked this pull request as ready for review November 27, 2024 12:39
@olegshmuelov
Copy link
Contributor Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following the above comment

Suggested change
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 {

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following other comments

Suggested change
if partialMessageType != nil && *partialMessageType == spectypes.RandaoPartialSig {
if rando && !mv.dutyStore.Proposer.IsEpochSet(epoch) {

@@ -117,10 +117,20 @@ func (mv *messageValidator) validateBeaconDuty(
role spectypes.RunnerRole,
slot phase0.Slot,
indices []phase0.ValidatorIndex,
partialMessageType *spectypes.PartialSigMsgType,
Copy link
Contributor

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

Copy link
Contributor

@y0sher y0sher left a 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.

@nkryuchkov nkryuchkov changed the title fix(MessageValidation): first slot proposals fix(MessageValidation): first slot proposals [stage] Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missed first slot proposals (Rare Case)
3 participants