Documentation ¶
Index ¶
- Constants
- Variables
- func ElectionPostChallengeCount(sectors uint64, faults uint64) uint64
- func GenerateDataCommitment(ssize uint64, pieces []sectorbuilder.PublicPieceInfo) ([CommLen]byte, error)
- func GeneratePieceCommitment(piece io.Reader, pieceSize uint64) (commP [CommLen]byte, err error)
- type Config
- type EPostCandidate
- type Fault
- type Interface
- type JsonRSPCO
- type PublicPieceInfo
- type RawSealPreCommitOutput
- type SealCommitOutput
- type SealPreCommitOutput
- type SealRes
- type SealSeed
- type SealTicket
- type SectorBuilder
- func (sb *SectorBuilder) AcquireSectorId() (uint64, error)
- func (sb *SectorBuilder) AddPiece(pieceSize uint64, sectorId uint64, file io.Reader, existingPieceSizes []uint64) (PublicPieceInfo, error)
- func (sb *SectorBuilder) AddWorker(ctx context.Context, cfg WorkerCfg) (<-chan WorkerTask, error)
- func (sb *SectorBuilder) ComputeElectionPoSt(sectorInfo SortedPublicSectorInfo, challengeSeed []byte, ...) ([]byte, error)
- func (sb *SectorBuilder) GenerateEPostCandidates(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, ...) ([]EPostCandidate, error)
- func (sb *SectorBuilder) GenerateFallbackPoSt(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, ...) ([]EPostCandidate, []byte, error)
- func (sb *SectorBuilder) GetPath(typ string, sectorName string) (string, error)
- func (sb *SectorBuilder) ImportFrom(osb *SectorBuilder, symlink bool) error
- func (sb *SectorBuilder) RateLimit() func()
- func (sb *SectorBuilder) ReadPieceFromSealedSector(sectorID uint64, offset uint64, size uint64, ticket []byte, commD []byte) (io.ReadCloser, error)
- func (sb *SectorBuilder) Scrub(sectorSet sectorbuilder.SortedPublicSectorInfo) []*Fault
- func (sb *SectorBuilder) SealCommit(ctx context.Context, sectorID uint64, ticket SealTicket, seed SealSeed, ...) (proof []byte, err error)
- func (sb *SectorBuilder) SealPreCommit(ctx context.Context, sectorID uint64, ticket SealTicket, ...) (RawSealPreCommitOutput, error)
- func (sb *SectorBuilder) SealedSectorPath(sectorID uint64) (string, error)
- func (sb *SectorBuilder) SectorName(sectorID uint64) string
- func (sb *SectorBuilder) SectorSize() uint64
- func (sb *SectorBuilder) SetLastSectorID(id uint64) error
- func (sb *SectorBuilder) StagedSectorPath(sectorID uint64) string
- func (sb *SectorBuilder) Stop()
- func (sb *SectorBuilder) TaskDone(ctx context.Context, task uint64, res SealRes) error
- func (sb *SectorBuilder) TrimCache(sectorID uint64) error
- func (sb *SectorBuilder) WorkerStats() WorkerStats
- type SortedPrivateSectorInfo
- type SortedPublicSectorInfo
- type Verifier
- type WorkerCfg
- type WorkerStats
- type WorkerTask
- type WorkerTaskType
Constants ¶
View Source
const CommLen = sectorbuilder.CommitmentBytesLen
View Source
const MaxFallbackPostChallengeCount = 10
View Source
const PoRepProofPartitions = 10
View Source
const PoStReservedWorkers = 1
View Source
const SectorChallengeRatioDiv = 25
1 / n
Variables ¶
View Source
var ProofVerifier = proofVerifier{}
View Source
var UserBytesForSectorSize = sectorbuilder.GetMaxUserBytesPerStagedSector
Functions ¶
func ElectionPostChallengeCount ¶
extracted from lotus/chain/types/blockheader
func GenerateDataCommitment ¶
func GenerateDataCommitment(ssize uint64, pieces []sectorbuilder.PublicPieceInfo) ([CommLen]byte, error)
Types ¶
type EPostCandidate ¶
type EPostCandidate = sectorbuilder.Candidate
type Interface ¶
type Interface interface { RateLimit() func() AddPiece(uint64, uint64, io.Reader, []uint64) (PublicPieceInfo, error) SectorSize() uint64 AcquireSectorId() (uint64, error) Scrub(SortedPublicSectorInfo) []*Fault GenerateEPostCandidates(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]EPostCandidate, error) GenerateFallbackPoSt(SortedPublicSectorInfo, [CommLen]byte, []uint64) ([]EPostCandidate, []byte, error) ComputeElectionPoSt(sectorInfo SortedPublicSectorInfo, challengeSeed []byte, winners []EPostCandidate) ([]byte, error) SealPreCommit(context.Context, uint64, SealTicket, []PublicPieceInfo) (RawSealPreCommitOutput, error) SealCommit(context.Context, uint64, SealTicket, SealSeed, []PublicPieceInfo, RawSealPreCommitOutput) ([]byte, error) ReadPieceFromSealedSector(sectorID uint64, offset uint64, size uint64, ticket []byte, commD []byte) (io.ReadCloser, error) GetPath(string, string) (string, error) WorkerStats() WorkerStats AddWorker(context.Context, WorkerCfg) (<-chan WorkerTask, error) TaskDone(context.Context, uint64, SealRes) error }
type PublicPieceInfo ¶
type PublicPieceInfo = sectorbuilder.PublicPieceInfo
type RawSealPreCommitOutput ¶
type RawSealPreCommitOutput sectorbuilder.RawSealPreCommitOutput
func (*RawSealPreCommitOutput) ToJson ¶
func (rspco *RawSealPreCommitOutput) ToJson() JsonRSPCO
type SealCommitOutput ¶
type SealCommitOutput = sectorbuilder.SealCommitOutput
type SealPreCommitOutput ¶
type SealPreCommitOutput = sectorbuilder.SealPreCommitOutput
type SealSeed ¶
type SealSeed = sectorbuilder.SealSeed
type SealTicket ¶
type SealTicket = sectorbuilder.SealTicket
type SectorBuilder ¶
type SectorBuilder struct { Miner address.Address // contains filtered or unexported fields }
func NewStandalone ¶
func NewStandalone(cfg *Config) (*SectorBuilder, error)
func TempSectorbuilderDir ¶
func TempSectorbuilderDir(dir string, sectorSize uint64, ds datastore.Batching) (*SectorBuilder, error)
func (*SectorBuilder) AcquireSectorId ¶
func (sb *SectorBuilder) AcquireSectorId() (uint64, error)
func (*SectorBuilder) AddPiece ¶
func (sb *SectorBuilder) AddPiece(pieceSize uint64, sectorId uint64, file io.Reader, existingPieceSizes []uint64) (PublicPieceInfo, error)
func (*SectorBuilder) AddWorker ¶
func (sb *SectorBuilder) AddWorker(ctx context.Context, cfg WorkerCfg) (<-chan WorkerTask, error)
func (*SectorBuilder) ComputeElectionPoSt ¶
func (sb *SectorBuilder) ComputeElectionPoSt(sectorInfo SortedPublicSectorInfo, challengeSeed []byte, winners []EPostCandidate) ([]byte, error)
func (*SectorBuilder) GenerateEPostCandidates ¶
func (sb *SectorBuilder) GenerateEPostCandidates(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]EPostCandidate, error)
func (*SectorBuilder) GenerateFallbackPoSt ¶
func (sb *SectorBuilder) GenerateFallbackPoSt(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]EPostCandidate, []byte, error)
func (*SectorBuilder) GetPath ¶
func (sb *SectorBuilder) GetPath(typ string, sectorName string) (string, error)
func (*SectorBuilder) ImportFrom ¶
func (sb *SectorBuilder) ImportFrom(osb *SectorBuilder, symlink bool) error
func (*SectorBuilder) RateLimit ¶
func (sb *SectorBuilder) RateLimit() func()
func (*SectorBuilder) ReadPieceFromSealedSector ¶
func (sb *SectorBuilder) ReadPieceFromSealedSector(sectorID uint64, offset uint64, size uint64, ticket []byte, commD []byte) (io.ReadCloser, error)
func (*SectorBuilder) Scrub ¶
func (sb *SectorBuilder) Scrub(sectorSet sectorbuilder.SortedPublicSectorInfo) []*Fault
func (*SectorBuilder) SealCommit ¶
func (sb *SectorBuilder) SealCommit(ctx context.Context, sectorID uint64, ticket SealTicket, seed SealSeed, pieces []PublicPieceInfo, rspco RawSealPreCommitOutput) (proof []byte, err error)
func (*SectorBuilder) SealPreCommit ¶
func (sb *SectorBuilder) SealPreCommit(ctx context.Context, sectorID uint64, ticket SealTicket, pieces []PublicPieceInfo) (RawSealPreCommitOutput, error)
func (*SectorBuilder) SealedSectorPath ¶
func (sb *SectorBuilder) SealedSectorPath(sectorID uint64) (string, error)
func (*SectorBuilder) SectorName ¶
func (sb *SectorBuilder) SectorName(sectorID uint64) string
func (*SectorBuilder) SectorSize ¶
func (sb *SectorBuilder) SectorSize() uint64
func (*SectorBuilder) SetLastSectorID ¶
func (sb *SectorBuilder) SetLastSectorID(id uint64) error
func (*SectorBuilder) StagedSectorPath ¶
func (sb *SectorBuilder) StagedSectorPath(sectorID uint64) string
func (*SectorBuilder) Stop ¶
func (sb *SectorBuilder) Stop()
func (*SectorBuilder) TrimCache ¶
func (sb *SectorBuilder) TrimCache(sectorID uint64) error
func (*SectorBuilder) WorkerStats ¶
func (sb *SectorBuilder) WorkerStats() WorkerStats
type SortedPrivateSectorInfo ¶
type SortedPrivateSectorInfo = sectorbuilder.SortedPrivateSectorInfo
type SortedPublicSectorInfo ¶
type SortedPublicSectorInfo = sectorbuilder.SortedPublicSectorInfo
func NewSortedPublicSectorInfo ¶
func NewSortedPublicSectorInfo(sectors []sectorbuilder.PublicSectorInfo) SortedPublicSectorInfo
type Verifier ¶
type Verifier interface { VerifyElectionPost(ctx context.Context, sectorSize uint64, sectorInfo SortedPublicSectorInfo, challengeSeed []byte, proof []byte, candidates []EPostCandidate, proverID address.Address) (bool, error) VerifyFallbackPost(ctx context.Context, sectorSize uint64, sectorInfo SortedPublicSectorInfo, challengeSeed []byte, proof []byte, candidates []EPostCandidate, proverID address.Address, faults uint64) (bool, error) VerifySeal(sectorSize uint64, commR, commD []byte, proverID address.Address, ticket []byte, seed []byte, sectorID uint64, proof []byte) (bool, error) }
type WorkerStats ¶
type WorkerTask ¶
type WorkerTask struct { Type WorkerTaskType TaskID uint64 SectorID uint64 // preCommit SealTicket SealTicket Pieces []PublicPieceInfo // commit SealSeed SealSeed Rspco RawSealPreCommitOutput }
type WorkerTaskType ¶
type WorkerTaskType int
const ( WorkerPreCommit WorkerTaskType = iota WorkerCommit )
Click to show internal directories.
Click to hide internal directories.