Expand description
The detector component of the light client detects and handles attacks on the light client.
See detect_divergence
for the main entry point.
Structs§
- A divergence between the primary and a witness that has been detected in
detect_divergence
. - Error type for the light client detector. See
ErrorDetail
for all the possible error variants. - Light client attack evidence
- A interface over a light client instance and its RPC client.
- A trace of the light blocks that were used by the light client to verify a particular header, in the case of bisection or sequential verification.
Enums§
- An error that arised when comparing a header from the primary with a header from a witness with
compare_new_header_with_witness
. - All the possible error variants.
- Evidence of malfeasance by validators (i.e. signing conflicting votes or light client attack).
Functions§
- Takes the verified header from the primary and compares it with a header from a specified witness. The function can return one of three errors:
- Given a primary trace and a witness, detect any divergence between the two, by querying the witness for the same header as the last header in the primary trace (ie. the target block), and comparing the hashes.
- Handles the primary style of attack, which is where a primary and witness have two headers of the same height but with different hashes.