lite2: cross-check first header and update tests (#4471)

closes #4464
This commit is contained in:
Callum Waters
2020-02-26 12:56:20 +01:00
committed by GitHub
parent c4f7256766
commit 9231b52e0d
3 changed files with 42 additions and 21 deletions
@@ -2,6 +2,7 @@
## Changelog
* 13-02-2020: Initial draft
* 26-02-2020: Cross-checking the first header
## Context
@@ -62,7 +63,8 @@ func NewClient(
made to increase security by default. At least one witness is required,
although, right now, the light client does not check that primary != witness.
When cross-checking a new header with witnesses, minimum number of witnesses
required to respond: 1.
required to respond: 1. Note the very first header (`TrustOptions.Hash`) is
also cross-checked with witnesses for additional security.
Due to bisection algorithm nature, some headers might be skipped. If the light
client does not have a header for height `X` and `TrustedHeader(X)` or