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

Ensure light client optimistic_header to be at head #2814

Merged
merged 1 commit into from
Feb 9, 2022
Merged

Ensure light client optimistic_header to be at head #2814

merged 1 commit into from
Feb 9, 2022

Conversation

etan-status
Copy link
Contributor

When a light client updates its finalized_header using a forced update
because of the timeout, and the new header was not signed by enough sync
committee participants to pass get_safety_threshold(store), it may
occur that store.finalized_header.slot > store.optimistic_header.slot.
This patch ensures that the optimistic_header is updated to the latest
finalized_header if that happens, so that it always indicates the
latest known and accepted head.

When a light client updates its `finalized_header` using a forced update
because of the timeout, and the new header was not signed by enough sync
committee participants to pass `get_safety_threshold(store)`, it may
occur that `store.finalized_header.slot > store.optimistic_header.slot`.
This patch ensures that the `optimistic_header` is updated to the latest
`finalized_header` if that happens, so that it always indicates the
latest known and accepted head.
Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

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

lgtm

@djrtwo djrtwo merged commit 5a09b5f into ethereum:dev Feb 9, 2022
@etan-status etan-status deleted the lc-opt-fin branch February 10, 2022 11:49
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Mar 15, 2022
Adds the additional check to ensure `optimistic_header` is always after
`finalized_header` in `LightClientStore`, as introduced to the spec in
ethereum/consensus-specs#2814
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Mar 15, 2022
Adds the additional check to ensure `optimistic_header` is always after
`finalized_header`, as introduced to the spec in:
ethereum/consensus-specs#2814
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Mar 16, 2022
Adds the additional check to ensure `optimistic_header` is always after
`finalized_header` in `LightClientStore`, as introduced to the spec in
ethereum/consensus-specs#2814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants