ffi

package
v1.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0, MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const C1CheckNumber = 3

Variables

View Source
var Measures = struct {
	encActivePhase *stats.Int64Measure
}{
	// contains filtered or unexported fields
}
View Source
var TreeRTimeout = 20 * time.Minute

Functions

func TruncateAndMoveUnsealed added in v1.24.4

func TruncateAndMoveUnsealed(tempUnsealed, unsealed string, ssize abi.SectorSize) error

func WindowPoStCuzk added in v1.28.1

func WindowPoStCuzk(ctx context.Context, cuzkClient *cuzk.Client, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, vanillaProofs [][]byte, partitionIdx int) (proof2.PoStProof, error)

WindowPoStCuzk sends per-sector vanilla proofs to the cuzk daemon for SNARK computation, returning the single-partition PoStProof. The vanilla proofs must already be generated locally (reading challenge data from sealed sectors).

func WinningPoStCuzk added in v1.28.1

func WinningPoStCuzk(ctx context.Context, cuzkClient *cuzk.Client, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, vanillaProofs [][]byte) ([]proof2.PoStProof, error)

WinningPoStCuzk sends per-sector vanilla proofs to the cuzk daemon for SNARK computation, returning the WinningPoSt proof. This is time-critical — must complete within the epoch window.

Types

type ReleaseStorageFunc

type ReleaseStorageFunc func() // free storage reservation

type SealCalls

type SealCalls struct {
	Sectors *storageProvider
}

type ExternPrecommit2 func(ctx context.Context, sector storiface.SectorRef, cache, sealed string, pc1out storiface.PreCommit1Out) (sealedCID cid.Cid, unsealedCID cid.Cid, err error)

type ExternalSealer struct {
	PreCommit2 ExternPrecommit2
}

func NewSealCalls

func NewSealCalls(st *paths.Remote, ls *paths.Local, si paths.SectorIndex) *SealCalls

func (*SealCalls) CheckSealedCommR added in v1.27.3

func (sb *SealCalls) CheckSealedCommR(ctx context.Context, s storiface.SectorRef) (cid.Cid, error)

CheckSealedCommR verifies a sealed sector's CommR by recomputing tree-r from the sealed file. It uses supraseal's GPU-accelerated tree-r computation. Returns the computed CommR CID.

func (*SealCalls) CheckUnsealedCID added in v1.23.1

func (sb *SealCalls) CheckUnsealedCID(ctx context.Context, s storiface.SectorRef) (cid.Cid, error)

func (*SealCalls) CheckUpdateCommR added in v1.27.3

func (sb *SealCalls) CheckUpdateCommR(ctx context.Context, s storiface.SectorRef) (cid.Cid, error)

CheckUpdateCommR verifies a snap-updated sector's CommR by recomputing tree-r from the update file. It uses supraseal's GPU-accelerated tree-r computation. Returns the computed CommR CID.

func (*SealCalls) DecodeSDR added in v1.23.1

func (sb *SealCalls) DecodeSDR(ctx context.Context, taskID harmonytask.TaskID, sector storiface.SectorRef) error

func (*SealCalls) DecodeSnap added in v1.23.1

func (sb *SealCalls) DecodeSnap(ctx context.Context, taskID harmonytask.TaskID, commD, commK cid.Cid, sector storiface.SectorRef) error

func (*SealCalls) EncodeUpdate added in v1.23.0

func (sb *SealCalls) EncodeUpdate(
	ctx context.Context,
	sectorKeyCid cid.Cid,
	taskID harmonytask.TaskID,
	proofType abi.RegisteredUpdateProof,
	sector storiface.SectorRef,
	data io.Reader,
	pieces []abi.PieceInfo,
	keepUnsealed bool) (sealedCID cid.Cid, unsealedCID cid.Cid, err error)

func (*SealCalls) FinalizeSector

func (sb *SealCalls) FinalizeSector(ctx context.Context, sector storiface.SectorRef, keepUnsealed bool) error

func (*SealCalls) GenerateSDR

func (sb *SealCalls) GenerateSDR(ctx context.Context, taskID harmonytask.TaskID, into storiface.SectorFileType, sector storiface.SectorRef, ticket abi.SealRandomness, commDcid cid.Cid) error

func (*SealCalls) GenerateSynthPoRep

func (sb *SealCalls) GenerateSynthPoRep()

func (*SealCalls) GenerateUnsealedSector added in v1.24.4

func (sb *SealCalls) GenerateUnsealedSector(ctx context.Context, sector storiface.SectorRef, sectorPaths, pathIDs *storiface.SectorPaths, keepUnsealed bool) error

func (*SealCalls) LocalStorage

func (sb *SealCalls) LocalStorage(ctx context.Context) ([]storiface.StoragePath, error)

func (*SealCalls) MoveStorage

func (sb *SealCalls) MoveStorage(ctx context.Context, sector storiface.SectorRef, taskID *harmonytask.TaskID) error

func (*SealCalls) MoveStorageSnap added in v1.23.0

func (sb *SealCalls) MoveStorageSnap(ctx context.Context, sector storiface.SectorRef, taskID *harmonytask.TaskID) error

func (*SealCalls) PieceReader

