Revise participation tracking in light client #2810
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current mechanism to track historic sync committee participation is
suboptimal in these aspects:
LightClientUpdate
are fetched across multiple synccommittee periods. The sync participation may change drastically over
time. If any of those synced periods had unusually high participation
and is followed by periods of unusually low participation, this may
prevent optimistic header updates until
current_slot
has advancedsufficiently (from the sync time, not from the update time).
process_slot_for_light_client_store
needs to be called for all missed slots after resuming, which is not
practical (optimizations would be possible).
This patch changes the rollover of the tracked participation to happen
whenever the
store.finalized_header
's sync committee period advances.While in sync with the network, rollovers happen at the same frequency
as before, but this guarantees that participation is no longer mixed
across multiple sync committee periods, avoiding the problems above.