power

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0, MIT Imports: 52 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AllCodes added in v1.10.0

func AllCodes() []cid.Cid

Types

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 AddClaims

func AddClaims(a Claim, b Claim) Claim

type ClaimChanges

type ClaimChanges struct {
	Added    []ClaimInfo
	Modified []ClaimModification
	Removed  []ClaimInfo
}

func DiffClaims

func DiffClaims(pre, cur State) (*ClaimChanges, error)

type ClaimInfo

type ClaimInfo struct {
	Miner address.Address
	Claim Claim
}

type ClaimModification

type ClaimModification struct {
	Miner address.Address
	From  Claim
	To    Claim
}

type State

type State interface {
	cbor.Marshaler

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

	TotalLocked() (abi.TokenAmount, error)
	TotalPower() (Claim, error)
	TotalCommitted() (Claim, error)
	TotalPowerSmoothed() (builtin.FilterEstimate, error)
	GetState() interface{}

	// MinerCounts returns the number of miners. Participating is the number
	// with power above the minimum miner threshold.
	MinerCounts() (participating, total uint64, err error)
	// RampStartEpoch returns the epoch at which the FIP0081 pledge calculation
	// change begins. At and before RampStartEpoch, we use the old calculation. At
	// RampStartEpoch + RampDurationEpochs, we use 70% old rules + 30% new
	// calculation.
	//
	// This method always returns 0 prior to actors version 15.
	RampStartEpoch() int64
	// RampDurationEpochs returns the number of epochs over which the new FIP0081
	// pledge calculation is ramped up.
	//
	// This method always returns 0 prior to actors version 15.
	RampDurationEpochs() uint64
	MinerPower(address.Address) (Claim, bool, error)
	MinerNominalPowerMeetsConsensusMinimum(address.Address) (bool, error)
	ListAllMiners() ([]address.Address, error)
	ForEachClaim(func(miner address.Address, claim Claim) error) error
	ClaimsChanged(State) (bool, error)

	// Testing or genesis setup only
	SetTotalQualityAdjPower(abi.StoragePower) error
	SetTotalRawBytePower(abi.StoragePower) error
	SetThisEpochQualityAdjPower(abi.StoragePower) error
	SetThisEpochRawBytePower(abi.StoragePower) error
	// contains filtered or unexported methods
}

func Load

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

func MakeState

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

Jump to

Keyboard shortcuts

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