-
Notifications
You must be signed in to change notification settings - Fork 103
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: duty scheduler indices change & reorg bleeps #1725
base: stage
Are you sure you want to change the base?
Conversation
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.
Minor suggestions.
func (h *AttesterHandler) shouldFetchNexEpoch(slot phase0.Slot) bool { | ||
return uint64(slot)%h.network.Beacon.SlotsPerEpoch() > h.network.Beacon.SlotsPerEpoch()/2-2 | ||
return uint64(slot)%h.network.Beacon.SlotsPerEpoch() >= h.network.Beacon.SlotsPerEpoch()/2-1 | ||
} |
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.
Would be nice to have this clarifying comment (for the reason for why we are doing this) here:
// If we have reached the mid-point of the epoch, fetch the duties for the next epoch in the next slot.
// This allows us to set them up at a time when the beacon node should be less busy.
also maybe fix typo shouldFetchNexEpoch
-> shouldFetchNextEpoch
if uint64(slot)%h.network.Beacon.SlotsPerEpoch() > h.network.Beacon.SlotsPerEpoch()/2-1 { | ||
h.fetchNextEpoch = true | ||
} |
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.
Can use if h.shouldFetchNexEpoch(...
here ? Although it uses >=
(would be nice to clarify which is the correct one).
// If we have reached the mid-point of the epoch, fetch the duties for the next epoch in the next slot. | ||
// This allows us to set them up at a time when the beacon node should be less busy. | ||
if uint64(slot)%slotsPerEpoch == slotsPerEpoch/2-1 { | ||
h.fetchNextEpoch = true | ||
} |
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.
Can use if h.shouldFetchNexEpoch(...
here ? I guess applies to other Duties changed in this PR too.
// last slot of epoch | ||
if uint64(slot)%slotsPerEpoch == slotsPerEpoch-1 { | ||
h.duties.Reset(epoch - 1) | ||
} |
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.
Would be nice to have helper func
similar to shouldFetchNexEpoch
for uint64(slot)%slotsPerEpoch == slotsPerEpoch-1
.
close #1724
close #1714
close #1807