Storage Proving #


Filecoin Proving Subsystem #

import abi "github.com/filecoin-project/specs-actors/actors/abi"
import poster "github.com/filecoin-project/specs/systems/filecoin_mining/storage_proving/poster"
import sealer "github.com/filecoin-project/specs/systems/filecoin_mining/storage_proving/sealer"
import block "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/block"

type StorageProvingSubsystem struct {
    SectorSealer   sealer.SectorSealer
    PoStGenerator  poster.PoStGenerator

    VerifySeal(sv abi.SealVerifyInfo, pieceInfos [abi.PieceInfo]) union {ok bool, err error}
    ComputeUnsealedSectorCID(sectorSize UInt, pieceInfos [abi.PieceInfo]) union {unsealedSectorCID abi.UnsealedSectorCID, err error}

    ValidateBlock(block block.Block)

    // TODO: remove this?
    // GetPieceInclusionProof(pieceRef CID) union { PieceInclusionProofs, error }

    GenerateElectionPoStCandidates(
        challengeSeed  abi.PoStRandomness
        sectorIDs      [abi.SectorID]
    ) [abi.PoStCandidate]

    GenerateSurprisePoStCandidates(
        challengeSeed  abi.PoStRandomness
        sectorIDs      [abi.SectorID]
    ) [abi.PoStCandidate]

    CreateElectionPoStProof(
        challengeSeed  abi.PoStRandomness
        candidates     [abi.PoStCandidate]
    ) [abi.PoStProof]

    CreateSurprisePoStProof(
        challengeSeed  abi.PoStRandomness
        candidates     [abi.PoStCandidate]
    ) [abi.PoStProof]
}