miner

package
v0.12.0-rc3 Latest Latest
Warning

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

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

Documentation

Overview

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Code generated by: `make actors-gen`. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCodes

func AllCodes() []cid.Cid

func ArrayRequiresLegacyDiffing added in v0.9.0

func ArrayRequiresLegacyDiffing(pre, cur State, pOpts, cOpts int) bool

func MapRequiresLegacyDiffing added in v0.9.0

func MapRequiresLegacyDiffing(pre, cur State, pOpts, cOpts *adt.MapOpts) bool

func NewPreCommitDiffContainer

func NewPreCommitDiffContainer(pre, cur State) *preCommitDiffContainer

func NewSectorDiffContainer

func NewSectorDiffContainer(pre, cur State) *sectorDiffContainer

func PreferredSealProofTypeFromWindowPoStType

func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error)

func VersionCodes added in v0.11.0

func VersionCodes() map[actors.Version]cid.Cid

func WinningPoStProofTypeFromWindowPoStProofType

func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredPoStProof, error)

Types

type Deadline

type Deadline interface {
	LoadPartition(idx uint64) (Partition, error)
	ForEachPartition(cb func(idx uint64, part Partition) error) error
	PartitionsPoSted() (bitfield.BitField, error)

	PartitionsChanged(Deadline) (bool, error)
	DisputableProofCount() (uint64, error)
}

type LockedFunds

type LockedFunds struct {
	VestingFunds             abi.TokenAmount
	InitialPledgeRequirement abi.TokenAmount
	PreCommitDeposits        abi.TokenAmount
}

func (LockedFunds) TotalLockedFunds

func (lf LockedFunds) TotalLockedFunds() abi.TokenAmount

type MinerInfo

type MinerInfo = miner8.MinerInfo

type Partition

type Partition interface {
	// AllSectors returns all sector numbers in this partition, including faulty, unproven, and terminated sectors
	AllSectors() (bitfield.BitField, error)

	// Subset of sectors detected/declared faulty and not yet recovered (excl. from PoSt).
	// Faults ∩ Terminated = ∅
	FaultySectors() (bitfield.BitField, error)

	// Subset of faulty sectors expected to recover on next PoSt
	// Recoveries ∩ Terminated = ∅
	RecoveringSectors() (bitfield.BitField, error)

	// Live sectors are those that are not terminated (but may be faulty).
	LiveSectors() (bitfield.BitField, error)

	// Active sectors are those that are neither terminated nor faulty nor unproven, i.e. actively contributing power.
	ActiveSectors() (bitfield.BitField, error)

	// Unproven sectors in this partition. This bitfield will be cleared on
	// a successful window post (or at the end of the partition's next
	// deadline). At that time, any still unproven sectors will be added to
	// the faulty sector bitfield.
	UnprovenSectors() (bitfield.BitField, error)
}

type PreCommitChanges

type PreCommitChanges struct {
	Added   []miner8.SectorPreCommitOnChainInfo
	Removed []miner8.SectorPreCommitOnChainInfo
}

func DiffPreCommits

func DiffPreCommits(ctx context.Context, store adt.Store, pre, cur State) (*PreCommitChanges, error)

func MakePreCommitChanges added in v0.9.0

func MakePreCommitChanges() *PreCommitChanges

type SectorChanges

type SectorChanges struct {
	Added    []SectorOnChainInfo
	Extended []SectorModification
	Snapped  []SectorModification
	Removed  []SectorOnChainInfo
}

func DiffSectors

func DiffSectors(ctx context.Context, store adt.Store, pre, cur State) (*SectorChanges, error)

func MakeSectorChanges added in v0.9.0

func MakeSectorChanges() *SectorChanges

type SectorExpiration

type SectorExpiration struct {
	OnTime abi.ChainEpoch

	// non-zero if sector is faulty, epoch at which it will be permanently
	// removed if it doesn't recover
	Early abi.ChainEpoch
}

type SectorExtensions

type SectorExtensions struct {
	From SectorOnChainInfo
	To   SectorOnChainInfo
}

type SectorLocation

type SectorLocation struct {
	Deadline  uint64
	Partition uint64
}

type SectorModification added in v0.8.6

type SectorModification struct {
	From SectorOnChainInfo
	To   SectorOnChainInfo
}

type SectorOnChainInfo

type SectorOnChainInfo = miner8.SectorOnChainInfo

type State

type State interface {
	cbor.Marshaler

	Code() cid.Cid
	ActorKey() string
	ActorVersion() actors.Version

	// Total available balance to spend.
	AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)
	// Funds that will vest by the given epoch.
	VestedFunds(abi.ChainEpoch) (abi.TokenAmount, error)
	// Funds locked for various reasons.
	LockedFunds() (LockedFunds, error)
	FeeDebt() (abi.TokenAmount, error)

	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
	FindSector(abi.SectorNumber) (*SectorLocation, error)
	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
	GetPrecommittedSector(abi.SectorNumber) (*miner8.SectorPreCommitOnChainInfo, error)
	ForEachPrecommittedSector(func(miner8.SectorPreCommitOnChainInfo) error) error
	LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
	NumLiveSectors() (uint64, error)
	IsAllocated(abi.SectorNumber) (bool, error)
	// UnallocatedSectorNumbers returns up to count unallocated sector numbers (or less than
	// count if there aren't enough).
	UnallocatedSectorNumbers(count int) ([]abi.SectorNumber, error)
	GetAllocatedSectors() (*bitfield.BitField, error)

	// Note that ProvingPeriodStart is deprecated and will be renamed / removed in a future version of actors
	GetProvingPeriodStart() (abi.ChainEpoch, error)
	// Testing only
	EraseAllUnproven() error

	LoadDeadline(idx uint64) (Deadline, error)
	ForEachDeadline(cb func(idx uint64, dl Deadline) error) error
	NumDeadlines() (uint64, error)
	DeadlinesChanged(State) (bool, error)

	Info() (MinerInfo, error)
	MinerInfoChanged(State) (bool, error)

	DeadlineInfo(epoch abi.ChainEpoch) (*dline.Info, error)
	DeadlineCronActive() (bool, error)

	GetState() interface{}

	// Diff helpers. Used by Diff* functions internally.
	SectorsArray() (adt.Array, error)
	SectorsAmtBitwidth() int
	DecodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)

	PrecommitsMap() (adt.Map, error)
	PrecommitsMapBitWidth() int
	PrecommitsMapHashFunction() func(input []byte) []byte
	DecodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner8.SectorPreCommitOnChainInfo, error)
}

func Load

func Load(store adt.Store, act *types.Actor) (State, error)

func MakeState added in v0.11.0

func MakeState(store adt.Store, av actors.Version) (State, error)

type WindowPostVerifyInfo added in v0.11.0

type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo

type WorkerKeyChange added in v0.11.0

type WorkerKeyChange = miner8.WorkerKeyChange

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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