sealing

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0, MIT Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetPreCommit1      = ReturnState(PreCommit1)
	RetPreCommitting   = ReturnState(PreCommitting)
	RetPreCommitFailed = ReturnState(PreCommitFailed)
	RetCommitFailed    = ReturnState(CommitFailed)
)
View Source
const InteractivePoRepConfidence = 6

Epochs

View Source
const SectorStorePrefix = "/sectors"

Variables

View Source
var DealSectorPriority = 1024
View Source
var ErrSectorAllocated = errors.New("sectorNumber is allocated, but PreCommit info wasn't found on chain")
View Source
var ErrTooManySectorsSealing = xerrors.New("too many sectors sealing")
View Source
var ExistSectorStateList = map[SectorState]struct{}{
	Empty:                       {},
	WaitDeals:                   {},
	Packing:                     {},
	AddPiece:                    {},
	AddPieceFailed:              {},
	GetTicket:                   {},
	PreCommit1:                  {},
	PreCommit2:                  {},
	PreCommitting:               {},
	PreCommitWait:               {},
	SubmitPreCommitBatch:        {},
	PreCommitBatchWait:          {},
	WaitSeed:                    {},
	Committing:                  {},
	CommitFinalize:              {},
	CommitFinalizeFailed:        {},
	SubmitCommit:                {},
	CommitWait:                  {},
	SubmitCommitAggregate:       {},
	CommitAggregateWait:         {},
	FinalizeSector:              {},
	Proving:                     {},
	Available:                   {},
	FailedUnrecoverable:         {},
	SealPreCommit1Failed:        {},
	SealPreCommit2Failed:        {},
	PreCommitFailed:             {},
	ComputeProofFailed:          {},
	CommitFailed:                {},
	PackingFailed:               {},
	FinalizeFailed:              {},
	DealsExpired:                {},
	RecoverDealIDs:              {},
	Faulty:                      {},
	FaultReported:               {},
	FaultedFinal:                {},
	Terminating:                 {},
	TerminateWait:               {},
	TerminateFinality:           {},
	TerminateFailed:             {},
	Removing:                    {},
	RemoveFailed:                {},
	Removed:                     {},
	SnapDealsWaitDeals:          {},
	SnapDealsAddPiece:           {},
	SnapDealsPacking:            {},
	UpdateReplica:               {},
	ProveReplicaUpdate:          {},
	SubmitReplicaUpdate:         {},
	ReplicaUpdateWait:           {},
	UpdateActivating:            {},
	ReleaseSectorKey:            {},
	FinalizeReplicaUpdate:       {},
	SnapDealsAddPieceFailed:     {},
	SnapDealsDealsExpired:       {},
	SnapDealsRecoverDealIDs:     {},
	ReplicaUpdateFailed:         {},
	ReleaseSectorKeyFailed:      {},
	FinalizeReplicaUpdateFailed: {},
	AbortUpgrade:                {},
}

Functions

func IsUpgradeState added in v1.15.2

func IsUpgradeState(st SectorState) bool

func NewNullReader

func NewNullReader(size abi.UnpaddedPieceSize) io.Reader

Types

type AddrSel added in v1.2.3

type AddrSel func(ctx context.Context, mi api.MinerInfo, use api.AddrUse, goodFunds, minFunds abi.TokenAmount) (address.Address, abi.TokenAmount, error)

type AggregateInput added in v1.10.0

type AggregateInput struct {
	Spt   abi.RegisteredSealProof
	Info  proof.AggregateSealVerifyInfo
	Proof []byte
}

type BasicPreCommitPolicy

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

BasicPreCommitPolicy satisfies PreCommitPolicy. It has two modes:

Mode 1: The sector contains a non-zero quantity of pieces with deal info Mode 2: The sector contains no pieces with deal info

The BasicPreCommitPolicy#Expiration method is given a slice of the pieces which the miner has encoded into the sector, and from that slice picks either the first or second mode.

If we're in Mode 1: The pre-commit expiration epoch will be the maximum deal end epoch of a piece in the sector.

If we're in Mode 2: The pre-commit expiration epoch will be set to the current epoch + the provided default duration.

func NewBasicPreCommitPolicy

func NewBasicPreCommitPolicy(api Chain, cfgGetter GetSealingConfigFunc, provingBuffer abi.ChainEpoch) BasicPreCommitPolicy

NewBasicPreCommitPolicy produces a BasicPreCommitPolicy.

The provided duration is used as the default sector expiry when the sector contains no deals. The proving boundary is used to adjust/align the sector's expiration.

func (*BasicPreCommitPolicy) Expiration

