seal

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0, MIT Imports: 50 Imported by: 0

README

Curio Sealer

Overview

The Curio sealer is a collection of harmony tasks and a common poller which implement the sealing functionality of the Filecoin protocol.

Pipeline Tasks

  • SDR pipeline
    • SDR - Generate SDR layers
    • SDRTrees - Generate tree files (TreeD, TreeR, TreeC)
    • PreCommitSubmit - Submit precommit message to the network
    • PoRep - Generate PoRep proof
    • CommitSubmit - Submit commit message to the network

Poller

The poller is a background process running on every node which runs any of the SDR pipeline tasks. It periodically checks the state of sectors in the SDR pipeline and schedules any tasks to run which will move the sector along the pipeline.

Error Handling

  • Pipeline tasks are expected to always finish successfully as harmonytask tasks. If a sealing task encounters an error, it should mark the sector pipeline entry as failed and exit without erroring. The poller will then figure out a recovery strategy for the sector.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateSectorNumbers

func AllocateSectorNumbers(ctx context.Context, a AllocAPI, db *harmonydb.DB, maddr address.Address, count int, txcb ...func(*harmonydb.Tx, []abi.SectorNumber) (bool, error)) ([]abi.SectorNumber, error)

func DropSectorPieceRefs

func DropSectorPieceRefs(ctx context.Context, db *harmonydb.DB, sid abi.SectorID) error

func GetDevnet

func GetDevnet() bool

func SetDevnet

func SetDevnet(value bool)

Types

type AllocAPI

type AllocAPI interface {
	StateMinerAllocated(context.Context, address.Address, types.TipSetKey) (*bitfield.BitField, error)
}

type FinalizeTask

type FinalizeTask struct {
	// contains filtered or unexported fields
}

func NewFinalizeTask

func NewFinalizeTask(max int, sp *SealPoller, sc *ffi.SealCalls, db *harmonydb.DB) *FinalizeTask

func (*FinalizeTask) Adder

func (f *FinalizeTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*FinalizeTask) CanAccept

func (f *FinalizeTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*FinalizeTask) Do

func (f *FinalizeTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*FinalizeTask) GetSpid added in v1.22.1

func (f *FinalizeTask) GetSpid(taskID int64) string

func (*FinalizeTask) TypeDetails

func (f *FinalizeTask) TypeDetails() harmonytask.TaskTypeDetails

type MoveStorageTask

type MoveStorageTask struct {
	// contains filtered or unexported fields
}

func NewMoveStorageTask

func NewMoveStorageTask(sp *SealPoller, sc *ffi2.SealCalls, db *harmonydb.DB, max int) *MoveStorageTask

func (*MoveStorageTask) Adder

func (m *MoveStorageTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*MoveStorageTask) CanAccept

func (*MoveStorageTask) Do

func (m *MoveStorageTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*MoveStorageTask) GetSpid added in v1.22.1

func (m *MoveStorageTask) GetSpid(taskID int64) string

func (*MoveStorageTask) TypeDetails

func (m *MoveStorageTask) TypeDetails() harmonytask.TaskTypeDetails

type PoRepAPI

type PoRepAPI interface {
	ChainHead(context.Context) (*types.TipSet, error)
	StateGetRandomnessFromBeacon(context.Context, crypto.DomainSeparationTag, abi.ChainEpoch, []byte, types.TipSetKey) (abi.Randomness, error)
}

type PoRepTask

type PoRepTask struct {
	// contains filtered or unexported fields
}

func NewPoRepTask

func NewPoRepTask(db *harmonydb.DB, api PoRepAPI, sp *SealPoller, sc *ffi.SealCalls, paramck func() (bool, error), maxPoRep int) *PoRepTask

func (*PoRepTask) Adder

func (p *PoRepTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*PoRepTask) CanAccept

func (p *PoRepTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*PoRepTask) Do

func (p *PoRepTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*PoRepTask) GetSpid added in v1.22.1

func (p *PoRepTask) GetSpid(taskID int64) string

func (*PoRepTask) TypeDetails

func (p *PoRepTask) TypeDetails() harmonytask.TaskTypeDetails

type SDRAPI

type SDRAPI interface {
	ChainHead(context.Context) (*types.TipSet, error)
	StateGetRandomnessFromTickets(context.Context, crypto.DomainSeparationTag, abi.ChainEpoch, []byte, types.TipSetKey) (abi.Randomness, error)
}

type SDRTask

type SDRTask struct {
	// contains filtered or unexported fields
}

func NewSDRTask

func NewSDRTask(api SDRAPI, db *harmonydb.DB, sp *SealPoller, sc *ffi2.SealCalls, maxSDR int) *SDRTask

func (*SDRTask) Adder

func (s *SDRTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*SDRTask) CanAccept

func (s *SDRTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*SDRTask) Do

func (s *SDRTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*SDRTask) GetSpid added in v1.22.1

func (s *SDRTask) GetSpid(taskID int64) string

func (*SDRTask) TypeDetails

func (s *SDRTask) TypeDetails() harmonytask.TaskTypeDetails

type SealPoller

type SealPoller struct {
	// contains filtered or unexported fields
}

func NewPoller

func NewPoller(db *harmonydb.DB, api SealPollerAPI) *SealPoller

func (*SealPoller) RunPoller

func (s *SealPoller) RunPoller(ctx context.Context)

type SealPollerAPI

type SealPollerAPI interface {
	StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error)
	StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
	ChainHead(context.Context) (*types.TipSet, error)
}

type SubmitCommitAPI

type SubmitCommitAPI interface {
	ChainHead(context.Context) (*types.TipSet, error)
	StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error)
	StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error)
	StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error)
	StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes9.AllocationId, tsk types.TipSetKey) (*verifregtypes9.Allocation, error)
	StateGetAllocationIdForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (verifregtypes9.AllocationId, error)
	StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (big.Int, error)
	ctladdr.NodeApi
}

type SubmitCommitTask

type SubmitCommitTask struct {
	// contains filtered or unexported fields
}

func (*SubmitCommitTask) Adder

func (s *SubmitCommitTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*SubmitCommitTask) CanAccept

func (*SubmitCommitTask) Do

func (s *SubmitCommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*SubmitCommitTask) GetSpid added in v1.22.1

func (s *SubmitCommitTask) GetSpid(taskID int64) string

func (*SubmitCommitTask) TypeDetails

func (s *SubmitCommitTask) TypeDetails() harmonytask.TaskTypeDetails

type SubmitPrecommitTask

type SubmitPrecommitTask struct {
	CollateralFromMinerBalance bool
	DisableCollateralFallback  bool
	// contains filtered or unexported fields
}

func NewSubmitPrecommitTask

func NewSubmitPrecommitTask(sp *SealPoller, db *harmonydb.DB, api SubmitPrecommitTaskApi, sender *message.Sender, as *multictladdr.MultiAddressSelector, maxFee types.FIL, CollateralFromMinerBalance, DisableCollateralFallback bool) *SubmitPrecommitTask

func (*SubmitPrecommitTask) Adder

func (s *SubmitPrecommitTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*SubmitPrecommitTask) CanAccept

func (*SubmitPrecommitTask) Do

func (s *SubmitPrecommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*SubmitPrecommitTask) GetSpid added in v1.22.1

func (s *SubmitPrecommitTask) GetSpid(taskID int64) string

func (*SubmitPrecommitTask) TypeDetails

type SubmitPrecommitTaskApi

type SubmitPrecommitTaskApi interface {
	ChainHead(context.Context) (*types.TipSet, error)
	StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error)
	StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error)
	StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
	StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (big.Int, error)
	ctladdr.NodeApi
}

type TreeDTask

type TreeDTask struct {
	// contains filtered or unexported fields
}

func NewTreeDTask

func NewTreeDTask(sp *SealPoller, db *harmonydb.DB, sc *ffi2.SealCalls, maxTrees int) *TreeDTask

func (*TreeDTask) Adder

func (t *TreeDTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*TreeDTask) CanAccept

func (t *TreeDTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*TreeDTask) Do

func (t *TreeDTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*TreeDTask) GetSpid added in v1.22.1

func (t *TreeDTask) GetSpid(taskID int64) string

func (*TreeDTask) TypeDetails

func (t *TreeDTask) TypeDetails() harmonytask.TaskTypeDetails

type TreeRCTask

type TreeRCTask struct {
	// contains filtered or unexported fields
}

func NewTreeRCTask

func NewTreeRCTask(sp *SealPoller, db *harmonydb.DB, sc *ffi2.SealCalls, maxTrees int) *TreeRCTask

func (*TreeRCTask) Adder

func (t *TreeRCTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*TreeRCTask) CanAccept

func (t *TreeRCTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*TreeRCTask) Do

func (t *TreeRCTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*TreeRCTask) GetSpid added in v1.22.1

func (t *TreeRCTask) GetSpid(taskID int64) string

func (*TreeRCTask) TypeDetails

func (t *TreeRCTask) TypeDetails() harmonytask.TaskTypeDetails

type UrlPieceReader

type UrlPieceReader struct {
	Url     string
	RawSize int64 // the exact number of bytes read, if we read more or less that's an error
	// contains filtered or unexported fields
}

func (*UrlPieceReader) Close

func (u *UrlPieceReader) Close() error

func (*UrlPieceReader) Read

func (u *UrlPieceReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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