Crate tendermint_light_client_detector

Crate tendermint_light_client_detector 

Source
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 ErrorDetail for all the possible error variants.
LightClientAttackEvidence
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§

CompareError
An error that arised when comparing a header from the primary with a header from a witness with compare_new_header_with_witness.
ErrorDetail
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.