func (p *BasicPreCommitPolicy) Expiration(ctx context.Context, ps ...Piece) (abi.ChainEpoch, error)

Expiration produces the pre-commit sector expiration epoch for an encoded replica containing the provided enumeration of pieces and deals.

type Chain

type Chain interface {
	ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
	StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)
}

type CommitBatcher added in v1.10.0

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

func NewCommitBatcher added in v1.10.0

func NewCommitBatcher(mctx context.Context, maddr address.Address, api CommitBatcherApi, addrSel AddrSel, feeCfg config.MinerFeeConfig, getConfig GetSealingConfigFunc, prov ffiwrapper.Prover) *CommitBatcher

func (*CommitBatcher) AddCommit added in v1.10.0

register commit, wait for batch message, return message CID

func (*CommitBatcher) Flush added in v1.10.0

func (*CommitBatcher) Pending added in v1.10.0

func (b *CommitBatcher) Pending(ctx context.Context) ([]abi.SectorID, error)

func (*CommitBatcher) Stop added in v1.10.0

func (b *CommitBatcher) Stop(ctx context.Context) error

type CommitBatcherApi added in v1.10.0

type CommitBatcherApi interface {
	SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
	StateMinerInfo(context.Context, address.Address, TipSetToken) (api.MinerInfo, error)
	ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
	ChainBaseFee(context.Context, TipSetToken) (abi.TokenAmount, error)

	StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*miner.SectorPreCommitOnChainInfo, error)
	StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, TipSetToken) (big.Int, error)
	StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)
	StateMinerAvailableBalance(context.Context, address.Address, TipSetToken) (big.Int, error)
}

type Context added in v1.11.2

type Context interface {
	Context() context.Context
	Send(evt interface{}) error
}

Context is a go-statemachine context

type CurrentDealInfo added in v1.4.2

type CurrentDealInfo struct {
	DealID           abi.DealID
	MarketDeal       *api.MarketDeal
	PublishMsgTipSet TipSetToken
}

type CurrentDealInfoAPI added in v1.4.2

type CurrentDealInfoAPI interface {
	ChainGetMessage(context.Context, cid.Cid) (*types.Message, error)
	StateLookupID(context.Context, address.Address, TipSetToken) (address.Address, error)
	StateMarketStorageDeal(context.Context, abi.DealID, TipSetToken) (*api.MarketDeal, error)
	StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error)
	StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)
}

type CurrentDealInfoAPIAdapter added in v1.4.2

type CurrentDealInfoAPIAdapter struct {
	CurrentDealInfoTskAPI
}

func (*CurrentDealInfoAPIAdapter) StateLookupID added in v1.4.2

func (c *CurrentDealInfoAPIAdapter) StateLookupID(ctx context.Context, a address.Address, tok TipSetToken) (address.Address, error)

func (*CurrentDealInfoAPIAdapter) StateMarketStorageDeal added in v1.4.2

func (c *CurrentDealInfoAPIAdapter) StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, tok TipSetToken) (*api.MarketDeal, error)

func (*CurrentDealInfoAPIAdapter) StateNetworkVersion added in v1.12.0

func (c *CurrentDealInfoAPIAdapter) StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)

func (*CurrentDealInfoAPIAdapter) StateSearchMsg added in v1.4.2

func (c *CurrentDealInfoAPIAdapter) StateSearchMsg(ctx context.Context, k cid.Cid) (*MsgLookup, error)

type CurrentDealInfoManager added in v1.4.2

type CurrentDealInfoManager struct {
	CDAPI CurrentDealInfoAPI
}

func (*CurrentDealInfoManager) CheckDealEquality added in v1.4.2

func (mgr *CurrentDealInfoManager) CheckDealEquality(ctx context.Context, tok TipSetToken, p1, p2 market.DealProposal) (bool, error)

func (*CurrentDealInfoManager) GetCurrentDealInfo added in v1.4.2

func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tok TipSetToken, proposal *market.DealProposal, publishCid cid.Cid) (CurrentDealInfo, error)

GetCurrentDealInfo gets the current deal state and deal ID. Note that the deal ID is assigned when the deal is published, so it may have changed if there was a reorg after the deal was published.

type CurrentDealInfoTskAPI added in v1.4.2

type CurrentDealInfoTskAPI interface {
	ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
	StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error)
	StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error)
	StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
	StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
}

type ErrApi

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

TODO: For now we handle this by halting state execution, when we get jsonrpc reconnecting

We should implement some wait-for-api logic

type ErrBadCommD

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

type ErrBadPR added in v1.14.0

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

