-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Caplin downloader sync
battlmonstr edited this page Nov 2, 2023
·
2 revisions
- Unofficial beacon chain checkpoint sync REST API - allows to get every 32nd block (gaps could be more than 32 sometimes). The last checkpoint is 96 blocks behind the tip. It is a centralized API and requires us to hardcode trusted server IPs. We trust that the blocks they return belong to the canonical chain. The blocks that it returns contain an EL header hash that is needed for verification.
- eth2 P2P API (libp2p-based) - allows to get all block bodies, but we don't trust them. We need to stitch them with the checkpoint blocks from (1) in order to verify them.
- Official beacon chain API - returns a "beacon state" which contains only the last EL header hash (tip of the canonical chain). We trust it, because it is signed by validators.
- Downloads all checkpoint blocks from (1)
- Fills the gaps between the checkpoints from (2). Bodies are downloaded, headers are derived from bodies.
- Pushes all the headers and bodies through the
execution.proto
GRPC API to erigon EL. - The EL headers/bodies downloader stages act as a passive intake inserting headers/bodies into the db.
TODO: describe what happens after the last checkpoint for the last 96 blocks