-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Motivation:
The process of finding correct light client trust needed for the consensus state sync is manual and tedious.
Feature request:
Add a new command to the oasis cli that displays appropriate light client trust.
Context:
- Light client trust period must be lower than debonding period (336 epoch, ~2 weeks) to prevent long range attacks.
- Checkpointing frequency is defined by the consensus parameters and currently happens 1/week.
- I.e. unless manually modified all nodes create checkpoints at the same heights.
- Node does a state sync by first requesting available checkpoints from its peers. To prevent spam, it first validates advertised checkpoint and the corresponding root by comparing it to the light client root at a given height.
As a consequence, one must configure sufficiently old light client trust (height, hash and period), so that there will be corresponding light client header available for at least one checkpoint advertised by the p2p network. Finally, trust period must be be longer than the age of configured trusted header, else a checkpoint that happened recently would fall out of trust period interval.
Proposed solution:
Query consensus parameters (debonding period, block frequency, checkpoint interval). Calculate appropriate trusted period and trusted height. Finally, query block header for the trusted height (trusted hash).
For the current set of parameters, I would expect this command to return trust period of ~12 days, and trusted height that is ~10 days old.
Alternative solution:
Less optimal, once oasisprotocol/oasis-core#5823 is merged you will be able to query node's local checkpoint heights from the status. In case node is not creating checkpoints we could add a separate method to the node that queries checkpoints using its p2p client. This seems quite a lot of work for smtg that can be done simpler.