type ErrBadRU added in v1.14.0

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

type ErrBadSeed

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

type ErrBadTicket

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

type ErrCommitWaitFailed

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

type ErrExpiredDeals

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

type ErrExpiredTicket

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

type ErrInvalidDeals

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

type ErrInvalidPiece

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

type ErrInvalidProof

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

type ErrNoDeals added in v1.14.0

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

type ErrNoPrecommit

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

type ErrPrecommitOnChain

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

type ErrSectorNumberAllocated

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

type Events

type Events interface {
	ChainAt(hnd HeightHandler, rev RevertHandler, confidence int, h abi.ChainEpoch) error
}

type GetSealingConfigFunc

type GetSealingConfigFunc func() (sealiface.Config, error)

type HeightHandler

type HeightHandler func(ctx context.Context, tok TipSetToken, curH abi.ChainEpoch) error

`curH`-`ts.Height` = `confidence`

type Ignorable

type Ignorable interface {
	Ignore()
}

type Log

type Log struct {
	Timestamp uint64
	Trace     string // for errors

	Message string

	// additional data (Event info)
	Kind string
}

func (*Log) MarshalCBOR

func (t *Log) MarshalCBOR(w io.Writer) error

func (*Log) UnmarshalCBOR

func (t *Log) UnmarshalCBOR(r io.Reader) (err error)

type MessageReceipt

type MessageReceipt struct {
	ExitCode exitcode.ExitCode
	Return   []byte
	GasUsed  int64
}

func (*MessageReceipt) Equals

func (mr *MessageReceipt) Equals(o *MessageReceipt) bool

type MsgLookup

type MsgLookup struct {
	Receipt   MessageReceipt
	TipSetTok TipSetToken
	Height    abi.ChainEpoch
}

type NullReader

type NullReader struct {
	*io.LimitedReader
}

func (NullReader) NullBytes

func (m NullReader) NullBytes() int64

type Piece

type Piece struct {
	Piece    abi.PieceInfo
	DealInfo *api.PieceDealInfo // nil for pieces which do not appear in deals (e.g. filler pieces)
}

Piece is a tuple of piece info and optional deal

func (*Piece) MarshalCBOR

func (t *Piece) MarshalCBOR(w io.Writer) error

func (*Piece) UnmarshalCBOR

func (t *Piece) UnmarshalCBOR(r io.Reader) (err error)

type PieceWithDealInfo

type PieceWithDealInfo struct {
	Piece    abi.PieceInfo
	DealInfo api.PieceDealInfo
}

Piece is a tuple of piece and deal info

type PreCommitBatcher added in v1.10.0

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

func NewPreCommitBatcher added in v1.10.0

func NewPreCommitBatcher(mctx context.Context, maddr address.Address, api PreCommitBatcherApi, addrSel AddrSel, feeCfg config.MinerFeeConfig, getConfig GetSealingConfigFunc) *PreCommitBatcher

func (*PreCommitBatcher) AddPreCommit added in v1.10.0

register PreCommit, wait for batch message, return message CID

func (*PreCommitBatcher) Flush added in v1.10.0

func (*PreCommitBatcher) Pending added in v1.10.0

func (b *PreCommitBatcher) Pending(ctx context.Context) ([]abi.SectorID, error)

func (*PreCommitBatcher) Stop added in v1.10.0

func (b *PreCommitBatcher) Stop(ctx context.Context) error

type PreCommitBatcherApi added in v1.10.0

type PreCommitBatcherApi interface {
	SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
	StateMinerInfo(context.Context, address.Address, TipSetToken) (api.MinerInfo, error)
	StateMinerAvailableBalance(context.Context, address.Address, TipSetToken) (big.Int, error)
	ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
	ChainBaseFee(context.Context, TipSetToken) (abi.TokenAmount, error)
	StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)
}

type PreCommitPolicy

type PreCommitPolicy interface {
	Expiration(ctx context.Context, ps ...Piece) (abi.ChainEpoch, error)
}

type ReturnState added in v0.5.5

type ReturnState string

type RevertHandler

type RevertHandler func(ctx context.Context, tok TipSetToken) error

type Sealing

type Sealing struct {
	Api      SealingAPI
	DealInfo *CurrentDealInfoManager
	// contains filtered or unexported fields
}

func New

func New(mctx context.Context, api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sectorstorage.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, prov ffiwrapper.Prover, pcp PreCommitPolicy, gc GetSealingConfigFunc, notifee SectorStateNotifee, as AddrSel) *Sealing

func (*Sealing) AbortUpgrade added in v1.14.0

