-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Describe the bug
When requesting a LightClientFinalityUpdate
via the beacon_chain RPC the endpoints sometimes returns an update with only a few entries in the sync committee (as shown in the screenshots). I'm not sure if this is a bug in Nimbus, but I can't think of anything where such a FinalityUpdate would be useful.
According to the consensus specs light clients should:
- check the validity of such updates (see
process_light_client_update
), - update
store.best_valid_update
- update
store.current_max_active_participants
if the update has more participants set (which should never get this low), - update the optimistic header (if the light client wants this updated asap he'd use
LightClientOptimisticUpdate
and - apply the update (and thus the finalized header) if the sync committee is large enough (2/3).
Please correct me if I understood something wrong in the consensus specs or if there is another reason why LightClientFinalityUpdate
with less than 2/3 of the sync committee would be useful. My current best guess is that it isn't useful at all and probably shouldn't be returned by the /eth/v1/beacon/light_client/finality_update
rpc endpoint. I can easily check for the sync committee size to avoid this issue, instead of just checking the finalized blocknumber, which I mainly do to avoid unnecessary communication internally (I don't care about the optimistic updates/blocks/data).
I don't know if this also affects the subscription (I'll likely change it to use the subscription at some point, but for now I'm polling the rpc endpoint).
It could of course also be that my script is wrong and doesn't decode the sync committee correctly, hence the question of whether I understood something wrong when reading the consensus-specs.
To Reproduce
Steps to reproduce the behavior:
- Platform details (OS, architecture): Arch Linux, x86 (shouldn't be relevant since this is about the API and I'm using the http://unstable.prater.beacon-api.nimbus.team/ node.
- Branch/commit used: N/A (I don't know which version that node uses currently, I've tested it today).
- Commands being executed: Custom code that polls this RPC endpoint every 12 seconds, prints the sync committee size of the update
I additionally gives these updates to a light client if the finalized block number changed. Sometimes this then didn't apply the update, which is how I found this.
Screenshots (logs from my application)
Log output of an application polling the RPC endpoint every 12 seconds and outputting the sync committee size:
Log output showing the situation I've found: A finality update with <2/3 sync_committee (the first one I received with a new finalized_header..execution.block_number
), together with debug logs of the light client showing that the sync committee was the reason that the update was not applied.
Additional Info
This seems to happen quite regularly, most Epochs give me a FinalityUpdate with less than 2/3 sync committees.