-
Notifications
You must be signed in to change notification settings - Fork 24
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
Spec - New ValidatorRegistration/ValidatorExit duties stop old ones #317
Conversation
This reverts commit f14bfd0.
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.
LGTM
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.
👍
@@ -234,9 +234,10 @@ func (b *BaseRunner) hasRunningDuty() bool { | |||
} | |||
|
|||
func (b *BaseRunner) ShouldProcessDuty(duty *types.Duty) error { | |||
if b.QBFTController.Height >= qbft.Height(duty.Slot) && b.QBFTController.Height != 0 { | |||
// assume StartingDuty is not nil if state is not nil | |||
if b.State != nil && b.State.StartingDuty.Slot >= duty.Slot { |
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.
Why not just add b.QBFTController != nill check?
Why change it to the above which changes the whole logic
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.
While fixing the issue I thought about making things better.
- In general each validator duty runner can run only one duty at a time.
- There is no real reason to make rule (1) dependent on QBFT controller. If we do separation of concerns and processes it is unclear why the runner has to even have access to the internal state of QBFT controller.
- With my current change all duties (including the ones that aren't beacon duties) follow the exact same pattern. Because of the special exemptions we did to duties with no QBFT we ran into this issue.
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.
added a fallback that uses QBFTController just to get this approved
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.
From my perspective, indeed, the change makes module separation better and avoids the problem with the validator registration and exit duties
} | ||
r.BaseRunner.baseSetupForNewDuty(duty) | ||
return r.executeDuty(duty) | ||
return r.BaseRunner.baseStartNewDuty(r, duty) |
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.
Why is r.executeDuty removed?
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.
baseStartNewDuty
calls it
Replaced by #318 |
Description
Stalling ValidatorRegistration/ValidatorExit duties prevented the execution of new duties. Now when a duty that fits a higher slot comes in it stops the old one.
Affected tests
post_wrong_decided
- Deleted. Seems to be a duplicate ofpost_future_decided
. Unclear what "wrong" means in the context.post_future_decided
- renamed toold_slot_duty
. Now that we don't support future messages this is a more fitting name. Cases for missing duties added.Added missing cases to:
consensus_not_started
,duplicate_duty_finished
,duplicate_duty_not_finished
, andfinished
.