func (m *Sealing) AbortUpgrade(sid abi.SectorNumber) error

func (*Sealing) Address

func (m *Sealing) Address() address.Address

func (*Sealing) CommitFlush added in v1.10.0

func (m *Sealing) CommitFlush(ctx context.Context) ([]sealiface.CommitBatchRes, error)

func (*Sealing) CommitPending added in v1.10.0

func (m *Sealing) CommitPending(ctx context.Context) ([]abi.SectorID, error)

func (*Sealing) ForceSectorState

func (m *Sealing) ForceSectorState(ctx context.Context, id abi.SectorNumber, state SectorState) error

func (*Sealing) GetSectorInfo

func (m *Sealing) GetSectorInfo(sid abi.SectorNumber) (SectorInfo, error)

func (*Sealing) HandleRecoverDealIDs added in v1.11.2

func (m *Sealing) HandleRecoverDealIDs(ctx statemachine.Context, sector SectorInfo) error

func (*Sealing) ListSectors

func (m *Sealing) ListSectors() ([]SectorInfo, error)

func (*Sealing) MarkForSnapUpgrade added in v1.14.0

func (m *Sealing) MarkForSnapUpgrade(ctx context.Context, id abi.SectorNumber) error

func (*Sealing) MatchPendingPiecesToOpenSectors added in v1.14.0

func (m *Sealing) MatchPendingPiecesToOpenSectors(ctx context.Context) error

func (*Sealing) Plan

func (m *Sealing) Plan(events []statemachine.Event, user interface{}) (interface{}, uint64, error)

func (*Sealing) PledgeSector

func (m *Sealing) PledgeSector(ctx context.Context) (storage.SectorRef, error)

func (*Sealing) Remove

func (m *Sealing) Remove(ctx context.Context, sid abi.SectorNumber) error

func (*Sealing) Run

func (m *Sealing) Run(ctx context.Context) error

func (*Sealing) SectorAddPieceToAny added in v1.11.1

func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, data storage.Data, deal api.PieceDealInfo) (api.SectorOffset, error)

func (*Sealing) SectorPreCommitFlush added in v1.10.0

func (m *Sealing) SectorPreCommitFlush(ctx context.Context) ([]sealiface.PreCommitBatchRes, error)

func (*Sealing) SectorPreCommitPending added in v1.10.0

func (m *Sealing) SectorPreCommitPending(ctx context.Context) ([]abi.SectorID, error)

func (*Sealing) StartPacking

func (m *Sealing) StartPacking(sid abi.SectorNumber) error

func (*Sealing) Stop

func (m *Sealing) Stop(ctx context.Context) error

func (*Sealing) Terminate added in v1.4.1

func (m *Sealing) Terminate(ctx context.Context, sid abi.SectorNumber) error

func (*Sealing) TerminateFlush added in v1.4.1

func (m *Sealing) TerminateFlush(ctx context.Context) (*cid.Cid, error)

func (*Sealing) TerminatePending added in v1.4.1

func (m *Sealing) TerminatePending(ctx context.Context) ([]abi.SectorID, error)

type SealingAPI

type SealingAPI interface {
	StateWaitMsg(context.Context, cid.Cid) (MsgLookup, error)
	StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error)
	StateComputeDataCommitment(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tok TipSetToken) (cid.Cid, error)

	// Can return ErrSectorAllocated in case precommit info wasn't found, but the sector number is marked as allocated
	StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*miner.SectorPreCommitOnChainInfo, error)
	StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*miner.SectorOnChainInfo, error)
	StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*SectorLocation, error)
	StateLookupID(context.Context, address.Address, TipSetToken) (address.Address, error)
	StateMinerSectorSize(context.Context, address.Address, TipSetToken) (abi.SectorSize, error)
	StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tok TipSetToken) (address.Address, error)
	StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, TipSetToken) (big.Int, error)
	StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, TipSetToken) (big.Int, error)
	StateMinerInfo(context.Context, address.Address, TipSetToken) (api.MinerInfo, error)
	StateMinerAvailableBalance(context.Context, address.Address, TipSetToken) (big.Int, error)
	StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, TipSetToken) (bool, error)
	StateMinerActiveSectors(context.Context, address.Address, TipSetToken) (bitfield.BitField, error)
	StateMarketStorageDeal(context.Context, abi.DealID, TipSetToken) (*api.MarketDeal, error)
	StateMarketStorageDealProposal(context.Context, abi.DealID, TipSetToken) (market.DealProposal, error)
	StateNetworkVersion(ctx context.Context, tok TipSetToken) (network.Version, error)
	StateMinerProvingDeadline(context.Context, address.Address, TipSetToken) (*dline.Info, error)
	StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tok TipSetToken) ([]api.Partition, error)
	SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
	ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
	ChainBaseFee(context.Context, TipSetToken) (abi.TokenAmount, error)
	ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
	StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tok TipSetToken) (abi.Randomness, error)
	StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tok TipSetToken) (abi.Randomness, error)
	ChainReadObj(context.Context, cid.Cid) ([]byte, error)
}

type SectorAbortUpgrade added in v1.14.0

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

func (SectorAbortUpgrade) FormatError added in v1.14.0

func (evt SectorAbortUpgrade) FormatError(xerrors.Printer) (next error)

type SectorAddPiece

type SectorAddPiece struct{}

type SectorAddPieceFailed added in v1.5.1

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

func (SectorAddPieceFailed) FormatError added in v1.5.1

func (evt SectorAddPieceFailed) FormatError(xerrors.Printer) (next error)

type SectorChainPreCommitFailed

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

func (SectorChainPreCommitFailed) FormatError

func (evt SectorChainPreCommitFailed) FormatError(xerrors.Printer) (next error)

type SectorCommitAggregateSent added in v1.10.0

type SectorCommitAggregateSent struct {
	Message cid.Cid
}

type SectorCommitFailed

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

func (SectorCommitFailed) FormatError

func (evt SectorCommitFailed) FormatError(xerrors.Printer) (next error)

type SectorCommitSubmitted added in v0.5.5

type SectorCommitSubmitted struct {
	Message cid.Cid
}

type SectorCommitted

type SectorCommitted struct {
	Proof []byte
}

type SectorComputeProofFailed

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

func (SectorComputeProofFailed) FormatError

func (evt SectorComputeProofFailed) FormatError(xerrors.Printer) (next error)

type SectorDealsExpired added in v0.5.5

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

func (SectorDealsExpired) FormatError added in v0.5.5

func (evt SectorDealsExpired) FormatError(xerrors.Printer) (next error)

type SectorFatalError

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

func (SectorFatalError) FormatError

func (evt SectorFatalError) FormatError(xerrors.Printer) (next error)

type SectorFaultReported

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

type SectorFaultedFinal

type SectorFaultedFinal struct{}

type SectorFaulty

type SectorFaulty struct{}

type SectorFinalizeFailed

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

func (SectorFinalizeFailed) FormatError

func (evt SectorFinalizeFailed) FormatError(xerrors.Printer) (next error)

type SectorFinalized

type SectorFinalized struct{}

type SectorFinalizedAvailable added in v1.15.1

type SectorFinalizedAvailable struct{}

type SectorForceState

type SectorForceState struct {
	State SectorState
}

type SectorIDCounter

type SectorIDCounter interface {
	Next() (abi.SectorNumber, error)
}

type SectorInfo

type SectorInfo struct {
	State        SectorState
	SectorNumber abi.SectorNumber

	SectorType abi.RegisteredSealProof

	// Packing
	CreationTime int64 // unix seconds
	Pieces       []Piece

	// PreCommit1
	TicketValue   abi.SealRandomness
	TicketEpoch   abi.ChainEpoch
	PreCommit1Out storage.PreCommit1Out

	// PreCommit2
	CommD *cid.Cid
	CommR *cid.Cid // SectorKey
	Proof []byte

	PreCommitInfo    *miner.SectorPreCommitInfo
	PreCommitDeposit big.Int
	PreCommitMessage *cid.Cid
	PreCommitTipSet  TipSetToken

	PreCommit2Fails uint64

	// WaitSeed
	SeedValue abi.InteractiveSealRandomness
	SeedEpoch abi.ChainEpoch

	// Committing
	CommitMessage *cid.Cid
	InvalidProofs uint64 // failed proof computations (doesn't validate with proof inputs; can't compute)

	// CCUpdate
	CCUpdate             bool
	CCPieces             []Piece
	UpdateSealed         *cid.Cid
	UpdateUnsealed       *cid.Cid
	ReplicaUpdateProof   storage.ReplicaUpdateProof
	ReplicaUpdateMessage *cid.Cid

	// Faults
	FaultReportMsg *cid.Cid

	// Recovery
	Return ReturnState

	// Termination
	TerminateMessage *cid.Cid
	TerminatedAt     abi.ChainEpoch

	// Debug
	LastErr string

	Log []Log
}

func (*SectorInfo) MarshalCBOR

func (t *SectorInfo) MarshalCBOR(w io.Writer) error

func (*SectorInfo) UnmarshalCBOR

