power

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0, MIT Imports: 21 Imported by: 30

Documentation

Index

Constants

View Source
const ConsensusMinerMinMiners = 3

Minimum number of registered miners for the minimum miner size limit to effectively limit consensus power.

View Source
const (
	ErrTooManyProveCommits = exitcode.FirstActorSpecificExitCode + iota
)
View Source
const GasOnSubmitVerifySeal = 34721049

GasOnSubmitVerifySeal is amount of gas charged for SubmitPoRepForBulkVerify This number is empirically determined

View Source
const MaxMinerProveCommitsPerEpoch = 200

Maximum number of prove commits a miner can submit in one epoch

We bound this to 200 to limit the number of prove partitions we may need to update in a given epoch to 200.

To support onboarding 1EiB/year, we need to allow at least 32 prove commits per epoch.

Variables

View Source
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)

Minimum power of an individual miner to meet the threshold for leader election.

View Source
var InitialQAPowerEstimatePosition = big.Mul(big.NewInt(750_000), big.NewInt(1<<30))

genesis power in bytes = 750,000 GiB

View Source
var InitialQAPowerEstimateVelocity = big.Mul(big.NewInt(3_840), big.NewInt(1<<30))

max chain throughput in bytes per epoch = 120 ProveCommits / epoch = 3,840 GiB

Functions

func CurrentTotalPower added in v0.7.2

func CurrentTotalPower(st *State) (abi.StoragePower, abi.StoragePower)

CurrentTotalPower returns current power values accounting for minimum miner and minimum power

Types

type Actor

type Actor struct{}

func (Actor) Code added in v0.9.12

func (a Actor) Code() cid.Cid

func (Actor) Constructor

func (a Actor) Constructor(rt Runtime, _ *abi.EmptyValue) *abi.EmptyValue

func (Actor) CreateMiner

func (a Actor) CreateMiner(rt Runtime, params *CreateMinerParams) *CreateMinerReturn

func (Actor) CurrentTotalPower added in v0.7.0

func (a Actor) CurrentTotalPower(rt Runtime, _ *abi.EmptyValue) *CurrentTotalPowerReturn

Returns the total power and pledge recorded by the power actor. The returned values are frozen during the cron tick before this epoch so that this method returns consistent values while processing all messages of an epoch.

func (Actor) EnrollCronEvent

func (a Actor) EnrollCronEvent(rt Runtime, params *EnrollCronEventParams) *abi.EmptyValue

func (Actor) Exports

func (a Actor) Exports() []interface{}

func (Actor) IsSingleton added in v0.9.12

func (a Actor) IsSingleton() bool

func (Actor) OnConsensusFault

func (a Actor) OnConsensusFault(rt Runtime, pledgeAmount *abi.TokenAmount) *abi.EmptyValue

func (Actor) OnEpochTickEnd

func (a Actor) OnEpochTickEnd(rt Runtime, _ *abi.EmptyValue) *abi.EmptyValue

Called by Cron.

func (Actor) State added in v0.9.12

func (a Actor) State() cbor.Er

func (Actor) SubmitPoRepForBulkVerify added in v0.5.4

func (a Actor) SubmitPoRepForBulkVerify(rt Runtime, sealInfo *proof.SealVerifyInfo) *abi.EmptyValue

func (Actor) UpdateClaimedPower added in v0.7.0

func (a Actor) UpdateClaimedPower(rt Runtime, params *UpdateClaimedPowerParams) *abi.EmptyValue

Adds or removes claimed power for the calling actor. May only be invoked by a miner actor.

func (Actor) UpdatePledgeTotal

func (a Actor) UpdatePledgeTotal(rt Runtime, pledgeDelta *abi.TokenAmount) *abi.EmptyValue

type Claim

type Claim struct {
	// Sum of raw byte power for a miner's sectors.
	RawBytePower abi.StoragePower

	// Sum of quality adjusted power for a miner's sectors.
	QualityAdjPower abi.StoragePower
}

func (*Claim) MarshalCBOR

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

func (*Claim) UnmarshalCBOR

func (t *Claim) UnmarshalCBOR(r io.Reader) error

type CreateMinerParams

type CreateMinerParams struct {
	Owner         addr.Address
	Worker        addr.Address
	SealProofType abi.RegisteredSealProof
	Peer          abi.PeerID
	Multiaddrs    []abi.Multiaddrs
}

func (*CreateMinerParams) MarshalCBOR

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

func (*CreateMinerParams) UnmarshalCBOR

func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) error

type CreateMinerReturn

type CreateMinerReturn struct {
	IDAddress     addr.Address // The canonical ID-based address for the actor.
	RobustAddress addr.Address // A more expensive but re-org-safe address for the newly created actor.
}

func (*CreateMinerReturn) MarshalCBOR

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

func (*CreateMinerReturn) UnmarshalCBOR

func (t *CreateMinerReturn) UnmarshalCBOR(r io.Reader) error

type CronEvent

type CronEvent struct {
	MinerAddr       addr.Address
	CallbackPayload []byte
}

func (*CronEvent) MarshalCBOR

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

func (*CronEvent) UnmarshalCBOR

func (t *CronEvent) UnmarshalCBOR(r io.Reader) error

type CurrentTotalPowerReturn added in v0.7.0

type CurrentTotalPowerReturn struct {
	RawBytePower            abi.StoragePower
	QualityAdjPower         abi.StoragePower
	PledgeCollateral        abi.TokenAmount
	QualityAdjPowerSmoothed *smoothing.FilterEstimate
}

func (*CurrentTotalPowerReturn) MarshalCBOR added in v0.7.0

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

func (*CurrentTotalPowerReturn) UnmarshalCBOR added in v0.7.0

func (t *CurrentTotalPowerReturn) UnmarshalCBOR(r io.Reader) error

type EnrollCronEventParams

type EnrollCronEventParams struct {
	EventEpoch abi.ChainEpoch
	Payload    []byte
}

func (*EnrollCronEventParams) MarshalCBOR

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

func (*EnrollCronEventParams) UnmarshalCBOR

func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) error

type MinerConstructorParams

type MinerConstructorParams struct {
	OwnerAddr     addr.Address
	WorkerAddr    addr.Address
	ControlAddrs  []addr.Address
	SealProofType abi.RegisteredSealProof
	PeerId        abi.PeerID
	Multiaddrs    []abi.Multiaddrs
}

Storage miner actor constructor params are defined here so the power actor can send them to the init actor to instantiate miners.

func (*MinerConstructorParams) MarshalCBOR

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

func (*MinerConstructorParams) UnmarshalCBOR

func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) error

type Runtime

type Runtime = runtime.Runtime

type SectorStorageWeightDesc

type SectorStorageWeightDesc struct {
	SectorSize         abi.SectorSize
	Duration           abi.ChainEpoch
	DealWeight         abi.DealWeight
	VerifiedDealWeight abi.DealWeight
}

func (*SectorStorageWeightDesc) MarshalCBOR

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

func (*SectorStorageWeightDesc) UnmarshalCBOR

func (t *SectorStorageWeightDesc) UnmarshalCBOR(r io.Reader) error

type SectorTermination

type SectorTermination int64

type State

type State struct {
	TotalRawBytePower abi.StoragePower
	// TotalBytesCommitted includes claims from miners below min power threshold
	TotalBytesCommitted  abi.StoragePower
	TotalQualityAdjPower abi.StoragePower
	// TotalQABytesCommitted includes claims from miners below min power threshold
	TotalQABytesCommitted abi.StoragePower
	TotalPledgeCollateral abi.TokenAmount

	// These fields are set once per epoch in the previous cron tick and used
	// for consistent values across a single epoch's state transition.
	ThisEpochRawBytePower     abi.StoragePower
	ThisEpochQualityAdjPower  abi.StoragePower
	ThisEpochPledgeCollateral abi.TokenAmount
	ThisEpochQAPowerSmoothed  *smoothing.FilterEstimate

	MinerCount int64
	// Number of miners having proven the minimum consensus power.
	MinerAboveMinPowerCount int64

	// A queue of events to be triggered by cron, indexed by epoch.
	CronEventQueue cid.Cid // Multimap, (HAMT[ChainEpoch]AMT[CronEvent]

	// First epoch in which a cron task may be stored.
	// Cron will iterate every epoch between this and the current epoch inclusively to find tasks to execute.
	FirstCronEpoch abi.ChainEpoch

	// Last epoch power cron tick has been processed.
	LastProcessedCronEpoch abi.ChainEpoch

	// Claimed power for each miner.
	Claims cid.Cid // Map, HAMT[address]Claim

	ProofValidationBatch *cid.Cid
}

func ConstructState

func ConstructState(emptyMapCid, emptyMMapCid cid.Cid) *State

func (*State) AddToClaim

func (st *State) AddToClaim(s adt.Store, miner addr.Address, power abi.StoragePower, qapower abi.StoragePower) error

Parameters may be negative to subtract.

func (*State) MarshalCBOR

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

func (*State) MinerNominalPowerMeetsConsensusMinimum added in v0.7.2

func (st *State) MinerNominalPowerMeetsConsensusMinimum(s adt.Store, miner addr.Address) (bool, error)

MinerNominalPowerMeetsConsensusMinimum is used to validate Election PoSt winners outside the chain state. If the miner has over a threshold of power the miner meets the minimum. If the network is a below a threshold of miners and has power > zero the miner meets the minimum.

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) error

type UpdateClaimedPowerParams added in v0.7.0

type UpdateClaimedPowerParams struct {
	RawByteDelta         abi.StoragePower
	QualityAdjustedDelta abi.StoragePower
}

func (*UpdateClaimedPowerParams) MarshalCBOR added in v0.7.0

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

func (*UpdateClaimedPowerParams) UnmarshalCBOR added in v0.7.0

func (t *UpdateClaimedPowerParams) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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