Open
Description
To enable users to start from an older block hash, light client data should be made available via Checkpointz.
- Light client sync protocol: https://github.com/ethereum/beacon-APIs/tree/master/apis/beacon/light_client
- Nimbus server documentation: https://nimbus.guide/light-client-data.html
- Nimbus example client: https://nimbus.guide/trusted-node-sync.html#verify-the-downloaded-state-through-the-nimbus-light-client (pass
--trusted-block-root
duringnimbus_beacon_node trustedNodeSync
to use LC api) - Explanation video: https://www.youtube.com/watch?v=ZHNrAXf3RDE
The light client sync protocol allows to take a very old block root, and transform it into a recent one, without requiring the user to manually copy/paste checkpoint block roots around.
This is more secure than genesis sync, and also more secure than downloading a random finalized
state from a third party without validation.
Required APIs that Checkpointz would have to cache and serve:
/eth/v1/beacon/light_client/bootstrap/{block_root}
- about 25 KB each- Has to be cached for each finalized checkpoint, including ones in the past. Should persist these for a really long time (months), these don't expire.
/eth/v1/beacon/light_client/updates
- about 25 KB each- This is a range query with start+count. Historical entries (older than 256 epochs) don't change. The latest entry may rarely change. It is good enough to only cache and make available historical entries (without the most recent one). Should persist these for a really long time (months), these don't expire.
- Different clients may request different ranges of the data, and the cache should be prepared for that; e.g., cache each period separately so that requests from 20-40 and 15-35 can be served from the same database without requiring separate caches for each possible range.
/eth/v1/beacon/light_client/finality_update
- about 2 KB- This changes each time new finalized checkpoint block is reached. Can expire the cache every epoch (or every time finality changes), and only need to keep the most recent one around for this.
Bonus APIs for full light client data availability:
/eth/v1/beacon/light_client/optimistic_update
- about 1 KB- Changes every slot; not essential for checkpoint syncing but is a nice to have for light client syncing (e.g., web browser wallets).
- Could be faked by using the
finalized_update
response and omittingfinalized_header
andfinality_branch
in the response. This could work around client limitations when only a partial light client API is available on the server
/eth/v1/events
light_client_finality_update
andlight_client_optimistic_update
- Push mechanism for
finality_update
andoptimistic_update
. Don't think checkpointz is used for that, but if eventstream is supported, would be great to also have access to these two topics. They provide the same data as/eth/v1/beacon/light_client/finality_update
and/eth/v1/beacon/light_client/optimistic_update
.
Metadata
Assignees
Labels
No labels