Resolve "Warp sync: use WithTarget from trusted checkpoint"
Add support for warp sync from a trusted checkpoint header so nodes can skip GRANDPA proof download when a known-good checkpoint is available: Closes #464 (closed).
-
node/src/service.rsnow builds warp sync config from three sources, in order:-
--no-checkpointkeeps the previous behavior and uses the network provider -
--warp-checkpoint-header <path>loads a trusted header from a JSON file - otherwise the node uses an embedded checkpoint selected from the active network feature (
g1,gdev, orgtest)
-
-
node/src/cli.rsadds the new operator flags--warp-checkpoint-headerand--no-checkpoint, and makes them mutually exclusive. - Embedded checkpoint files were added under
node/specs/:-
g1andgtestnow ship a concrete checkpoint header -
gdevships a zeroed placeholder header; the service detects this and falls back to the network provider instead of forcing an invalid target
-
-
scripts/update-warp-checkpoint.shwas added to refresh checkpoint files from the network specs:- it downloads RPC endpoints for
g1,gdev, orgtest - picks a reference finalized head and targets
finalized - 10 - compares hashes/headers across usable RPC endpoints
- writes the checkpoint file only when endpoints agree, or after interactive confirmation if a strict majority exists
- it downloads RPC endpoints for
-
scripts/README.mddocuments the new checkpoint update script.
Edited by Éloïs