Trait forest_runtime::Syscalls [−][src]
pub trait Syscalls { fn verify_signature(
&self,
signature: &Signature,
signer: &Address,
plaintext: &[u8]
) -> Result<(), Box<dyn StdError>>; fn verify_seal(&self, vi: &SealVerifyInfo) -> Result<(), Box<dyn StdError>>; fn verify_post(
&self,
verify_info: &WindowPoStVerifyInfo
) -> Result<(), Box<dyn StdError>>; fn verify_consensus_fault(
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8]
) -> Result<Option<ConsensusFault>, Box<dyn StdError>>; fn hash_blake2b(&self, data: &[u8]) -> Result<[u8; 32], Box<dyn StdError>> { ... } fn compute_unsealed_sector_cid(
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo]
) -> Result<Cid, Box<dyn StdError>> { ... } fn batch_verify_seals(
&self,
vis: &[(&Address, &Vec<SealVerifyInfo>)]
) -> Result<HashMap<Address, Vec<bool>>, Box<dyn StdError>> { ... } }
Pure functions implemented as primitives by the runtime.
Required methods
fn verify_signature(
&self,
signature: &Signature,
signer: &Address,
plaintext: &[u8]
) -> Result<(), Box<dyn StdError>>
[src]
&self,
signature: &Signature,
signer: &Address,
plaintext: &[u8]
) -> Result<(), Box<dyn StdError>>
Verifies that a signature is valid for an address and plaintext.
fn verify_seal(&self, vi: &SealVerifyInfo) -> Result<(), Box<dyn StdError>>
[src]
Verifies a sector seal proof.
fn verify_post(
&self,
verify_info: &WindowPoStVerifyInfo
) -> Result<(), Box<dyn StdError>>
[src]
&self,
verify_info: &WindowPoStVerifyInfo
) -> Result<(), Box<dyn StdError>>
Verifies a window proof of spacetime.
fn verify_consensus_fault(
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8]
) -> Result<Option<ConsensusFault>, Box<dyn StdError>>
[src]
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8]
) -> Result<Option<ConsensusFault>, Box<dyn StdError>>
Verifies that two block headers provide proof of a consensus fault:
- both headers mined by the same actor
- headers are different
- first header is of the same or lower epoch as the second
- at least one of the headers appears in the current chain at or after epoch
earliest
- the headers provide evidence of a fault (see the spec for the different fault types). The parameters are all serialized block headers. The third “extra” parameter is consulted only for the “parent grinding fault”, in which case it must be the sibling of h1 (same parent tipset) and one of the blocks in the parent of h2 (i.e. h2’s grandparent). Returns nil and an error if the headers don’t prove a fault.
Provided methods
fn hash_blake2b(&self, data: &[u8]) -> Result<[u8; 32], Box<dyn StdError>>
[src]
Hashes input data using blake2b with 256 bit output.
fn compute_unsealed_sector_cid(
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo]
) -> Result<Cid, Box<dyn StdError>>
[src]
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo]
) -> Result<Cid, Box<dyn StdError>>
Computes an unsealed sector CID (CommD) from its constituent piece CIDs (CommPs) and sizes.
fn batch_verify_seals(
&self,
vis: &[(&Address, &Vec<SealVerifyInfo>)]
) -> Result<HashMap<Address, Vec<bool>>, Box<dyn StdError>>
[src]
&self,
vis: &[(&Address, &Vec<SealVerifyInfo>)]
) -> Result<HashMap<Address, Vec<bool>>, Box<dyn StdError>>