func (sb *SealCalls) PieceReader(ctx context.Context, id storiface.PieceNumber) (io.ReadCloser, error)

func (*SealCalls) PoRepSnark

func (sb *SealCalls) PoRepSnark(ctx context.Context, sn storiface.SectorRef, sealed, unsealed cid.Cid, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness) ([]byte, error)

func (*SealCalls) PoRepSnarkCuzk added in v1.28.1

func (sb *SealCalls) PoRepSnarkCuzk(ctx context.Context, cuzkClient *cuzk.Client, sn storiface.SectorRef, sealed, unsealed cid.Cid, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness) ([]byte, error)

PoRepSnarkCuzk generates the vanilla proof locally (needs sector data on disk), then delegates the SNARK computation to the cuzk daemon via gRPC. The proof is verified locally after cuzk returns.

func (*SealCalls) PreFetch

func (sb *SealCalls) PreFetch(ctx context.Context, sector storiface.SectorRef, task *harmonytask.TaskID) (fsPath, pathID storiface.SectorPaths, releaseSector func(...storiface.SectorFileType), err error)

PreFetch fetches the sector file to local storage before SDR and TreeRC Tasks

func (*SealCalls) ProveUpdate added in v1.23.0

func (sb *SealCalls) ProveUpdate(ctx context.Context, proofType abi.RegisteredUpdateProof, sector storiface.SectorRef, key, sealed, unsealed cid.Cid) ([]byte, error)

func (*SealCalls) ProveUpdateCuzk added in v1.28.1

func (sb *SealCalls) ProveUpdateCuzk(ctx context.Context, cuzkClient *cuzk.Client, proofType abi.RegisteredUpdateProof, sector storiface.SectorRef, key, sealed, unsealed cid.Cid) ([]byte, error)

ProveUpdateCuzk reads the snap vanilla proof from storage, then delegates the SNARK computation to the cuzk daemon via gRPC.

func (*SealCalls) RemovePiece

func (sb *SealCalls) RemovePiece(ctx context.Context, id storiface.PieceNumber) error

func (*SealCalls) Storage

func (sb *SealCalls) Storage(taskToSectorRef func(taskID harmonytask.TaskID) (SectorRef, error), alloc, existing storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType, MinFreeStoragePercentage float64) *TaskStorage

func (*SealCalls) StorageMulti added in v1.26.0

func (sb *SealCalls) StorageMulti(taskToSectorRef func(taskID harmonytask.TaskID) ([]SectorRef, error), alloc, existing storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType, MinFreeStoragePercentage float64, ohs map[storiface.SectorFileType]int) *TaskStorage

func (*SealCalls) SyntheticProofs added in v1.23.0

func (sb *SealCalls) SyntheticProofs(ctx context.Context, task *harmonytask.TaskID, sector storiface.SectorRef, sealed cid.Cid, unsealed cid.Cid, randomness abi.SealRandomness, pieces []abi.PieceInfo, keepUnsealed bool) error

func (*SealCalls) TreeD

func (sb *SealCalls) TreeD(ctx context.Context, sector storiface.SectorRef, unsealed cid.Cid, size abi.PaddedPieceSize, data io.Reader, unpaddedData bool, fspaths, pathIDs storiface.SectorPaths) error

func (*SealCalls) TreeRC

func (sb *SealCalls) TreeRC(ctx context.Context, task *harmonytask.TaskID, sector storiface.SectorRef, unsealed cid.Cid, randomness abi.SealRandomness, pieces []abi.PieceInfo) (scid cid.Cid, ucid cid.Cid, err error)

func (*SealCalls) WritePiece

func (sb *SealCalls) WritePiece(ctx context.Context, taskID *harmonytask.TaskID, pieceID storiface.PieceNumber, size int64, data io.Reader, storageType storiface.PathType) error

func (*SealCalls) WriteUploadPiece added in v1.27.2

func (sb *SealCalls) WriteUploadPiece(ctx context.Context, pieceID storiface.PieceNumber, size int64, data io.Reader, storageType storiface.PathType, verifySize bool) (abi.PieceInfo, uint64, error)

type SectorRef

type SectorRef struct {
	SpID         int64                   `db:"sp_id"`
	SectorNumber int64                   `db:"sector_number"`
	RegSealProof abi.RegisteredSealProof `db:"reg_seal_proof"`
}

func (SectorRef) ID

func (sr SectorRef) ID() abi.SectorID

func (SectorRef) Ref

func (sr SectorRef) Ref() storiface.SectorRef

type StorageReservation

type StorageReservation struct {
	SectorRef SectorRef
	Release   ReleaseStorageFunc
	Paths     storiface.SectorPaths
	PathIDs   storiface.SectorPaths

	Alloc, Existing storiface.SectorFileType
}

type TaskStorage

type TaskStorage struct {

	// Minimum free storage percentage cutoff for reservation rejection
	MinFreeStoragePercentage float64

	Overheads map[storiface.SectorFileType]int
	// contains filtered or unexported fields
}

func (*TaskStorage) Claim

func (t *TaskStorage) Claim(taskID int) (func() error, error)

func (*TaskStorage) HasCapacity

func (t *TaskStorage) HasCapacity() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL