Resubscribe to beacon subnets if current epoch dependent root changed #6034
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.
Describe the bug
We have this function
handleAttesterDutiesReorg
which is mostly called when head (onNewHead
) is updatedlodestar/packages/validator/src/services/attestationDuties.ts
Line 348 in 1aa6561
In both those cases we handle the reorg by
getAttesterDuties
)dutiesByIndexByEpoch
)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.lodestar/packages/validator/src/services/attestationDuties.ts
Line 196 in 1aa6561
However, this is an issue if dependent root for current epoch changed as previous subscriptions are no longer valid
is_aggregator
results are differentExpected 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)
The text was updated successfully, but these errors were encountered: