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

feature: (alan) filter committee duties per slot validator duties #467

Merged
merged 6 commits into from
Jul 22, 2024
Merged
9 changes: 8 additions & 1 deletion ssv/committee.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ func (c *Committee) StartDuty(duty *types.CommitteeDuty) error {
if _, exists := c.Runners[duty.Slot]; exists {
return errors.New(fmt.Sprintf("CommitteeRunner for slot %d already exists", duty.Slot))
}
c.Runners[duty.Slot] = c.CreateRunnerFn(c.Share)
dutyShares := make(map[spec.ValidatorIndex]*types.Share)
for _, bduty := range duty.ValidatorDuties {
if _, exists := c.Share[bduty.ValidatorIndex]; !exists {
return fmt.Errorf("no share for validator %d", bduty.ValidatorIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be continue simply?
are we sure we want to fail the run just because of one miss?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, from the spec perspective, I would also say continue is better. On the other hand, in ssv, it's strange that the operator doesn't the share for the duty since he requested the duty for this validator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree

}
dutyShares[bduty.ValidatorIndex] = c.Share[bduty.ValidatorIndex]
}
c.Runners[duty.Slot] = c.CreateRunnerFn(dutyShares)
return c.Runners[duty.Slot].StartNewDuty(duty, c.CommitteeMember.GetQuorum())
}

Expand Down