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: duty scheduler indices change & reorg bleeps #1725

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

Conversation

olegshmuelov
Copy link
Contributor

@olegshmuelov olegshmuelov commented Sep 11, 2024

close #1724
close #1714
close #1807

@olegshmuelov olegshmuelov linked an issue Sep 11, 2024 that may be closed by this pull request
@olegshmuelov olegshmuelov self-assigned this Sep 11, 2024
@olegshmuelov olegshmuelov requested a review from y0sher September 11, 2024 12:52
@olegshmuelov olegshmuelov marked this pull request as ready for review September 11, 2024 13:40
@olegshmuelov olegshmuelov linked an issue Sep 15, 2024 that may be closed by this pull request
Copy link
Contributor

@iurii-ssv iurii-ssv left a comment

Choose a reason for hiding this comment

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

Minor suggestions.

Comment on lines 303 to 305
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
}
Copy link
Contributor

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

Comment on lines +96 to +98
if uint64(slot)%h.network.Beacon.SlotsPerEpoch() > h.network.Beacon.SlotsPerEpoch()/2-1 {
h.fetchNextEpoch = true
}
Copy link
Contributor

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).

Comment on lines +176 to +180
// 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
}
Copy link
Contributor

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.

Comment on lines +182 to +185
// last slot of epoch
if uint64(slot)%slotsPerEpoch == slotsPerEpoch-1 {
h.duties.Reset(epoch - 1)
}
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants