miner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddressedSectorsMax = miner3.AddressedSectorsMax
View Source
var DeclarationsMax = miner3.DeclarationsMax

Not used / checked in v0

View Source
var FaultDeclarationCutoff = miner3.FaultDeclarationCutoff
View Source
var WPoStChallengeLookback = miner3.WPoStChallengeLookback
View Source
var WPoStChallengeWindow = miner3.WPoStChallengeWindow
View Source
var WPoStPeriodDeadlines = miner3.WPoStPeriodDeadlines
View Source
var WPoStProvingPeriod = miner3.WPoStProvingPeriod

Unchanged between v0, v2 and v3 actors

Functions

func AllPartSectors

func AllPartSectors(mas State, sget func(Partition) (bitfield.BitField, error)) (bitfield.BitField, error)

func PreferredSealProofTypeFromWindowPoStType

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

func SealProofTypeFromSectorSize

func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.RegisteredSealProof, error)

SealProofTypeFromSectorSize returns preferred seal proof type for creating new miner actors and new sectors

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 DeadlineDiff

type DeadlineDiff map[uint64]*PartitionDiff

func DiffDeadline

func DiffDeadline(pre, cur Deadline) (DeadlineDiff, error)

type DeadlinesDiff

type DeadlinesDiff map[uint64]DeadlineDiff

func DiffDeadlines

func DiffDeadlines(pre, cur State) (DeadlinesDiff, error)

type DeclareFaultsParams

type DeclareFaultsParams = miner3.DeclareFaultsParams

Params

type DeclareFaultsRecoveredParams

type DeclareFaultsRecoveredParams = miner3.DeclareFaultsRecoveredParams

type DisputeWindowedPoStParams

type DisputeWindowedPoStParams = miner3.DisputeWindowedPoStParams

type FaultDeclaration

type FaultDeclaration = miner3.FaultDeclaration

type Funds

type Funds struct {
	MiningPledge       abi.TokenAmount
	MiningPledgors     map[string]abi.TokenAmount
	MiningPledgeLocked map[string]PledgeLocked
	FeeDebt            abi.TokenAmount
	ReporterDebts      map[string]abi.TokenAmount
}

type MinerInfo

type MinerInfo struct {
	Owner                      address.Address   // Must be an ID-address.
	Worker                     address.Address   // Must be an ID-address.
	NewWorker                  address.Address   // Must be an ID-address.
	ControlAddresses           []address.Address // Must be an ID-addresses.
	Coinbase                   address.Address   // Must be an ID-address.
	WorkerChangeEpoch          abi.ChainEpoch
	PeerId                     *peer.ID
	Multiaddrs                 []abi.Multiaddrs
	WindowPoStProofType        abi.RegisteredPoStProof
	SectorSize                 abi.SectorSize
	WindowPoStPartitionSectors uint64
	ConsensusFaultElapsed      abi.ChainEpoch
	RetrievalPledger           address.Address
	TotalMined                 abi.TokenAmount
}

func (MinerInfo) IsController

func (mi MinerInfo) IsController(addr address.Address) bool

type Partition

type Partition interface {
	AllSectors() (bitfield.BitField, error)
	FaultySectors() (bitfield.BitField, error)
	RecoveringSectors() (bitfield.BitField, error)
	LiveSectors() (bitfield.BitField, error)
	ActiveSectors() (bitfield.BitField, error)
}

type PartitionDiff

type PartitionDiff struct {
	Removed    bitfield.BitField
	Recovered  bitfield.BitField
	Faulted    bitfield.BitField
	Recovering bitfield.BitField
}

func DiffPartition

func DiffPartition(pre, cur Partition) (*PartitionDiff, error)

type PledgeLocked

type PledgeLocked = miner3.PledgeLocked

type PoStPartition

type PoStPartition = miner3.PoStPartition

type PreCommitChanges

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

func DiffPreCommits

func DiffPreCommits(pre, cur State) (*PreCommitChanges, error)

type ProveCommitSectorParams

type ProveCommitSectorParams = miner3.ProveCommitSectorParams

type RecoveryDeclaration

type RecoveryDeclaration = miner3.RecoveryDeclaration

type SectorChanges

type SectorChanges struct {
	Added   []SectorOnChainInfo
	Removed []SectorOnChainInfo
}

func DiffSectors

func DiffSectors(pre, cur State) (*SectorChanges, error)

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 SectorLocation

type SectorLocation struct {
	Deadline  uint64
	Partition uint64
}

type SectorOnChainInfo

type SectorOnChainInfo struct {
	SectorNumber abi.SectorNumber
	SealProof    abi.RegisteredSealProof
	SealedCID    cid.Cid
	DealIDs      []abi.DealID
	Activation   abi.ChainEpoch
	PieceSizes   []abi.PaddedPieceSize
	DealWins     []builtin3.BoolValue
}

type SectorPreCommitInfo

type SectorPreCommitInfo = miner3.SectorPreCommitInfo

type SectorPreCommitOnChainInfo

type SectorPreCommitOnChainInfo struct {
	Info           SectorPreCommitInfo
	PreCommitEpoch abi.ChainEpoch
	PieceSizes     []abi.PaddedPieceSize
}

type State

type State interface {
	cbor.Marshaler

	Funds() (Funds, error)

	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
	FindSector(abi.SectorNumber) (*SectorLocation, error)
	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
	GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
	LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
	NumLiveSectors() (uint64, error)
	IsAllocated(abi.SectorNumber) (bool, 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)

	ContainsAnyPiece([]cid.Cid) (bool, error)
	// contains filtered or unexported methods
}

func Load

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

type SubmitWindowedPoStParams

type SubmitWindowedPoStParams = miner3.SubmitWindowedPoStParams

Jump to

Keyboard shortcuts

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