func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error)

type SectorInvalidDealIDs added in v0.5.5

type SectorInvalidDealIDs struct {
	Return ReturnState
}

type SectorKeyReleased added in v1.14.0

type SectorKeyReleased struct{}

type SectorLocation

type SectorLocation struct {
	Deadline  uint64
	Partition uint64
}

type SectorMarkForUpdate added in v1.15.1

type SectorMarkForUpdate struct{}

type SectorOldTicket added in v1.1.3

type SectorOldTicket struct{}

type SectorPacked

type SectorPacked struct{ FillerPieces []abi.PieceInfo }

type SectorPieceAdded added in v1.5.1

type SectorPieceAdded struct {
	NewPieces []Piece
}

type SectorPreCommit1

type SectorPreCommit1 struct {
	PreCommit1Out storage.PreCommit1Out
}

type SectorPreCommit2

type SectorPreCommit2 struct {
	Sealed   cid.Cid
	Unsealed cid.Cid
}

type SectorPreCommitBatch added in v1.10.0

type SectorPreCommitBatch struct{}

type SectorPreCommitBatchSent added in v1.10.0

type SectorPreCommitBatchSent struct {
	Message cid.Cid
}

type SectorPreCommitLanded

type SectorPreCommitLanded struct {
	TipSet TipSetToken
}

type SectorPreCommitted

type SectorPreCommitted struct {
	Message          cid.Cid
	PreCommitDeposit big.Int
	PreCommitInfo    miner.SectorPreCommitInfo
}

type SectorProofReady added in v1.10.0

type SectorProofReady struct {
	Proof []byte
}

like SectorCommitted, but finalizes before sending the proof to the chain

type SectorProveReplicaUpdate added in v1.14.0

type SectorProveReplicaUpdate struct {
	Proof storage.ReplicaUpdateProof
}

type SectorProveReplicaUpdateFailed added in v1.14.0

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

func (SectorProveReplicaUpdateFailed) FormatError added in v1.14.0

func (evt SectorProveReplicaUpdateFailed) FormatError(xerrors.Printer) (next error)

type SectorProving

type SectorProving struct{}

type SectorReleaseKeyFailed added in v1.14.0

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

func (SectorReleaseKeyFailed) FormatError added in v1.14.0

func (evt SectorReleaseKeyFailed) FormatError(xerrors.Printer) (next error)

type SectorRemove

type SectorRemove struct{}

type SectorRemoveFailed

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

func (SectorRemoveFailed) FormatError

func (evt SectorRemoveFailed) FormatError(xerrors.Printer) (next error)

type SectorRemoved

type SectorRemoved struct{}

type SectorReplicaUpdate added in v1.14.0

type SectorReplicaUpdate struct {
	Out storage.ReplicaUpdateOut
}

type SectorReplicaUpdateLanded added in v1.14.0

type SectorReplicaUpdateLanded struct{}

type SectorReplicaUpdateSubmitted added in v1.14.0

type SectorReplicaUpdateSubmitted struct {
	Message cid.Cid
}

type SectorRestart

type SectorRestart struct{}

type SectorRetryCommitWait

type SectorRetryCommitWait struct{}

type SectorRetryComputeProof

type SectorRetryComputeProof struct{}

type SectorRetryFinalize

type SectorRetryFinalize struct{}

type SectorRetryInvalidProof

type SectorRetryInvalidProof struct{}

type SectorRetryPreCommit

type SectorRetryPreCommit struct{}

type SectorRetryPreCommitWait

type SectorRetryPreCommitWait struct{}

type SectorRetryProveReplicaUpdate added in v1.14.0

type SectorRetryProveReplicaUpdate struct{}

type SectorRetryReplicaUpdate added in v1.14.0

type SectorRetryReplicaUpdate struct{}

type SectorRetrySealPreCommit1

type SectorRetrySealPreCommit1 struct{}

type SectorRetrySealPreCommit2

type SectorRetrySealPreCommit2 struct{}

type SectorRetrySubmitCommit added in v0.5.5

type SectorRetrySubmitCommit struct{}

type SectorRetrySubmitReplicaUpdate added in v1.14.0

type SectorRetrySubmitReplicaUpdate struct{}

type SectorRetrySubmitReplicaUpdateWait added in v1.14.0

type SectorRetrySubmitReplicaUpdateWait struct{}

type SectorRetryWaitDeals added in v1.13.0

type SectorRetryWaitDeals struct{}

type SectorRetryWaitSeed

type SectorRetryWaitSeed struct{}

type SectorRevertUpgradeToProving added in v1.14.0

