Trait forest_filecoin::shim::fvm_latest::kernel::filecoin::FilecoinKernel
source · pub trait FilecoinKernel: Kernel {
// Required methods
fn compute_unsealed_sector_cid(
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo],
) -> Result<Cid<64>, ExecutionError>;
fn verify_post(
&self,
verify_info: &WindowPoStVerifyInfo,
) -> Result<bool, ExecutionError>;
fn verify_consensus_fault(
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8],
) -> Result<Option<ConsensusFault>, ExecutionError>;
fn batch_verify_seals(
&self,
vis: &[SealVerifyInfo],
) -> Result<Vec<bool>, ExecutionError>;
fn verify_aggregate_seals(
&self,
aggregate: &AggregateSealVerifyProofAndInfos,
) -> Result<bool, ExecutionError>;
fn verify_replica_update(
&self,
replica: &ReplicaUpdateInfo,
) -> Result<bool, ExecutionError>;
fn total_fil_circ_supply(&self) -> Result<TokenAmount, ExecutionError>;
}
Required Methods§
sourcefn compute_unsealed_sector_cid(
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo],
) -> Result<Cid<64>, ExecutionError>
fn compute_unsealed_sector_cid( &self, proof_type: RegisteredSealProof, pieces: &[PieceInfo], ) -> Result<Cid<64>, ExecutionError>
Computes an unsealed sector CID (CommD) from its constituent piece CIDs (CommPs) and sizes.
sourcefn verify_post(
&self,
verify_info: &WindowPoStVerifyInfo,
) -> Result<bool, ExecutionError>
fn verify_post( &self, verify_info: &WindowPoStVerifyInfo, ) -> Result<bool, ExecutionError>
Verifies a window proof of spacetime.
sourcefn verify_consensus_fault(
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8],
) -> Result<Option<ConsensusFault>, ExecutionError>
fn verify_consensus_fault( &self, h1: &[u8], h2: &[u8], extra: &[u8], ) -> Result<Option<ConsensusFault>, ExecutionError>
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.
sourcefn batch_verify_seals(
&self,
vis: &[SealVerifyInfo],
) -> Result<Vec<bool>, ExecutionError>
fn batch_verify_seals( &self, vis: &[SealVerifyInfo], ) -> Result<Vec<bool>, ExecutionError>
Verifies a batch of seals. This is a privledged syscall, may only be called by the power actor during cron.
Gas: This syscall intentionally does not charge any gas (as said gas would be charged to cron). Instead, gas is pre-paid by the storage provider on pre-commit.
sourcefn verify_aggregate_seals(
&self,
aggregate: &AggregateSealVerifyProofAndInfos,
) -> Result<bool, ExecutionError>
fn verify_aggregate_seals( &self, aggregate: &AggregateSealVerifyProofAndInfos, ) -> Result<bool, ExecutionError>
Verify aggregate seals verifies an aggregated batch of prove-commits.
sourcefn verify_replica_update(
&self,
replica: &ReplicaUpdateInfo,
) -> Result<bool, ExecutionError>
fn verify_replica_update( &self, replica: &ReplicaUpdateInfo, ) -> Result<bool, ExecutionError>
Verify replica update verifies a snap deal: an upgrade from a CC sector to a sector with deals.
sourcefn total_fil_circ_supply(&self) -> Result<TokenAmount, ExecutionError>
fn total_fil_circ_supply(&self) -> Result<TokenAmount, ExecutionError>
Returns the total token supply in circulation at the beginning of the current epoch. The circulating supply is the sum of:
- rewards emitted by the reward actor,
- funds vested from lock-ups in the genesis state, less the sum of:
- funds burnt,
- pledge collateral locked in storage miner actors (recorded in the storage power actor)
- deal collateral locked by the storage market actor
Object Safety§
This trait is not object safe.