seal

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0, MIT Imports: 46 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

View Source
var IsDevnet = build.BlockDelaySecs < 30

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 AllocationCheck added in v1.23.0

func AllocationCheck(ctx context.Context, api AllocNodeApi, piece *miner.PieceActivationManifest, expiration abi.ChainEpoch, miner abi.ActorID, ts *types.TipSet) (permanent bool, err error)

func DropSectorPieceRefs

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

func GetDevnet

func GetDevnet() bool

func GetTicket added in v1.23.1

func GetTicket(ctx context.Context, api TicketNodeAPI, maddr address.Address) (abi.SealRandomness, abi.ChainEpoch, error)

func SetDevnet

func SetDevnet(value bool)

Types

type AllocAPI

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

type AllocNodeApi added in v1.23.0

type AllocNodeApi interface {
	StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes9.AllocationId, tsk types.TipSetKey) (*verifregtypes9.Allocation, 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, slots *slotmgr.SlotMgr) *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) GetSectorID added in v1.23.1

func (f *FinalizeTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*FinalizeTask) GetSpid added in v1.22.1

func (f *FinalizeTask) GetSpid(db *harmonydb.DB, 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) GetSectorID added in v1.23.1

func (m *MoveStorageTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*MoveStorageTask) GetSpid added in v1.22.1

func (m *MoveStorageTask) GetSpid(db *harmonydb.DB, 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) GetSectorID added in v1.23.1

func (p *PoRepTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*PoRepTask) GetSpid added in v1.22.1

func (p *PoRepTask) GetSpid(db *harmonydb.DB, 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 taskhelp.Limiter, minSDR 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) GetSectorID added in v1.23.1

func (s *SDRTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*SDRTask) GetSpid added in v1.22.1

func (s *SDRTask) GetSpid(db *harmonydb.DB, 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)
	StateMinerInitialPledgeForSector(ctx context.Context, sectorDuration abi.ChainEpoch, sectorSize abi.SectorSize, verifiedSize uint64, tsk types.TipSetKey) (types.BigInt, 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) GetSectorID added in v1.23.1

func (s *SubmitCommitTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*SubmitCommitTask) GetSpid added in v1.22.1

func (s *SubmitCommitTask) GetSpid(db *harmonydb.DB, 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) GetSectorID added in v1.23.1

func (s *SubmitPrecommitTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*SubmitPrecommitTask) GetSpid added in v1.22.1

func (s *SubmitPrecommitTask) GetSpid(db *harmonydb.DB, 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 SyntheticProofTask added in v1.23.0

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

func NewSyntheticProofTask added in v1.23.0

func NewSyntheticProofTask(sp *SealPoller, db *harmonydb.DB, sc *ffi.SealCalls, maxSynths int) *SyntheticProofTask

func (*SyntheticProofTask) Adder added in v1.23.0

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

func (*SyntheticProofTask) CanAccept added in v1.23.0

func (*SyntheticProofTask) Do added in v1.23.0

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

func (*SyntheticProofTask) GetSectorID added in v1.23.1

func (s *SyntheticProofTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*SyntheticProofTask) GetSpid added in v1.23.0

func (s *SyntheticProofTask) GetSpid(db *harmonydb.DB, taskID int64) string

func (*SyntheticProofTask) TypeDetails added in v1.23.0

type TicketNodeAPI added in v1.23.1

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

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) GetSectorID added in v1.23.1

func (t *TreeDTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*TreeDTask) GetSpid added in v1.22.1

func (t *TreeDTask) GetSpid(db *harmonydb.DB, 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) GetSectorID added in v1.23.1

func (t *TreeRCTask) GetSectorID(db *harmonydb.DB, taskID int64) (*abi.SectorID, error)

func (*TreeRCTask) GetSpid added in v1.22.1

func (t *TreeRCTask) GetSpid(db *harmonydb.DB, taskID int64) string

func (*TreeRCTask) TypeDetails

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

Jump to

Keyboard shortcuts

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