-
Notifications
You must be signed in to change notification settings - Fork 990
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
Allow light client to verify signatures at period boundary #2805
Conversation
Rebased to |
Rebased to |
Change method in which information about signing sync committee is included into the Before:
After:
|
|
As the sync committee signs the previous block, the situation arises at every sync committee period boundary, that the new sync committee signs a block in the previous sync committee period. The light client cannot reliably detect this condition (e.g., assume that this is the case when it is currently on the last slot of a sync committee period), because the last couple slots of a sync committee period may not have a block. For example, when receiving a `LightClientUpdate` that is constructed as in the following illustration, it is unknown whether `sync_aggregate` was signed by the current or next sync committee at `attested_header`. ``` slot N N + 1 | N + 2 (slot not sent!) | +-----------------+ \ / | +----------------+ | attested_header | <--- X ----|---- | sync_aggregate | +-----------------+ / \ | +----------------+ missed | | sync committee period boundary ``` This patch addresses this edge case by including the slot at which the `sync_aggregate` was created into the `LightClientUpdate` object. Note that the `signature_slot` cannot be trusted beyond the purpose of signature verification, as it could be manipulated to any other slot within the same sync committee period and fork version, without making the `sync_aggregate` invalid.
I have not done a review of the changes but just going off the PR description: it seems like we could use the what do you think about this? |
The |
ah good point, then I think adding the target slot makes a lot of sense :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the super late review @etan-status. Well done. LGTM!
As the sync committee signs the previous block, the situation arises at
every sync committee period boundary, that the new sync committee signs
a block in the previous sync committee period. The light client cannot
reliably detect this condition (e.g., assume that this is the case when
it is currently on the last slot of a sync committee period), because
the last couple slots of a sync committee period may not have a block.
For example, when receiving a
LightClientUpdate
that is constructedas in the following illustration, it is unknown whether
sync_aggregate
was signed by the current or next sync committee at
attested_header
.This patch addresses this edge case by including the slot at which the
sync_aggregate
was created into theLightClientUpdate
object.Note that the
signature_slot
cannot be trusted beyond the purpose ofsignature verification, as it could be manipulated to any other slot
within the same sync committee period and fork version, without making
the
sync_aggregate
invalid.