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

Resubscribe to beacon subnets if current epoch dependent root changed #6034

Open
nflaig opened this issue Oct 12, 2023 · 0 comments
Open

Resubscribe to beacon subnets if current epoch dependent root changed #6034

nflaig opened this issue Oct 12, 2023 · 0 comments
Labels
good first issue Issues that are suitable for first-time contributors. help wanted The author indicates that additional help is wanted. meta-bug Issues that identify a bug and require a fix. prio-low This is nice to have.

Comments

@nflaig
Copy link
Member

nflaig commented Oct 12, 2023

Describe the bug

We have this function handleAttesterDutiesReorg which is mostly called when head (onNewHead) is updated

  • and dependent root for next epoch changed
  • or dependent root for current epoch changed

private async handleAttesterDutiesReorg(

In both those cases we handle the reorg by

  • getting updated attestater duties (getAttesterDuties)
  • update cached duties (dutiesByIndexByEpoch)
  • recalculate proof (is_aggregator)

But I noticed we are not resubscribing to beacon subnets (prepareBeaconCommitteeSubnet). This is not an issue if the dependent root for the next epoch changed as we re-/subscribe to current (N) and next epoch (N+1) at the start of each epoch.

for (const epoch of [currentEpoch, nextEpoch]) {

However, this is an issue if dependent root for current epoch changed as previous subscriptions are no longer valid

  • validator duties changed (slot, committee index, etc.)
  • is_aggregator results are different

Expected behavior

Validators should be resubscribed to beacon committee subnets if current epoch dependent root changed.

Ideally, should just always resubscribe when handleAttesterDutiesReorg is called even if dependent root for next epoch changed as the subscriptions for epoch N+1 are outdated as well and the sooner we subscribe to subnets, the more likely it is to find good peers.

Steps to reproduce

No response

Additional context

No response

Operating system

Linux

Lodestar version or commit hash

v1.11.3 / unstable (1aa6561)

@nflaig nflaig added the meta-bug Issues that identify a bug and require a fix. label Oct 12, 2023
@nflaig nflaig changed the title Validators are not resubscribed to subnets if current epoch dependent root changed Resubscribe to beacon subnets if current epoch dependent root changed Oct 12, 2023
@nflaig nflaig added the prio-low This is nice to have. label Jan 20, 2024
@nflaig nflaig added the good first issue Issues that are suitable for first-time contributors. label Aug 3, 2024
@philknows philknows added the help wanted The author indicates that additional help is wanted. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. help wanted The author indicates that additional help is wanted. meta-bug Issues that identify a bug and require a fix. prio-low This is nice to have.
Projects
None yet
Development

No branches or pull requests

2 participants