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§
- Divergence
- A divergence between the primary and a witness that has been detected in
detect_divergence. - Error
- Error type for the light client detector. See
ErrorDetailfor all the possible error variants. - Light
Client Attack Evidence - Light client attack evidence
- Provider
- A interface over a light client instance and its RPC client.
- Trace
- 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§
- Compare
Error - An error that arised when comparing a header from the primary with a header from a witness
with
compare_new_header_with_witness. - Error
Detail - All the possible error variants.
- Evidence
- Evidence of malfeasance by validators (i.e. signing conflicting votes or light client attack).
Functions§
- compare_
new_ header_ with_ witness - 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:
- detect_
divergence - 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.
- gather_
evidence_ from_ conflicting_ headers - Handles the primary style of attack, which is where a primary and witness have two headers of the same height but with different hashes.