pub trait Kind: 'static + Sized + Send + Sync {
type Input: Sized + Send + BlockLike + MallocSizeOf;
type Unverified: Sized + Send + BlockLike + MallocSizeOf;
type Verified: Sized + Send + BlockLike + MallocSizeOf;
fn create(
input: Self::Input,
engine: &dyn EthEngine,
check_seal: bool
) -> Result<Self::Unverified, (Self::Input, Error)>;
fn verify(
unverified: Self::Unverified,
engine: &dyn EthEngine,
check_seal: bool
) -> Result<Self::Verified, Error>;
}
Expand description
Defines transitions between stages of verification.
It starts with a fallible transformation from an “input” into the unverified item. This consists of quick, simply done checks as well as extracting particular data.
Then, there is a verify
function which performs more expensive checks and
produces the verified output.
For correctness, the hashes produced by each stage of the pipeline should be consistent.
Associated Types
type Unverified: Sized + Send + BlockLike + MallocSizeOf
type Unverified: Sized + Send + BlockLike + MallocSizeOf
The second stage: partially verified.
Required methods
Attempt to create the Unverified
item from the input.