Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentTotalPower(st *State) (abi.StoragePower, abi.StoragePower)
- type Actor
- func (a Actor) Code() cid.Cid
- func (a Actor) Constructor(rt Runtime, _ *abi.EmptyValue) *abi.EmptyValue
- func (a Actor) CreateMiner(rt Runtime, params *CreateMinerParams) *CreateMinerReturn
- func (a Actor) CurrentTotalPower(rt Runtime, _ *abi.EmptyValue) *CurrentTotalPowerReturn
- func (a Actor) EnrollCronEvent(rt Runtime, params *EnrollCronEventParams) *abi.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) IsSingleton() bool
- func (a Actor) OnEpochTickEnd(rt Runtime, _ *abi.EmptyValue) *abi.EmptyValue
- func (a Actor) State() cbor.Er
- func (a Actor) SubmitPoRepForBulkVerify(rt Runtime, sealInfo *proof.SealVerifyInfo) *abi.EmptyValue
- func (a Actor) UpdateClaimedPower(rt Runtime, params *UpdateClaimedPowerParams) *abi.EmptyValue
- func (a Actor) UpdatePledgeTotal(rt Runtime, pledgeDelta *abi.TokenAmount) *abi.EmptyValue
- type Claim
- type ClaimsByAddress
- type CreateMinerParams
- type CreateMinerReturn
- type CronEvent
- type CronEventsByAddress
- type CurrentTotalPowerReturn
- type EnrollCronEventParams
- type MinerConstructorParams
- type MinerCronEvent
- type ProofsByAddress
- type Runtime
- type SectorTermination
- type State
- func (st *State) AddToClaim(s adt.Store, miner addr.Address, power abi.StoragePower, ...) error
- func (st *State) GetClaim(s adt.Store, a addr.Address) (*Claim, bool, error)
- func (t *State) MarshalCBOR(w io.Writer) error
- func (st *State) MinerNominalPowerMeetsConsensusMinimum(s adt.Store, miner addr.Address) (bool, error)
- func (t *State) UnmarshalCBOR(r io.Reader) error
- type StateSummary
- type UpdateClaimedPowerParams
Constants ¶
const ConsensusMinerMinMiners = 4 // PARAM_SPEC
The number of miners that must meet the consensus minimum miner power before that minimum power is enforced as a condition of leader election. This ensures a network still functions before any miners reach that threshold.
const CronQueueAmtBitwidth = 6
Bitwidth of CronEventQueue AMT determined empirically from mutation patterns and projections of mainnet data.
const CronQueueHamtBitwidth = 6
Bitwidth of CronEventQueue HAMT determined empirically from mutation patterns and projections of mainnet data.
const (
ErrTooManyProveCommits = exitcode.FirstActorSpecificExitCode + iota
)
const GasOnSubmitVerifySeal = 34721049
GasOnSubmitVerifySeal is amount of gas charged for SubmitPoRepForBulkVerify This number is empirically determined
const MaxMinerProveCommitsPerEpoch = 200 // PARAM_SPEC
Maximum number of prove-commits each miner can submit in one epoch.
This limits the number of proof partitions we may need to load in the cron call path. Onboarding 1EiB/year requires at least 32 prove-commits per epoch.
const ProofValidationBatchAmtBitwidth = 4
Bitwidth of ProofValidationBatch AMT determined empirically from mutation pattersn and projections of mainnet data.
Variables ¶
genesis power in bytes = 750,000 GiB
max chain throughput in bytes per epoch = 120 ProveCommits / epoch = 3,840 GiB
Functions ¶
func CurrentTotalPower ¶
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) 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 ¶
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) IsSingleton ¶
func (Actor) OnEpochTickEnd ¶
func (a Actor) OnEpochTickEnd(rt Runtime, _ *abi.EmptyValue) *abi.EmptyValue
Called by Cron.
func (Actor) SubmitPoRepForBulkVerify ¶
func (a Actor) SubmitPoRepForBulkVerify(rt Runtime, sealInfo *proof.SealVerifyInfo) *abi.EmptyValue
func (Actor) UpdateClaimedPower ¶
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 { // Miner's proof type used to determine minimum miner size WindowPoStProofType abi.RegisteredPoStProof // 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 }
type ClaimsByAddress ¶
type ClaimsByAddress map[address.Address]Claim
func CheckClaimInvariants ¶
func CheckClaimInvariants(st *State, store adt.Store, acc *builtin.MessageAccumulator) ClaimsByAddress
type CreateMinerParams ¶
type CreateMinerParams struct { Owner addr.Address Worker addr.Address WindowPoStProofType abi.RegisteredPoStProof Peer abi.PeerID Multiaddrs []abi.Multiaddrs }
Changed since v2: - Seal proof type replaced with PoSt proof types
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 = power0.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. }
type CronEventsByAddress ¶
type CronEventsByAddress map[address.Address][]MinerCronEvent
func CheckCronInvariants ¶
func CheckCronInvariants(st *State, store adt.Store, acc *builtin.MessageAccumulator) CronEventsByAddress
type CurrentTotalPowerReturn ¶
type CurrentTotalPowerReturn struct { RawBytePower abi.StoragePower QualityAdjPower abi.StoragePower PledgeCollateral abi.TokenAmount QualityAdjPowerSmoothed smoothing.FilterEstimate }
Changed since v0: - QualityAdjPowerSmoothed is not a pointer
func (*CurrentTotalPowerReturn) MarshalCBOR ¶
func (t *CurrentTotalPowerReturn) MarshalCBOR(w io.Writer) error
func (*CurrentTotalPowerReturn) UnmarshalCBOR ¶
func (t *CurrentTotalPowerReturn) UnmarshalCBOR(r io.Reader) error
type EnrollCronEventParams ¶
type EnrollCronEventParams = power0.EnrollCronEventParams
type EnrollCronEventParams struct { EventEpoch abi.ChainEpoch Payload []byte }
type MinerConstructorParams ¶
type MinerConstructorParams struct { OwnerAddr addr.Address WorkerAddr addr.Address ControlAddrs []addr.Address WindowPoStProofType abi.RegisteredPoStProof 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. Changed since v2: - Seal proof type replaced with PoSt proof type
func (*MinerConstructorParams) MarshalCBOR ¶
func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error
func (*MinerConstructorParams) UnmarshalCBOR ¶
func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) error
type MinerCronEvent ¶
type MinerCronEvent struct { Epoch abi.ChainEpoch Payload []byte }
type ProofsByAddress ¶
type ProofsByAddress map[address.Address][]proof.SealVerifyInfo
func CheckProofValidationInvariants ¶
func CheckProofValidationInvariants(st *State, store adt.Store, claims ClaimsByAddress, acc *builtin.MessageAccumulator) ProofsByAddress
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 // Claimed power for each miner. Claims cid.Cid // Map, HAMT[address]Claim ProofValidationBatch *cid.Cid // Multimap, (HAMT[Address]AMT[SealVerifyInfo]) }
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) MinerNominalPowerMeetsConsensusMinimum ¶
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.
type StateSummary ¶
type StateSummary struct { Crons CronEventsByAddress Claims ClaimsByAddress Proofs ProofsByAddress }
func CheckStateInvariants ¶
func CheckStateInvariants(st *State, store adt.Store) (*StateSummary, *builtin.MessageAccumulator)
Checks internal invariants of power state.
type UpdateClaimedPowerParams ¶
type UpdateClaimedPowerParams = power0.UpdateClaimedPowerParams
type UpdateClaimedPowerParams struct { RawByteDelta abi.StoragePower QualityAdjustedDelta abi.StoragePower }