type SectorRevertUpgradeToProving struct{}

type SectorSealPreCommit1Failed

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

func (SectorSealPreCommit1Failed) FormatError

func (evt SectorSealPreCommit1Failed) FormatError(xerrors.Printer) (next error)

type SectorSealPreCommit2Failed

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

func (SectorSealPreCommit2Failed) FormatError

func (evt SectorSealPreCommit2Failed) FormatError(xerrors.Printer) (next error)

type SectorSeedReady

type SectorSeedReady struct {
	SeedValue abi.InteractiveSealRandomness
	SeedEpoch abi.ChainEpoch
}

type SectorStart

type SectorStart struct {
	ID         abi.SectorNumber
	SectorType abi.RegisteredSealProof
}

type SectorStartCC

type SectorStartCC struct {
	ID         abi.SectorNumber
	SectorType abi.RegisteredSealProof
}

type SectorStartCCUpdate added in v1.14.0

type SectorStartCCUpdate struct{}

type SectorStartPacking

type SectorStartPacking struct{}

func (SectorStartPacking) Ignore

func (evt SectorStartPacking) Ignore()

type SectorState

type SectorState string
const (
	UndefinedSectorState SectorState = ""

	// happy path
	Empty      SectorState = "Empty"      // deprecated
	WaitDeals  SectorState = "WaitDeals"  // waiting for more pieces (deals) to be added to the sector
	AddPiece   SectorState = "AddPiece"   // put deal data (and padding if required) into the sector
	Packing    SectorState = "Packing"    // sector not in sealStore, and not on chain
	GetTicket  SectorState = "GetTicket"  // generate ticket
	PreCommit1 SectorState = "PreCommit1" // do PreCommit1
	PreCommit2 SectorState = "PreCommit2" // do PreCommit2

	PreCommitting SectorState = "PreCommitting" // on chain pre-commit
	PreCommitWait SectorState = "PreCommitWait" // waiting for precommit to land on chain

	SubmitPreCommitBatch SectorState = "SubmitPreCommitBatch"
	PreCommitBatchWait   SectorState = "PreCommitBatchWait"

	WaitSeed             SectorState = "WaitSeed"       // waiting for seed
	Committing           SectorState = "Committing"     // compute PoRep
	CommitFinalize       SectorState = "CommitFinalize" // cleanup sector metadata before submitting the proof (early finalize)
	CommitFinalizeFailed SectorState = "CommitFinalizeFailed"

	// single commit
	SubmitCommit SectorState = "SubmitCommit" // send commit message to the chain
	CommitWait   SectorState = "CommitWait"   // wait for the commit message to land on chain

	SubmitCommitAggregate SectorState = "SubmitCommitAggregate"
	CommitAggregateWait   SectorState = "CommitAggregateWait"

	FinalizeSector SectorState = "FinalizeSector"
	Proving        SectorState = "Proving"
	Available      SectorState = "Available" // proving CC available for SnapDeals

	// snap deals / cc update
	SnapDealsWaitDeals    SectorState = "SnapDealsWaitDeals"
	SnapDealsAddPiece     SectorState = "SnapDealsAddPiece"
	SnapDealsPacking      SectorState = "SnapDealsPacking"
	UpdateReplica         SectorState = "UpdateReplica"
	ProveReplicaUpdate    SectorState = "ProveReplicaUpdate"
	SubmitReplicaUpdate   SectorState = "SubmitReplicaUpdate"
	ReplicaUpdateWait     SectorState = "ReplicaUpdateWait"
	FinalizeReplicaUpdate SectorState = "FinalizeReplicaUpdate"
	UpdateActivating      SectorState = "UpdateActivating"
	ReleaseSectorKey      SectorState = "ReleaseSectorKey"

	// error modes
	FailedUnrecoverable  SectorState = "FailedUnrecoverable"
	AddPieceFailed       SectorState = "AddPieceFailed"
	SealPreCommit1Failed SectorState = "SealPreCommit1Failed"
	SealPreCommit2Failed SectorState = "SealPreCommit2Failed"
	PreCommitFailed      SectorState = "PreCommitFailed"
	ComputeProofFailed   SectorState = "ComputeProofFailed"
	CommitFailed         SectorState = "CommitFailed"
	PackingFailed        SectorState = "PackingFailed" // TODO: deprecated, remove
	FinalizeFailed       SectorState = "FinalizeFailed"
	DealsExpired         SectorState = "DealsExpired"
	RecoverDealIDs       SectorState = "RecoverDealIDs"

	// snap deals error modes
	SnapDealsAddPieceFailed     SectorState = "SnapDealsAddPieceFailed"
	SnapDealsDealsExpired       SectorState = "SnapDealsDealsExpired"
	SnapDealsRecoverDealIDs     SectorState = "SnapDealsRecoverDealIDs"
	AbortUpgrade                SectorState = "AbortUpgrade"
	ReplicaUpdateFailed         SectorState = "ReplicaUpdateFailed"
	ReleaseSectorKeyFailed      SectorState = "ReleaseSectorKeyFailed"
	FinalizeReplicaUpdateFailed SectorState = "FinalizeReplicaUpdateFailed"

	Faulty        SectorState = "Faulty"        // sector is corrupted or gone for some reason
	FaultReported SectorState = "FaultReported" // sector has been declared as a fault on chain
	FaultedFinal  SectorState = "FaultedFinal"  // fault declared on chain

	Terminating       SectorState = "Terminating"
	TerminateWait     SectorState = "TerminateWait"
	TerminateFinality SectorState = "TerminateFinality"
	TerminateFailed   SectorState = "TerminateFailed"

	Removing     SectorState = "Removing"
	RemoveFailed SectorState = "RemoveFailed"
	Removed      SectorState = "Removed"
)

