Concepts
Evidence
Any concrete type of evidence submitted to the x/evidence
module must fulfill the Evidence
contract outlined below. Not all concrete types of evidence will fulfill this contract in the same way and some data may be entirely irrelevant to certain types of evidence.
An additional ValidatorEvidence
, which extends Evidence
, has also been created to define a contract for evidence against malicious validators.
Registration & Handling
The x/evidence
module must first know about all types of evidence it is expected to handle. This is accomplished by registering the Route
method in the Evidence
contract with what is known as a Router
(defined below). The Router
accepts Evidence
and attempts to find the corresponding Handler
for the Evidence
via the Route
method.
The Handler
(defined below) is responsible for executing the entirety of the business logic for handling Evidence
. This typically includes validating the evidence, both stateless checks via ValidateBasic
and stateful checks via any keepers provided to the Handler
. In addition, the Handler
may also perform capabilities such as slashing and jailing a validator. All Evidence
handled by the Handler
should be persisted.
Last updated