cmd/lotus-miner/info.go defines CLI colors corresponding to these states update files there when adding new states

type SectorStateNotifee added in v0.7.1

type SectorStateNotifee func(before, after SectorInfo)

type SectorStats

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

type SectorSubmitCommitAggregate added in v1.10.0

type SectorSubmitCommitAggregate struct{}

type SectorSubmitReplicaUpdateFailed added in v1.14.0

type SectorSubmitReplicaUpdateFailed struct{}

type SectorTerminate added in v1.4.1

type SectorTerminate struct{}

type SectorTerminateFailed added in v1.4.1

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

func (SectorTerminateFailed) FormatError added in v1.4.1

func (evt SectorTerminateFailed) FormatError(xerrors.Printer) (next error)

type SectorTerminated added in v1.4.1

type SectorTerminated struct{ TerminatedAt abi.ChainEpoch }

type SectorTerminating added in v1.4.1

type SectorTerminating struct{ Message *cid.Cid }

type SectorTicket added in v1.1.3

type SectorTicket struct {
	TicketValue abi.SealRandomness
	TicketEpoch abi.ChainEpoch
}

type SectorTicketExpired added in v1.1.3

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

func (SectorTicketExpired) FormatError added in v1.1.3

func (evt SectorTicketExpired) FormatError(xerrors.Printer) (next error)

type SectorUpdateActive added in v1.14.0

type SectorUpdateActive struct{}

type SectorUpdateDealIDs added in v0.5.5

type SectorUpdateDealIDs struct {
	Updates map[int]abi.DealID
}

type SectorUpdateReplicaFailed added in v1.14.0

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

func (SectorUpdateReplicaFailed) FormatError added in v1.14.0

func (evt SectorUpdateReplicaFailed) FormatError(xerrors.Printer) (next error)

type TerminateBatcher added in v1.4.1

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

func NewTerminationBatcher added in v1.4.1

func NewTerminationBatcher(mctx context.Context, maddr address.Address, api TerminateBatcherApi, addrSel AddrSel, feeCfg config.MinerFeeConfig, getConfig GetSealingConfigFunc) *TerminateBatcher

func (*TerminateBatcher) AddTermination added in v1.4.1

func (b *TerminateBatcher) AddTermination(ctx context.Context, s abi.SectorID) (mcid cid.Cid, terminated bool, err error)

register termination, wait for batch message, return message CID can return cid.Undef,true if the sector is already terminated on-chain

func (*TerminateBatcher) Flush added in v1.4.1

func (b *TerminateBatcher) Flush(ctx context.Context) (*cid.Cid, error)

func (*TerminateBatcher) Pending added in v1.4.1

func (b *TerminateBatcher) Pending(ctx context.Context) ([]abi.SectorID, error)

func (*TerminateBatcher) Stop added in v1.4.1

func (b *TerminateBatcher) Stop(ctx context.Context) error

type TerminateBatcherApi added in v1.4.1

type TerminateBatcherApi interface {
	StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*SectorLocation, error)
	SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
	StateMinerInfo(context.Context, address.Address, TipSetToken) (api.MinerInfo, error)
	StateMinerProvingDeadline(context.Context, address.Address, TipSetToken) (*dline.Info, error)
	StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tok TipSetToken) ([]api.Partition, error)
}

type TipSetToken

type TipSetToken []byte

Directories

Path Synopsis
lib
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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