Documentation ¶
Index ¶
- Constants
- Variables
- func EpochKey(e abi.ChainEpoch) uint64
- func ExpectedDayRewardForPower(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, ...) abi.TokenAmount
- func FindSector(store adt.Store, deadlines *Deadlines, sectorNum abi.SectorNumber) (uint64, uint64, error)
- func InitialPledgeForPower(qaPower abi.StoragePower, baselinePower abi.StoragePower, ...) abi.TokenAmount
- func PledgePenaltyForDeclaredFault(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, ...) abi.TokenAmount
- func PledgePenaltyForTermination(dayRewardAtActivation abi.TokenAmount, sectorAge abi.ChainEpoch, ...) abi.TokenAmount
- func PledgePenaltyForUndeclaredFault(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, ...) abi.TokenAmount
- func PreCommitDepositForPower(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, ...) abi.TokenAmount
- func QAPowerForSector(size abi.SectorSize, sector *SectorOnChainInfo) abi.StoragePower
- func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, ...) abi.StoragePower
- func QualityForWeight(size abi.SectorSize, duration abi.ChainEpoch, ...) abi.SectorQuality
- func RewardForConsensusSlashReport(elapsedEpoch abi.ChainEpoch, collateral abi.TokenAmount) abi.TokenAmount
- func SectorKey(e abi.SectorNumber) adt.Keyer
- type Actor
- func (a Actor) AddLockedFund(rt Runtime, amountToLock *abi.TokenAmount) *adt.EmptyValue
- func (a Actor) ChangeMultiaddrs(rt Runtime, params *ChangeMultiaddrsParams) *adt.EmptyValue
- func (a Actor) ChangePeerID(rt Runtime, params *ChangePeerIDParams) *adt.EmptyValue
- func (a Actor) ChangeWorkerAddress(rt Runtime, params *ChangeWorkerAddressParams) *adt.EmptyValue
- func (a Actor) CheckSectorProven(rt Runtime, params *CheckSectorProvenParams) *adt.EmptyValue
- func (a Actor) CompactPartitions(rt Runtime, params *CompactPartitionsParams) *adt.EmptyValue
- func (a Actor) ConfirmSectorProofsValid(rt Runtime, params *builtin.ConfirmSectorProofsParams) *adt.EmptyValue
- func (a Actor) Constructor(rt Runtime, params *ConstructorParams) *adt.EmptyValue
- func (a Actor) ControlAddresses(rt Runtime, _ *adt.EmptyValue) *GetControlAddressesReturn
- func (a Actor) DeclareFaults(rt Runtime, params *DeclareFaultsParams) *adt.EmptyValue
- func (a Actor) DeclareFaultsRecovered(rt Runtime, params *DeclareFaultsRecoveredParams) *adt.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) ExtendSectorExpiration(rt Runtime, params *ExtendSectorExpirationParams) *adt.EmptyValue
- func (a Actor) OnDeferredCronEvent(rt Runtime, payload *CronEventPayload) *adt.EmptyValue
- func (a Actor) PreCommitSector(rt Runtime, params *SectorPreCommitInfo) *adt.EmptyValue
- func (a Actor) ProveCommitSector(rt Runtime, params *ProveCommitSectorParams) *adt.EmptyValue
- func (a Actor) ReportConsensusFault(rt Runtime, params *ReportConsensusFaultParams) *adt.EmptyValue
- func (a Actor) SubmitWindowedPoSt(rt Runtime, params *SubmitWindowedPoStParams) *adt.EmptyValue
- func (a Actor) TerminateSectors(rt Runtime, params *TerminateSectorsParams) *TerminateSectorsReturn
- func (a Actor) WithdrawBalance(rt Runtime, params *WithdrawBalanceParams) *adt.EmptyValue
- type BigFrac
- type BitfieldQueue
- func (q BitfieldQueue) AddManyToQueueValues(values map[abi.ChainEpoch][]uint64) error
- func (q BitfieldQueue) AddToQueue(rawEpoch abi.ChainEpoch, values *abi.BitField) error
- func (q BitfieldQueue) AddToQueueValues(epoch abi.ChainEpoch, values ...uint64) error
- func (q BitfieldQueue) Cut(toCut *bitfield.BitField) error
- func (q BitfieldQueue) ForEach(cb func(epoch abi.ChainEpoch, bf *bitfield.BitField) error) error
- func (q BitfieldQueue) PopUntil(until abi.ChainEpoch) (values *abi.BitField, modified bool, err error)
- type ChangeMultiaddrsParams
- type ChangePeerIDParams
- type ChangeWorkerAddressParams
- type CheckSectorProvenParams
- type CompactPartitionsParams
- type ConstructorParams
- type CronEventPayload
- type CronEventType
- type Deadline
- func (d *Deadline) AddExpirationPartitions(store adt.Store, expirationEpoch abi.ChainEpoch, partitions []uint64, ...) error
- func (dl *Deadline) AddPoStSubmissions(idxs []uint64)
- func (dl *Deadline) AddSectors(store adt.Store, partitionSize uint64, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (d *Deadline) LoadPartition(store adt.Store, partIdx uint64) (*Partition, error)
- func (t *Deadline) MarshalCBOR(w io.Writer) error
- func (d *Deadline) PartitionsArray(store adt.Store) (*adt.Array, error)
- func (dl *Deadline) PopEarlyTerminations(store adt.Store, maxPartitions, maxSectors uint64) (result TerminationResult, hasMore bool, err error)
- func (dl *Deadline) PopExpiredSectors(store adt.Store, until abi.ChainEpoch, quant QuantSpec) (*ExpirationSet, error)
- func (dl *Deadline) RemovePartitions(store adt.Store, toRemove *bitfield.BitField, quant QuantSpec) (live, dead *abi.BitField, removedPower PowerPair, err error)
- func (dl *Deadline) TerminateSectors(store adt.Store, epoch abi.ChainEpoch, ...) (removedPower PowerPair, err error)
- func (t *Deadline) UnmarshalCBOR(r io.Reader) error
- type DeadlineInfo
- func (d *DeadlineInfo) FaultCutoffPassed() bool
- func (d *DeadlineInfo) HasElapsed() bool
- func (d *DeadlineInfo) IsOpen() bool
- func (d *DeadlineInfo) Last() abi.ChainEpoch
- func (d *DeadlineInfo) NextNotElapsed() *DeadlineInfo
- func (d *DeadlineInfo) NextOpen() abi.ChainEpoch
- func (d *DeadlineInfo) NextPeriodStart() abi.ChainEpoch
- func (d *DeadlineInfo) PeriodElapsed() bool
- func (d *DeadlineInfo) PeriodEnd() abi.ChainEpoch
- func (d *DeadlineInfo) PeriodStarted() bool
- type Deadlines
- func (d *Deadlines) ForEach(store adt.Store, cb func(dlIdx uint64, dl *Deadline) error) error
- func (d *Deadlines) LoadDeadline(store adt.Store, dlIdx uint64) (*Deadline, error)
- func (t *Deadlines) MarshalCBOR(w io.Writer) error
- func (t *Deadlines) UnmarshalCBOR(r io.Reader) error
- func (d *Deadlines) UpdateDeadline(store adt.Store, dlIdx uint64, deadline *Deadline) error
- type DeclareFaultsParams
- type DeclareFaultsRecoveredParams
- type ExpirationExtension
- type ExpirationQueue
- func (q ExpirationQueue) AddActiveSectors(sectors []*SectorOnChainInfo, ssize abi.SectorSize) (*abi.BitField, PowerPair, abi.TokenAmount, error)
- func (q ExpirationQueue) PopUntil(until abi.ChainEpoch) (*ExpirationSet, error)
- func (q ExpirationQueue) RemoveSectors(sectors []*SectorOnChainInfo, faults *abi.BitField, recovering *abi.BitField, ...) (*ExpirationSet, PowerPair, error)
- func (q ExpirationQueue) ReplaceSectors(oldSectors, newSectors []*SectorOnChainInfo, ssize abi.SectorSize) (*abi.BitField, *abi.BitField, PowerPair, abi.TokenAmount, error)
- func (q ExpirationQueue) RescheduleAllAsFaults(faultExpiration abi.ChainEpoch) error
- func (q ExpirationQueue) RescheduleAsFaults(newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (q ExpirationQueue) RescheduleExpirations(newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ...) error
- func (q ExpirationQueue) RescheduleRecovered(sectors []*SectorOnChainInfo, ssize abi.SectorSize) (PowerPair, error)
- type ExpirationSet
- func (es *ExpirationSet) Add(onTimeSectors, earlySectors *abi.BitField, onTimePledge abi.TokenAmount, ...) error
- func (es *ExpirationSet) IsEmpty() (empty bool, err error)
- func (t *ExpirationSet) MarshalCBOR(w io.Writer) error
- func (es *ExpirationSet) Remove(onTimeSectors, earlySectors *abi.BitField, onTimePledge abi.TokenAmount, ...) error
- func (t *ExpirationSet) UnmarshalCBOR(r io.Reader) error
- type ExtendSectorExpirationParams
- type FaultDeclaration
- type GetControlAddressesReturn
- type MinerInfo
- type Partition
- func (p *Partition) ActivePower() PowerPair
- func (p *Partition) ActiveSectors() (*abi.BitField, error)
- func (p *Partition) AddFaults(store adt.Store, sectorNos *abi.BitField, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (p *Partition) AddRecoveries(sectorNos *abi.BitField, power PowerPair) (err error)
- func (p *Partition) AddSectors(store adt.Store, sectors []*SectorOnChainInfo, ssize abi.SectorSize, ...) (PowerPair, error)
- func (p *Partition) LiveSectors() (*abi.BitField, error)
- func (t *Partition) MarshalCBOR(w io.Writer) error
- func (p *Partition) PopEarlyTerminations(store adt.Store, maxSectors uint64) (result TerminationResult, hasMore bool, err error)
- func (p *Partition) PopExpiredSectors(store adt.Store, until abi.ChainEpoch, quant QuantSpec) (*ExpirationSet, error)
- func (p *Partition) RecordMissedPost(store adt.Store, faultExpiration abi.ChainEpoch, quant QuantSpec) (newFaultPower, failedRecoveryPower PowerPair, err error)
- func (p *Partition) RecoverFaults(store adt.Store, recovered *abi.BitField, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (p *Partition) RemoveRecoveries(sectorNos *abi.BitField, power PowerPair) (err error)
- func (p *Partition) ReplaceSectors(store adt.Store, oldSectors, newSectors []*SectorOnChainInfo, ...) (PowerPair, abi.TokenAmount, error)
- func (p *Partition) RescheduleExpirations(store adt.Store, newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ...) error
- func (p *Partition) TerminateSectors(store adt.Store, epoch abi.ChainEpoch, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (t *Partition) UnmarshalCBOR(r io.Reader) error
- type PartitionKey
- type PoStPartition
- type PowerPair
- func (pp PowerPair) Add(other PowerPair) PowerPair
- func (pp *PowerPair) Equals(other PowerPair) bool
- func (pp PowerPair) IsZero() bool
- func (t *PowerPair) MarshalCBOR(w io.Writer) error
- func (pp PowerPair) Neg() PowerPair
- func (pp PowerPair) Sub(other PowerPair) PowerPair
- func (t *PowerPair) UnmarshalCBOR(r io.Reader) error
- type ProveCommitSectorParams
- type QuantSpec
- type RecoveryDeclaration
- type ReportConsensusFaultParams
- type Runtime
- type SealVerifyStuff
- type SectorLocation
- type SectorOnChainInfo
- type SectorPreCommitInfo
- type SectorPreCommitOnChainInfo
- type SectorStatus
- type Sectors
- func (sa Sectors) Get(sectorNumber abi.SectorNumber) (info *SectorOnChainInfo, found bool, err error)
- func (sa Sectors) Load(sectorNos *abi.BitField) ([]*SectorOnChainInfo, error)
- func (sa Sectors) MustGet(sectorNumber abi.SectorNumber) (info *SectorOnChainInfo, err error)
- func (sa Sectors) Store(infos ...*SectorOnChainInfo) error
- type State
- func (st *State) AddInitialPledgeRequirement(amount abi.TokenAmount)
- func (st *State) AddLockedFunds(store adt.Store, currEpoch abi.ChainEpoch, vestingSum abi.TokenAmount, ...) error
- func (st *State) AddPreCommitDeposit(amount abi.TokenAmount)
- func (st *State) AssertBalanceInvariants(balance abi.TokenAmount)
- func (st *State) AssignSectorsToDeadlines(store adt.Store, currentEpoch abi.ChainEpoch, sectors []*SectorOnChainInfo, ...) (PowerPair, error)
- func (st *State) CheckVestedFunds(store adt.Store, currEpoch abi.ChainEpoch) (abi.TokenAmount, error)
- func (st *State) DeadlineInfo(currEpoch abi.ChainEpoch) *DeadlineInfo
- func (st *State) DeletePrecommittedSectors(store adt.Store, sectorNos ...abi.SectorNumber) error
- func (st *State) DeleteSectors(store adt.Store, sectorNos *abi.BitField) error
- func (st *State) FindPrecommittedSectors(store adt.Store, sectorNos ...abi.SectorNumber) ([]*SectorPreCommitOnChainInfo, error)
- func (st *State) FindSector(store adt.Store, sno abi.SectorNumber) (uint64, uint64, error)
- func (st *State) ForEachSector(store adt.Store, f func(*SectorOnChainInfo)) error
- func (st *State) GetAvailableBalance(actorBalance abi.TokenAmount) abi.TokenAmount
- func (st *State) GetInfo(store adt.Store) (*MinerInfo, error)
- func (st *State) GetMaxAllowedFaults(store adt.Store) (uint64, error)
- func (st *State) GetPrecommittedSector(store adt.Store, sectorNo abi.SectorNumber) (*SectorPreCommitOnChainInfo, bool, error)
- func (st *State) GetSector(store adt.Store, sectorNo abi.SectorNumber) (*SectorOnChainInfo, bool, error)
- func (st *State) GetSectorCount(store adt.Store) (uint64, error)
- func (st *State) GetUnlockedBalance(actorBalance abi.TokenAmount) abi.TokenAmount
- func (st *State) HasSectorNo(store adt.Store, sectorNo abi.SectorNumber) (bool, error)
- func (st *State) LoadDeadlines(store adt.Store) (*Deadlines, error)
- func (st *State) LoadSectorInfos(store adt.Store, sectors *abi.BitField) ([]*SectorOnChainInfo, error)
- func (st *State) LoadSectorInfosForProof(store adt.Store, provenSectors, expectedFaults *abi.BitField) ([]*SectorOnChainInfo, error)
- func (st *State) LoadSectorInfosWithFaultMask(store adt.Store, sectors *abi.BitField, faults *abi.BitField, ...) ([]*SectorOnChainInfo, error)
- func (t *State) MarshalCBOR(w io.Writer) error
- func (st *State) MeetsInitialPledgeCondition(balance abi.TokenAmount) bool
- func (st *State) PenalizeFundsInPriorityOrder(store adt.Store, currEpoch abi.ChainEpoch, ...) (fromVesting abi.TokenAmount, fromBalance abi.TokenAmount, err error)
- func (st *State) PopEarlyTerminations(store adt.Store, maxPartitions, maxSectors uint64) (result TerminationResult, hasMore bool, err error)
- func (st *State) PutPrecommittedSector(store adt.Store, info *SectorPreCommitOnChainInfo) error
- func (st *State) PutSectors(store adt.Store, newSectors ...*SectorOnChainInfo) error
- func (st *State) QuantEndOfDeadline() QuantSpec
- func (st *State) RescheduleSectorExpirations(store adt.Store, currEpoch abi.ChainEpoch, sectors []SectorLocation, ...) error
- func (st *State) SaveDeadlines(store adt.Store, deadlines *Deadlines) error
- func (st *State) SaveInfo(store adt.Store, info *MinerInfo) error
- func (st *State) SectorStatus(store adt.Store, dlIdx, pIdx uint64, sector abi.SectorNumber) (SectorStatus, error)
- func (st *State) UnlockUnvestedFunds(store adt.Store, currEpoch abi.ChainEpoch, target abi.TokenAmount) (abi.TokenAmount, error)
- func (st *State) UnlockVestedFunds(store adt.Store, currEpoch abi.ChainEpoch) (abi.TokenAmount, error)
- func (t *State) UnmarshalCBOR(r io.Reader) error
- func (st *State) WalkSectors(store adt.Store, locations []SectorLocation, ...) error
- type SubmitWindowedPoStParams
- type TerminateSectorsParams
- type TerminateSectorsReturn
- type TerminationDeclaration
- type TerminationResult
- type VestSpec
- type WithdrawBalanceParams
- type WorkerKeyChange
Constants ¶
const AddressedPartitionsMax = 200
The maximum number of partitions that may be required to be loaded in a single invocation. This limits the number of simultaneous fault, recovery, or sector-extension declarations. With 48 deadlines (half-hour), 200 partitions per declaration permits loading a full EiB of 32GiB sectors with 1 message per epoch within a single half-hour deadline. A miner can of course submit more messages.
const AddressedSectorsMax = 10_000
The maximum number of sector infos that may be required to be loaded in a single invocation.
const ChainFinality = abi.ChainEpoch(900)
Epochs after which chain state is final.
const DealLimitDenominator = 134217728
Ratio of sector size to maximum deals per sector. The maximum number of deals is the sector size divided by this number (2^27) which limits 32GiB sectors to 256 deals and 64GiB sectors to 512
const ElectionLookback = abi.ChainEpoch(1) // PARAM_FINISH
Lookback from the current epoch for state view for leader elections.
const FaultDeclarationCutoff = WPoStChallengeLookback + 50
Minimum period before a deadline's challenge window opens that a fault must be declared for that deadline. This lookback must not be less than WPoStChallengeLookback lest a malicious miner be able to selectively declare faults after learning the challenge value.
const MaxSectorExpirationExtension = 366 * builtin.EpochsInDay
Maximum number of epochs past the current epoch a sector may be set to expire. The actual maximum extension will be the minimum of CurrEpoch + MaximumSectorExpirationExtension and sector.ActivationEpoch+sealProof.SectorMaximumLifetime()
const MinSectorExpiration = 180 * builtin.EpochsInDay
Minimum number of epochs past the current epoch a sector may be set to expire.
const NewSectorsPerPeriodMax = 128 << 10
The maximum number of new sectors that may be staged by a miner during a single proving period.
const SectorQualityPrecision = 20
const SectorsMax = 32 << 20 // PARAM_FINISH
The maximum number of sectors that a miner can have simultaneously active. This also bounds the number of faults that can be declared, etc. TODO raise this number, carefully https://github.com/filecoin-project/specs-actors/issues/470
const TerminationLifetimeCap = abi.ChainEpoch(70)
Maximum number of days of BR a terminated sector can be penalized
const WPoStChallengeLookback = abi.ChainEpoch(20)
Lookback from the deadline's challenge window opening from which to sample chain randomness for the challenge seed. This lookback exists so that deadline windows can be non-overlapping (which make the programming simpler) but without making the miner wait for chain stability before being able to start on PoSt computation. The challenge is available this many epochs before the window is actually open to receiving a PoSt.
const WPoStPeriodDeadlines = uint64(48)
The number of non-overlapping PoSt deadlines in each proving period.
const WorkerKeyChangeDelay = ChainFinality
Staging period for a miner worker key change. Finality is a harsh delay for a miner who has lost their worker key, as the miner will miss Window PoSts until it can be changed. It's the only safe value, though. We may implement a mitigation mechanism such as a second key or allowing the owner account to submit PoSts while a key change is pending.
Variables ¶
var DealWeightMultiplier = big.NewInt(10)
var DeclaredFaultFactorDenom = big.NewInt(100)
var DeclaredFaultFactorNum = big.NewInt(214)
FF = (DeclaredFaultFactorNum / DeclaredFaultFactorDenom) * BR(t)
var FaultMaxAge = WPoStProvingPeriod * 14
The maximum age of a fault before the sector is terminated.
var InitialPledgeFactor = big.NewInt(20)
var LockTargetFactorDenom = big.NewInt(10)
var LockTargetFactorNum = big.NewInt(3)
var MaxSealDuration = map[abi.RegisteredSealProof]abi.ChainEpoch{ abi.RegisteredSealProof_StackedDrg32GiBV1: abi.ChainEpoch(10000), abi.RegisteredSealProof_StackedDrg2KiBV1: abi.ChainEpoch(10000), abi.RegisteredSealProof_StackedDrg8MiBV1: abi.ChainEpoch(10000), abi.RegisteredSealProof_StackedDrg512MiBV1: abi.ChainEpoch(10000), abi.RegisteredSealProof_StackedDrg64GiBV1: abi.ChainEpoch(10000), }
Maximum duration to allow for the sealing process for seal algorithms. Dependent on algorithm and sector size
var NoQuantization = NewQuantSpec(1, 0)
var PledgeVestingSpec = VestSpec{ InitialDelay: abi.ChainEpoch(180 * builtin.EpochsInDay), VestPeriod: abi.ChainEpoch(180 * builtin.EpochsInDay), StepDuration: abi.ChainEpoch(1 * builtin.EpochsInDay), Quantization: 12 * builtin.EpochsInHour, }
var PreCommitChallengeDelay = abi.ChainEpoch(150)
Number of epochs between publishing the precommit and when the challenge for interactive PoRep is drawn used to ensure it is not predictable by miner.
var PreCommitDepositFactor = big.NewInt(20)
IP = IPBase(precommit time) + AdditionalIP(precommit time) IPBase(t) = InitialPledgeFactor * BR(t) AdditionalIP(t) = LockTarget(t)*PledgeShare(t) LockTarget = (LockTargetFactorNum / LockTargetFactorDenom) * FILCirculatingSupply(t) PledgeShare(t) = sectorQAPower / max(BaselinePower(t), NetworkQAPower(t)) PARAM_FINISH
var QualityBaseMultiplier = big.NewInt(10)
var RewardVestingSpec = VestSpec{ InitialDelay: abi.ChainEpoch(20 * builtin.EpochsInDay), VestPeriod: abi.ChainEpoch(180 * builtin.EpochsInDay), StepDuration: abi.ChainEpoch(1 * builtin.EpochsInDay), Quantization: 12 * builtin.EpochsInHour, }
var SealedCIDPrefix = cid.Prefix{ Version: 1, Codec: cid.FilCommitmentSealed, MhType: mh.POSEIDON_BLS12_381_A1_FC1, MhLength: 32, }
var SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{ abi.RegisteredSealProof_StackedDrg32GiBV1: {}, abi.RegisteredSealProof_StackedDrg64GiBV1: {}, }
List of proof types which can be used when creating new miner actors
var UndeclaredFaultFactorDenom = big.NewInt(1)
var UndeclaredFaultFactorNum = big.NewInt(5)
SP = (UndeclaredFaultFactor / DeclaredFaultFactorDenom) * BR(t)
var VerifiedDealWeightMultiplier = big.NewInt(100)
var WPoStChallengeWindow = abi.ChainEpoch(30 * 60 / builtin.EpochDurationSeconds) // 30 minutes (48 per day)
The duration of a deadline's challenge window, the period before a deadline when the challenge is available.
var WPoStProvingPeriod = abi.ChainEpoch(builtin.EpochsInDay) // 24 hours
The period over which all a miner's active sectors will be challenged.
Functions ¶
func EpochKey ¶
func EpochKey(e abi.ChainEpoch) uint64
func ExpectedDayRewardForPower ¶ added in v0.7.0
func ExpectedDayRewardForPower(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, qaSectorPower abi.StoragePower) abi.TokenAmount
This is the BR(t) value of the given sector for the current epoch. It is the expected reward this sector would pay out over a one day period. BR(t) = CurrEpochReward(t) * SectorQualityAdjustedPower * EpochsInDay / TotalNetworkQualityAdjustedPower(t)
func FindSector ¶ added in v0.8.0
func FindSector(store adt.Store, deadlines *Deadlines, sectorNum abi.SectorNumber) (uint64, uint64, error)
FindSector returns the deadline and partition index for a sector number. It returns an error if the sector number is not tracked by deadlines.
func InitialPledgeForPower ¶ added in v0.7.0
func InitialPledgeForPower(qaPower abi.StoragePower, baselinePower abi.StoragePower, networkTotalPledge abi.TokenAmount, rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, networkCirculatingSupplySmoothed abi.TokenAmount) abi.TokenAmount
Computes the pledge requirement for committing new quality-adjusted power to the network, given the current total power, total pledge commitment, epoch block reward, and circulating token supply. In plain language, the pledge requirement is a multiple of the block reward expected to be earned by the newly-committed power, holding the per-epoch block reward constant (though in reality it will change over time).
func PledgePenaltyForDeclaredFault ¶ added in v0.7.0
func PledgePenaltyForDeclaredFault(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, qaSectorPower abi.StoragePower) abi.TokenAmount
This is the FF(t) penalty for a sector expected to be in the fault state either because the fault was declared or because it has been previously detected by the network. FF(t) = DeclaredFaultFactor * BR(t)
func PledgePenaltyForTermination ¶ added in v0.7.2
func PledgePenaltyForTermination(dayRewardAtActivation abi.TokenAmount, sectorAge abi.ChainEpoch, rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, qaSectorPower abi.StoragePower) abi.TokenAmount
Penalty to locked pledge collateral for the termination of a sector before scheduled expiry. SectorAge is the time between the sector's activation and termination.
func PledgePenaltyForUndeclaredFault ¶ added in v0.7.0
func PledgePenaltyForUndeclaredFault(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, qaSectorPower abi.StoragePower) abi.TokenAmount
This is the SP(t) penalty for a newly faulty sector that has not been declared. SP(t) = UndeclaredFaultFactor * BR(t)
func PreCommitDepositForPower ¶ added in v0.8.1
func PreCommitDepositForPower(rewardEstimate, networkQAPowerEstimate *smoothing.FilterEstimate, qaSectorPower abi.StoragePower) abi.TokenAmount
Computes the PreCommit Deposit given sector qa weight and current network conditions. PreCommit Deposit = 20 * BR(t)
func QAPowerForSector ¶ added in v0.7.0
func QAPowerForSector(size abi.SectorSize, sector *SectorOnChainInfo) abi.StoragePower
Returns the quality-adjusted power for a sector.
func QAPowerForWeight ¶ added in v0.7.0
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower
Returns the power for a sector size and weight.
func QualityForWeight ¶ added in v0.7.0
func QualityForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.SectorQuality
DealWeight and VerifiedDealWeight are spacetime occupied by regular deals and verified deals in a sector. Sum of DealWeight and VerifiedDealWeight should be less than or equal to total SpaceTime of a sector. Sectors full of VerifiedDeals will have a SectorQuality of VerifiedDealWeightMultiplier/QualityBaseMultiplier. Sectors full of Deals will have a SectorQuality of DealWeightMultiplier/QualityBaseMultiplier. Sectors with neither will have a SectorQuality of QualityBaseMultiplier/QualityBaseMultiplier. SectorQuality of a sector is a weighted average of multipliers based on their propotions.
func RewardForConsensusSlashReport ¶ added in v0.7.0
func RewardForConsensusSlashReport(elapsedEpoch abi.ChainEpoch, collateral abi.TokenAmount) abi.TokenAmount
Types ¶
type Actor ¶
type Actor struct{}
func (Actor) AddLockedFund ¶
func (a Actor) AddLockedFund(rt Runtime, amountToLock *abi.TokenAmount) *adt.EmptyValue
Locks up some amount of the miner's unlocked balance (including funds received alongside the invoking message).
func (Actor) ChangeMultiaddrs ¶ added in v0.5.5
func (a Actor) ChangeMultiaddrs(rt Runtime, params *ChangeMultiaddrsParams) *adt.EmptyValue
func (Actor) ChangePeerID ¶
func (a Actor) ChangePeerID(rt Runtime, params *ChangePeerIDParams) *adt.EmptyValue
func (Actor) ChangeWorkerAddress ¶
func (a Actor) ChangeWorkerAddress(rt Runtime, params *ChangeWorkerAddressParams) *adt.EmptyValue
func (Actor) CheckSectorProven ¶
func (a Actor) CheckSectorProven(rt Runtime, params *CheckSectorProvenParams) *adt.EmptyValue
func (Actor) CompactPartitions ¶ added in v0.8.0
func (a Actor) CompactPartitions(rt Runtime, params *CompactPartitionsParams) *adt.EmptyValue
Compacts a number of partitions at one deadline by removing terminated sectors, re-ordering the remaining sectors, and assigning them to new partitions so as to completely fill all but one partition with live sectors. The addressed partitions are removed from the deadline, and new ones appended. The final partition in the deadline is always included in the compaction, whether or not explicitly requested. Removed sectors are removed from state entirely. May not be invoked if the deadline has any un-processed early terminations.
func (Actor) ConfirmSectorProofsValid ¶ added in v0.5.4
func (a Actor) ConfirmSectorProofsValid(rt Runtime, params *builtin.ConfirmSectorProofsParams) *adt.EmptyValue
func (Actor) Constructor ¶
func (a Actor) Constructor(rt Runtime, params *ConstructorParams) *adt.EmptyValue
func (Actor) ControlAddresses ¶
func (a Actor) ControlAddresses(rt Runtime, _ *adt.EmptyValue) *GetControlAddressesReturn
func (Actor) DeclareFaults ¶
func (a Actor) DeclareFaults(rt Runtime, params *DeclareFaultsParams) *adt.EmptyValue
func (Actor) DeclareFaultsRecovered ¶
func (a Actor) DeclareFaultsRecovered(rt Runtime, params *DeclareFaultsRecoveredParams) *adt.EmptyValue
func (Actor) ExtendSectorExpiration ¶
func (a Actor) ExtendSectorExpiration(rt Runtime, params *ExtendSectorExpirationParams) *adt.EmptyValue
Changes the expiration epoch for a sector to a new, later one. The sector must not be terminated or faulty. The sector's power is recomputed for the new expiration.
func (Actor) OnDeferredCronEvent ¶
func (a Actor) OnDeferredCronEvent(rt Runtime, payload *CronEventPayload) *adt.EmptyValue
func (Actor) PreCommitSector ¶
func (a Actor) PreCommitSector(rt Runtime, params *SectorPreCommitInfo) *adt.EmptyValue
Proposals must be posted on chain via sma.PublishStorageDeals before PreCommitSector. Optimization: PreCommitSector could contain a list of deals that are not published yet.
func (Actor) ProveCommitSector ¶
func (a Actor) ProveCommitSector(rt Runtime, params *ProveCommitSectorParams) *adt.EmptyValue
Checks state of the corresponding sector pre-commitment, then schedules the proof to be verified in bulk by the power actor. If valid, the power actor will call ConfirmSectorProofsValid at the end of the same epoch as this message.
func (Actor) ReportConsensusFault ¶
func (a Actor) ReportConsensusFault(rt Runtime, params *ReportConsensusFaultParams) *adt.EmptyValue
func (Actor) SubmitWindowedPoSt ¶
func (a Actor) SubmitWindowedPoSt(rt Runtime, params *SubmitWindowedPoStParams) *adt.EmptyValue
Invoked by miner's worker address to submit their fallback post
func (Actor) TerminateSectors ¶
func (a Actor) TerminateSectors(rt Runtime, params *TerminateSectorsParams) *TerminateSectorsReturn
Marks some sectors as terminated at the present epoch, earlier than their scheduled termination, and adds these sectors to the early termination queue. This method then processes up to AddressedSectorsMax sectors and AddressedPartitionsMax partitions from the early termination queue, terminating deals, paying fines, and returning pledge collateral. While sectors remain in this queue:
- The miner will be unable to withdraw funds.
- The chain will process up to AddressedSectorsMax sectors and AddressedPartitionsMax per epoch until the queue is empty.
The sectors are immediately ignored for Window PoSt proofs, and should be masked in the same way as faulty sectors. A miner terminating sectors in the current deadline must be careful to compute an appropriate Window PoSt proof for the sectors that will be active at the time the PoSt is submitted.
This function may be invoked with no new sectors to explicitly process the next batch of sectors.
func (Actor) WithdrawBalance ¶
func (a Actor) WithdrawBalance(rt Runtime, params *WithdrawBalanceParams) *adt.EmptyValue
type BitfieldQueue ¶ added in v0.8.0
Wrapper for working with an AMT[ChainEpoch]*Bitfield functioning as a queue, bucketed by epoch. Keys in the queue are quantized (upwards), modulo some offset, to reduce the cardinality of keys.
func LoadBitfieldQueue ¶ added in v0.8.0
func LoadBitfieldQueue(store adt.Store, root cid.Cid, quant QuantSpec) (BitfieldQueue, error)
func (BitfieldQueue) AddManyToQueueValues ¶ added in v0.8.0
func (q BitfieldQueue) AddManyToQueueValues(values map[abi.ChainEpoch][]uint64) error
func (BitfieldQueue) AddToQueue ¶ added in v0.8.0
func (q BitfieldQueue) AddToQueue(rawEpoch abi.ChainEpoch, values *abi.BitField) error
Adds values to the queue entry for an epoch.
func (BitfieldQueue) AddToQueueValues ¶ added in v0.8.0
func (q BitfieldQueue) AddToQueueValues(epoch abi.ChainEpoch, values ...uint64) error
func (BitfieldQueue) Cut ¶ added in v0.8.1
func (q BitfieldQueue) Cut(toCut *bitfield.BitField) error
Cut cuts the elements from the bits in the given bitfield out of the queue, shifting other bits down and removing any newly empty entries.
See the docs on BitField.Cut to better understand what it does.
func (BitfieldQueue) ForEach ¶ added in v0.8.0
func (q BitfieldQueue) ForEach(cb func(epoch abi.ChainEpoch, bf *bitfield.BitField) error) error
Iterates the queue.
func (BitfieldQueue) PopUntil ¶ added in v0.8.0
func (q BitfieldQueue) PopUntil(until abi.ChainEpoch) (values *abi.BitField, modified bool, err error)
Removes and returns all values with keys less than or equal to until. Modified return value indicates whether this structure has been changed by the call.
type ChangeMultiaddrsParams ¶ added in v0.5.5
type ChangeMultiaddrsParams struct {
NewMultiaddrs []abi.Multiaddrs
}
func (*ChangeMultiaddrsParams) MarshalCBOR ¶ added in v0.5.5
func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error
func (*ChangeMultiaddrsParams) UnmarshalCBOR ¶ added in v0.5.5
func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) error
type ChangePeerIDParams ¶
func (*ChangePeerIDParams) MarshalCBOR ¶
func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error
func (*ChangePeerIDParams) UnmarshalCBOR ¶
func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) error
type ChangeWorkerAddressParams ¶
func (*ChangeWorkerAddressParams) MarshalCBOR ¶
func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error
func (*ChangeWorkerAddressParams) UnmarshalCBOR ¶
func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) error
type CheckSectorProvenParams ¶
type CheckSectorProvenParams struct {
SectorNumber abi.SectorNumber
}
func (*CheckSectorProvenParams) MarshalCBOR ¶
func (t *CheckSectorProvenParams) MarshalCBOR(w io.Writer) error
func (*CheckSectorProvenParams) UnmarshalCBOR ¶
func (t *CheckSectorProvenParams) UnmarshalCBOR(r io.Reader) error
type CompactPartitionsParams ¶ added in v0.8.0
func (*CompactPartitionsParams) MarshalCBOR ¶ added in v0.8.0
func (t *CompactPartitionsParams) MarshalCBOR(w io.Writer) error
func (*CompactPartitionsParams) UnmarshalCBOR ¶ added in v0.8.0
func (t *CompactPartitionsParams) UnmarshalCBOR(r io.Reader) error
type ConstructorParams ¶
type ConstructorParams = power.MinerConstructorParams
Storage miner actors are created exclusively by the storage power actor. In order to break a circular dependency between the two, the construction parameters are defined in the power actor.
type CronEventPayload ¶
type CronEventPayload struct { EventType CronEventType Sectors *abi.BitField }
func (*CronEventPayload) MarshalCBOR ¶
func (t *CronEventPayload) MarshalCBOR(w io.Writer) error
func (*CronEventPayload) UnmarshalCBOR ¶
func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) error
type CronEventType ¶
type CronEventType int64
const ( CronEventWorkerKeyChange CronEventType = iota CronEventPreCommitExpiry CronEventProvingDeadline CronEventProcessEarlyTerminations )
type Deadline ¶ added in v0.8.0
type Deadline struct { // Partitions in this deadline, in order. // The keys of this AMT are always sequential integers beginning with zero. Partitions cid.Cid // AMT[PartitionNumber]Partition // Maps epochs to partitions that _may_ have sectors that expire in or // before that epoch, either on-time or early as faults. // Keys are quantized to final epochs in each proving deadline. // // NOTE: Partitions MUST NOT be removed from this queue (until the // associated epoch has passed) even if they no longer have sectors // expiring at that epoch. Sectors expiring at this epoch may later be // recovered, and this queue will not be updated at that time. ExpirationsEpochs cid.Cid // AMT[ChainEpoch]BitField // Partitions numbers with PoSt submissions since the proving period started. PostSubmissions *abi.BitField // Partitions with sectors that terminated early. EarlyTerminations *abi.BitField // The number of non-terminated sectors in this deadline (incl faulty). LiveSectors uint64 // The total number of sectors in this deadline (incl dead). TotalSectors uint64 }
Deadline holds the state for all sectors due at a specific deadline.
func ConstructDeadline ¶ added in v0.8.0
func ConstructDeadline(emptyArrayCid cid.Cid) *Deadline
func (*Deadline) AddExpirationPartitions ¶ added in v0.8.0
func (d *Deadline) AddExpirationPartitions(store adt.Store, expirationEpoch abi.ChainEpoch, partitions []uint64, quant QuantSpec) error
Adds some partition numbers to the set expiring at an epoch.
func (*Deadline) AddPoStSubmissions ¶ added in v0.8.0
func (*Deadline) AddSectors ¶ added in v0.8.0
func (dl *Deadline) AddSectors(store adt.Store, partitionSize uint64, sectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) (PowerPair, error)
Adds sectors to a deadline. It's the caller's responsibility to make sure that this deadline isn't currently "open" (i.e., being proved at this point in time).
func (*Deadline) LoadPartition ¶ added in v0.8.0
func (*Deadline) PartitionsArray ¶ added in v0.8.0
func (*Deadline) PopEarlyTerminations ¶ added in v0.8.0
func (*Deadline) PopExpiredSectors ¶ added in v0.8.0
func (dl *Deadline) PopExpiredSectors(store adt.Store, until abi.ChainEpoch, quant QuantSpec) (*ExpirationSet, error)
PopExpiredSectors terminates expired sectors from all partitions. Returns the expired sector aggregates.
func (*Deadline) RemovePartitions ¶ added in v0.8.1
func (dl *Deadline) RemovePartitions(store adt.Store, toRemove *bitfield.BitField, quant QuantSpec) ( live, dead *abi.BitField, removedPower PowerPair, err error, )
RemovePartitions removes the specified partitions, shifting the remaining ones to the left, and returning the live and dead sectors they contained.
Returns an error if any of the partitions contained faulty sectors or early terminations.
func (*Deadline) TerminateSectors ¶ added in v0.8.1
func (dl *Deadline) TerminateSectors( store adt.Store, epoch abi.ChainEpoch, partitionSectors map[uint64][]*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec, ) (removedPower PowerPair, err error)
type DeadlineInfo ¶
type DeadlineInfo struct { CurrentEpoch abi.ChainEpoch // Epoch at which this info was calculated. PeriodStart abi.ChainEpoch // First epoch of the proving period (<= CurrentEpoch). Index uint64 // A deadline index, in [0..WPoStProvingPeriodDeadlines) unless period elapsed. Open abi.ChainEpoch // First epoch from which a proof may be submitted (>= CurrentEpoch). Close abi.ChainEpoch // First epoch from which a proof may no longer be submitted (>= Open). Challenge abi.ChainEpoch // Epoch at which to sample the chain for challenge (< Open). FaultCutoff abi.ChainEpoch // First epoch at which a fault declaration is rejected (< Open). }
Deadline calculations with respect to a current epoch. "Deadline" refers to the window during which proofs may be submitted. Windows are non-overlapping ranges [Open, Close), but the challenge epoch for a window occurs before the window opens. The current epoch may not necessarily lie within the deadline or proving period represented here.
func NewDeadlineInfo ¶ added in v0.5.1
func NewDeadlineInfo(periodStart abi.ChainEpoch, deadlineIdx uint64, currEpoch abi.ChainEpoch) *DeadlineInfo
Returns deadline-related calculations for a deadline in some proving period and the current epoch.
func (*DeadlineInfo) FaultCutoffPassed ¶
func (d *DeadlineInfo) FaultCutoffPassed() bool
Whether the deadline's fault cutoff has passed.
func (*DeadlineInfo) HasElapsed ¶
func (d *DeadlineInfo) HasElapsed() bool
Whether the current deadline has already closed.
func (*DeadlineInfo) IsOpen ¶
func (d *DeadlineInfo) IsOpen() bool
Whether the current deadline is currently open.
func (*DeadlineInfo) Last ¶ added in v0.8.0
func (d *DeadlineInfo) Last() abi.ChainEpoch
The last epoch during which a proof may be submitted.
func (*DeadlineInfo) NextNotElapsed ¶ added in v0.8.0
func (d *DeadlineInfo) NextNotElapsed() *DeadlineInfo
Returns the next instance of this deadline that has not yet elapsed.
func (*DeadlineInfo) NextOpen ¶ added in v0.8.0
func (d *DeadlineInfo) NextOpen() abi.ChainEpoch
Epoch at which the subsequent deadline opens.
func (*DeadlineInfo) NextPeriodStart ¶
func (d *DeadlineInfo) NextPeriodStart() abi.ChainEpoch
The first epoch in the next proving period.
func (*DeadlineInfo) PeriodElapsed ¶ added in v0.5.1
func (d *DeadlineInfo) PeriodElapsed() bool
Whether the proving period has elapsed.
func (*DeadlineInfo) PeriodEnd ¶
func (d *DeadlineInfo) PeriodEnd() abi.ChainEpoch
The last epoch in the proving period.
func (*DeadlineInfo) PeriodStarted ¶
func (d *DeadlineInfo) PeriodStarted() bool
Whether the proving period has begun.
type Deadlines ¶
type Deadlines struct { // Note: we could inline part of the deadline struct (e.g., active/assigned sectors) // to make new sector assignment cheaper. At the moment, assigning a sector requires // loading all deadlines to figure out where best to assign new sectors. Due [WPoStPeriodDeadlines]cid.Cid // []Deadline }
Deadlines contains Deadline objects, describing the sectors due at the given deadline and their state (faulty, terminated, recovering, etc.).
func ConstructDeadlines ¶
func ConstructDeadlines(emptyDeadlineCid cid.Cid) *Deadlines
func (*Deadlines) LoadDeadline ¶ added in v0.8.0
type DeclareFaultsParams ¶
type DeclareFaultsParams struct {
Faults []FaultDeclaration
}
func (*DeclareFaultsParams) MarshalCBOR ¶
func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error
func (*DeclareFaultsParams) UnmarshalCBOR ¶
func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) error
type DeclareFaultsRecoveredParams ¶
type DeclareFaultsRecoveredParams struct {
Recoveries []RecoveryDeclaration
}
func (*DeclareFaultsRecoveredParams) MarshalCBOR ¶
func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error
func (*DeclareFaultsRecoveredParams) UnmarshalCBOR ¶
func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) error
type ExpirationExtension ¶ added in v0.8.0
type ExpirationExtension struct { Deadline uint64 Partition uint64 Sectors *abi.BitField NewExpiration abi.ChainEpoch }
func (*ExpirationExtension) MarshalCBOR ¶ added in v0.8.0
func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error
func (*ExpirationExtension) UnmarshalCBOR ¶ added in v0.8.0
func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) error
type ExpirationQueue ¶ added in v0.8.0
A queue of expiration sets by epoch, representing the on-time or early termination epoch for a collection of sectors. Wraps an AMT[ChainEpoch]*ExpirationSet. Keys in the queue are quantized (upwards), modulo some offset, to reduce the cardinality of keys.
func LoadExpirationQueue ¶ added in v0.8.0
func LoadExpirationQueue(store adt.Store, root cid.Cid, quant QuantSpec) (ExpirationQueue, error)
Loads a queue root. Epochs provided to subsequent method calls will be quantized upwards to quanta mod offsetSeed before being written to/read from queue entries.
func (ExpirationQueue) AddActiveSectors ¶ added in v0.8.0
func (q ExpirationQueue) AddActiveSectors(sectors []*SectorOnChainInfo, ssize abi.SectorSize) (*abi.BitField, PowerPair, abi.TokenAmount, error)
Adds a collection of sectors to their on-time target expiration entries (quantized). The sectors are assumed to be active (non-faulty). Returns the sector numbers, power, and pledge added.
func (ExpirationQueue) PopUntil ¶ added in v0.8.0
func (q ExpirationQueue) PopUntil(until abi.ChainEpoch) (*ExpirationSet, error)
Removes and aggregates entries from the queue up to and including some epoch.
func (ExpirationQueue) RemoveSectors ¶ added in v0.8.0
func (q ExpirationQueue) RemoveSectors(sectors []*SectorOnChainInfo, faults *abi.BitField, recovering *abi.BitField, ssize abi.SectorSize) (*ExpirationSet, PowerPair, error)
Remove some sectors from the queue. The sectors may be active or faulty, and scheduled either for on-time or early termination. Returns the aggregate of removed sectors and power, and recovering power. Fails if any sectors are not found in the queue.
func (ExpirationQueue) ReplaceSectors ¶ added in v0.8.0
func (q ExpirationQueue) ReplaceSectors(oldSectors, newSectors []*SectorOnChainInfo, ssize abi.SectorSize) (*abi.BitField, *abi.BitField, PowerPair, abi.TokenAmount, error)
Removes some sectors and adds some others. The sectors being replaced must not be faulty, so must be scheduled for on-time rather than early expiration. The sectors added are assumed to be not faulty. Returns the old a new sector number bitfields, and delta to power and pledge, new minus old.
func (ExpirationQueue) RescheduleAllAsFaults ¶ added in v0.8.0
func (q ExpirationQueue) RescheduleAllAsFaults(faultExpiration abi.ChainEpoch) error
Re-schedules *all* sectors to expire at an early expiration epoch, if they wouldn't expire before then anyway.
func (ExpirationQueue) RescheduleAsFaults ¶ added in v0.8.0
func (q ExpirationQueue) RescheduleAsFaults(newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ssize abi.SectorSize) (PowerPair, error)
Re-schedules sectors to expire at an early expiration epoch (quantized), if they wouldn't expire before then anyway. The sectors must not be currently faulty, so must be registered as expiring on-time rather than early. The pledge for the now-early sectors is removed from the queue. Returns the total power represented by the sectors.
func (ExpirationQueue) RescheduleExpirations ¶ added in v0.8.0
func (q ExpirationQueue) RescheduleExpirations(newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ssize abi.SectorSize) error
Reschedules some sectors to a new (quantized) expiration epoch. The sectors being rescheduled are assumed to be not faulty, and hence are removed from and re-scheduled for on-time rather than early expiration. The sectors' power and pledge are assumed not to change, despite the new expiration.
func (ExpirationQueue) RescheduleRecovered ¶ added in v0.8.0
func (q ExpirationQueue) RescheduleRecovered(sectors []*SectorOnChainInfo, ssize abi.SectorSize) (PowerPair, error)
Removes sectors from any queue entries in which they appear that are earlier then their scheduled expiration epoch, and schedules them at their expected termination epoch. Pledge for the sectors is re-added as on-time. Power for the sectors is changed from faulty to active (whether rescheduled or not). Returns the newly-recovered power. Fails if any sectors are not found in the queue.
type ExpirationSet ¶ added in v0.8.0
type ExpirationSet struct { OnTimeSectors *abi.BitField // Sectors expiring "on time" at the end of their committed life EarlySectors *abi.BitField // Sectors expiring "early" due to being faulty for too long OnTimePledge abi.TokenAmount // Pledge total for the on-time sectors ActivePower PowerPair // Power that is currently active (not faulty) FaultyPower PowerPair // Power that is currently faulty }
ExpirationSet is a collection of sector numbers that are expiring, either due to expected "on-time" expiration at the end of their life, or unexpected "early" termination due to being faulty for too long consecutively. Note that there is not a direct correspondence between on-time sectors and active power; a sector may be faulty but expiring on-time if it faults just prior to expected termination. Early sectors are always faulty, and active power always represents on-time sectors.
func NewExpirationSet ¶ added in v0.8.0
func NewExpirationSet(onTimeSectors, earlySectors *abi.BitField, onTimePledge abi.TokenAmount, activePower, faultyPower PowerPair) *ExpirationSet
func NewExpirationSetEmpty ¶ added in v0.8.0
func NewExpirationSetEmpty() *ExpirationSet
func (*ExpirationSet) Add ¶ added in v0.8.0
func (es *ExpirationSet) Add(onTimeSectors, earlySectors *abi.BitField, onTimePledge abi.TokenAmount, activePower, faultyPower PowerPair) error
Adds sectors and power to the expiration set in place.
func (*ExpirationSet) IsEmpty ¶ added in v0.8.0
func (es *ExpirationSet) IsEmpty() (empty bool, err error)
A set is empty if it has no sectors. The power and pledge are not checked, but expected to be zero.
func (*ExpirationSet) MarshalCBOR ¶ added in v0.8.0
func (t *ExpirationSet) MarshalCBOR(w io.Writer) error
func (*ExpirationSet) Remove ¶ added in v0.8.0
func (es *ExpirationSet) Remove(onTimeSectors, earlySectors *abi.BitField, onTimePledge abi.TokenAmount, activePower, faultyPower PowerPair) error
Removes sectors and power from the expiration set in place.
func (*ExpirationSet) UnmarshalCBOR ¶ added in v0.8.0
func (t *ExpirationSet) UnmarshalCBOR(r io.Reader) error
type ExtendSectorExpirationParams ¶
type ExtendSectorExpirationParams struct {
Extensions []ExpirationExtension
}
func (*ExtendSectorExpirationParams) MarshalCBOR ¶
func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error
func (*ExtendSectorExpirationParams) UnmarshalCBOR ¶
func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) error
type FaultDeclaration ¶
type FaultDeclaration struct { // The deadline to which the faulty sectors are assigned, in range [0..WPoStPeriodDeadlines) Deadline uint64 // Partition index within the deadline containing the faulty sectors. Partition uint64 // Sectors in the partition being declared faulty. Sectors *abi.BitField }
func (*FaultDeclaration) MarshalCBOR ¶
func (t *FaultDeclaration) MarshalCBOR(w io.Writer) error
func (*FaultDeclaration) UnmarshalCBOR ¶
func (t *FaultDeclaration) UnmarshalCBOR(r io.Reader) error
type GetControlAddressesReturn ¶
func (*GetControlAddressesReturn) MarshalCBOR ¶
func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error
func (*GetControlAddressesReturn) UnmarshalCBOR ¶
func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) error
type MinerInfo ¶
type MinerInfo struct { // Account that owns this miner. // - Income and returned collateral are paid to this address. // - This address is also allowed to change the worker address for the miner. Owner addr.Address // Must be an ID-address. // Worker account for this miner. // The associated pubkey-type address is used to sign blocks and messages on behalf of this miner. Worker addr.Address // Must be an ID-address. PendingWorkerKey *WorkerKeyChange // Byte array representing a Libp2p identity that should be used when connecting to this miner. PeerId abi.PeerID // Slice of byte arrays representing Libp2p multi-addresses used for establishing a connection with this miner. Multiaddrs []abi.Multiaddrs // The proof type used by this miner for sealing sectors. SealProofType abi.RegisteredSealProof // Amount of space in each sector committed by this miner. // This is computed from the proof type and represented here redundantly. SectorSize abi.SectorSize // The number of sectors in each Window PoSt partition (proof). // This is computed from the proof type and represented here redundantly. WindowPoStPartitionSectors uint64 }
func ConstructMinerInfo ¶ added in v0.7.2
type Partition ¶ added in v0.8.0
type Partition struct { // Sector numbers in this partition, including faulty and terminated sectors. Sectors *abi.BitField // Subset of sectors detected/declared faulty and not yet recovered (excl. from PoSt). // Faults ∩ Terminated = ∅ Faults *abi.BitField // Subset of faulty sectors expected to recover on next PoSt // Recoveries ∩ Terminated = ∅ Recoveries *abi.BitField // Subset of sectors terminated but not yet removed from partition (excl. from PoSt) Terminated *abi.BitField // Maps epochs sectors that expire in or before that epoch. // An expiration may be an "on-time" scheduled expiration, or early "faulty" expiration. // Keys are quantized to last-in-deadline epochs. ExpirationsEpochs cid.Cid // AMT[ChainEpoch]ExpirationSet // Subset of terminated that were before their committed expiration epoch, by termination epoch. // Termination fees have not yet been calculated or paid and associated deals have not yet been // canceled but effective power has already been adjusted. // Not quantized. EarlyTerminated cid.Cid // AMT[ChainEpoch]BitField // Power of not-yet-terminated sectors (incl faulty). LivePower PowerPair // Power of currently-faulty sectors. FaultyPower <= LivePower. FaultyPower PowerPair // Power of expected-to-recover sectors. RecoveringPower <= FaultyPower. RecoveringPower PowerPair }
func ConstructPartition ¶ added in v0.8.0
func ConstructPartition(emptyArray cid.Cid) *Partition
A set of sectors associated with a given epoch.
func (*Partition) ActivePower ¶ added in v0.8.0
Active power is power of non-faulty sectors.
func (*Partition) ActiveSectors ¶ added in v0.8.0
Active sectors are those that are neither terminated nor faulty, i.e. actively contributing power.
func (*Partition) AddFaults ¶ added in v0.8.0
func (p *Partition) AddFaults(store adt.Store, sectorNos *abi.BitField, sectors []*SectorOnChainInfo, faultExpiration abi.ChainEpoch, ssize abi.SectorSize, quant QuantSpec) (PowerPair, error)
Records a set of sectors as faulty. The sectors are added to the Faults bitfield and the FaultyPower is increased. The sectors' expirations are rescheduled to the fault expiration epoch, as "early" (if not expiring earlier). The sectors must not be already faulty. Returns the power of the now-faulty sectors.
func (*Partition) AddRecoveries ¶ added in v0.8.0
Adds sectors to recoveries and recovering power. Assumes sectors are faulty but not already present in recoveries.
func (*Partition) AddSectors ¶ added in v0.8.0
func (p *Partition) AddSectors(store adt.Store, sectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) (PowerPair, error)
AddSectors adds new sectors to the partition. The sectors are "live", neither faulty, recovering, nor terminated. Each new sector's expiration is scheduled shortly after its target expiration epoch.
func (*Partition) LiveSectors ¶ added in v0.8.0
Live sectors are those that are not terminated (but may be faulty).
func (*Partition) PopEarlyTerminations ¶ added in v0.8.0
func (*Partition) PopExpiredSectors ¶ added in v0.8.0
func (p *Partition) PopExpiredSectors(store adt.Store, until abi.ChainEpoch, quant QuantSpec) (*ExpirationSet, error)
PopExpiredSectors traverses the expiration queue up to and including some epoch, and marks all expiring sectors as terminated. Returns the expired sector aggregates.
func (*Partition) RecordMissedPost ¶ added in v0.8.0
func (p *Partition) RecordMissedPost(store adt.Store, faultExpiration abi.ChainEpoch, quant QuantSpec) (newFaultPower, failedRecoveryPower PowerPair, err error)
Marks all non-faulty sectors in the partition as faulty and clears recoveries, updating power memos appropriately. All sectors' expirations are rescheduled to the fault expiration, as "early" (if not expiring earlier) Returns the power of the newly faulty and failed recovery sectors.
func (*Partition) RecoverFaults ¶ added in v0.8.0
func (p *Partition) RecoverFaults(store adt.Store, recovered *abi.BitField, sectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) (PowerPair, error)
Removes sector numbers from faults and thus from recoveries. The sectors are removed from the Faults and Recovering bitfields, and FaultyPower and RecoveringPower reduced. The sectors are re-scheduled for expiration shortly after their target expiration epoch. Consistency between the partition totals and queue depend on the reported sectors actually being faulty and recovering. Returns the power of the now-recovered sectors.
func (*Partition) RemoveRecoveries ¶ added in v0.8.0
Removes sectors from recoveries and recovering power. Assumes sectors are currently faulty and recovering..
func (*Partition) ReplaceSectors ¶ added in v0.8.0
func (p *Partition) ReplaceSectors(store adt.Store, oldSectors, newSectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) (PowerPair, abi.TokenAmount, error)
Replaces a number of "old" sectors with new ones. The old sectors must not be faulty or terminated. If the same sector is both removed and added, this permits rescheduling *with a change in power*, unlike RescheduleExpirations. Returns the delta to power and pledge requirement.
func (*Partition) RescheduleExpirations ¶ added in v0.8.0
func (p *Partition) RescheduleExpirations(store adt.Store, newExpiration abi.ChainEpoch, sectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) error
RescheduleExpirations moves expiring sectors to the target expiration. The power of the rescheduled sectors is assumed to have not changed since initial scheduling.
func (*Partition) TerminateSectors ¶ added in v0.8.0
func (p *Partition) TerminateSectors(store adt.Store, epoch abi.ChainEpoch, sectors []*SectorOnChainInfo, ssize abi.SectorSize, quant QuantSpec) (PowerPair, error)
Marks a collection of sectors as terminated. The sectors are removed from Faults and Recoveries. The epoch of termination is recorded for future termination fee calculation.
type PartitionKey ¶ added in v0.8.0
Identifier for a single partition within a miner.
type PoStPartition ¶ added in v0.8.0
type PoStPartition struct { // Partitions are numbered per-deadline, from zero. Index uint64 // Sectors skipped while proving that weren't already declared faulty Skipped *abi.BitField }
func (*PoStPartition) MarshalCBOR ¶ added in v0.8.0
func (t *PoStPartition) MarshalCBOR(w io.Writer) error
func (*PoStPartition) UnmarshalCBOR ¶ added in v0.8.0
func (t *PoStPartition) UnmarshalCBOR(r io.Reader) error
type PowerPair ¶ added in v0.8.0
type PowerPair struct { Raw abi.StoragePower QA abi.StoragePower }
Value type for a pair of raw and QA power.
func NewPowerPair ¶ added in v0.8.0
func NewPowerPair(raw, qa abi.StoragePower) PowerPair
func NewPowerPairZero ¶ added in v0.8.0
func NewPowerPairZero() PowerPair
func PowerForSector ¶ added in v0.8.0
func PowerForSector(sectorSize abi.SectorSize, sector *SectorOnChainInfo) PowerPair
func PowerForSectors ¶ added in v0.7.0
func PowerForSectors(ssize abi.SectorSize, sectors []*SectorOnChainInfo) PowerPair
Returns the sum of the raw byte and quality-adjusted power for sectors.
type ProveCommitSectorParams ¶
type ProveCommitSectorParams struct { SectorNumber abi.SectorNumber Proof []byte }
func (*ProveCommitSectorParams) MarshalCBOR ¶
func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error
func (*ProveCommitSectorParams) UnmarshalCBOR ¶
func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) error
type QuantSpec ¶ added in v0.8.0
type QuantSpec struct {
// contains filtered or unexported fields
}
A spec for quantization.
func NewQuantSpec ¶ added in v0.8.1
func NewQuantSpec(unit, offset abi.ChainEpoch) QuantSpec
func (QuantSpec) QuantizeUp ¶ added in v0.8.0
func (q QuantSpec) QuantizeUp(e abi.ChainEpoch) abi.ChainEpoch
type RecoveryDeclaration ¶
type RecoveryDeclaration struct { // The deadline to which the recovered sectors are assigned, in range [0..WPoStPeriodDeadlines) Deadline uint64 // Partition index within the deadline containing the recovered sectors. Partition uint64 // Sectors in the partition being declared recovered. Sectors *abi.BitField }
func (*RecoveryDeclaration) MarshalCBOR ¶
func (t *RecoveryDeclaration) MarshalCBOR(w io.Writer) error
func (*RecoveryDeclaration) UnmarshalCBOR ¶
func (t *RecoveryDeclaration) UnmarshalCBOR(r io.Reader) error
type ReportConsensusFaultParams ¶
type ReportConsensusFaultParams struct { BlockHeader1 []byte BlockHeader2 []byte BlockHeaderExtra []byte }
func (*ReportConsensusFaultParams) MarshalCBOR ¶
func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error
func (*ReportConsensusFaultParams) UnmarshalCBOR ¶
func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) error
type SealVerifyStuff ¶ added in v0.5.4
type SealVerifyStuff struct { SealedCID cid.Cid // CommR InteractiveEpoch abi.ChainEpoch // Used to derive the interactive PoRep challenge. abi.RegisteredSealProof Proof []byte DealIDs []abi.DealID abi.SectorNumber SealRandEpoch abi.ChainEpoch // Used to tie the seal to a chain. }
SealVerifyParams is the structure of information that must be sent with a message to commit a sector. Most of this information is not needed in the state tree but will be verified in sm.CommitSector. See SealCommitment for data stored on the state tree for each sector.
type SectorLocation ¶ added in v0.8.0
type SectorLocation struct {
Deadline, Partition uint64
SectorNumber abi.SectorNumber
}
Location of a specific sector
type SectorOnChainInfo ¶
type SectorOnChainInfo struct { SectorNumber abi.SectorNumber SealProof abi.RegisteredSealProof // The seal proof type implies the PoSt proof/s SealedCID cid.Cid // CommR DealIDs []abi.DealID Activation abi.ChainEpoch // Epoch during which the sector proof was accepted Expiration abi.ChainEpoch // Epoch during which the sector expires DealWeight abi.DealWeight // Integral of active deals over sector lifetime VerifiedDealWeight abi.DealWeight // Integral of active verified deals over sector lifetime InitialPledge abi.TokenAmount // Pledge collected to commit this sector ExpectedDayReward abi.TokenAmount // Expect daily reward for sector computed at activation time }
Information stored on-chain for a proven sector.
func (*SectorOnChainInfo) MarshalCBOR ¶
func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error
func (*SectorOnChainInfo) UnmarshalCBOR ¶
func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) error
type SectorPreCommitInfo ¶
type SectorPreCommitInfo struct { SealProof abi.RegisteredSealProof SectorNumber abi.SectorNumber SealedCID cid.Cid `checked:"true"` // CommR SealRandEpoch abi.ChainEpoch DealIDs []abi.DealID Expiration abi.ChainEpoch ReplaceCapacity bool // Whether to replace a "committed capacity" no-deal sector (requires non-empty DealIDs) // The committed capacity sector to replace, and it's deadline/partition location ReplaceSectorDeadline uint64 ReplaceSectorPartition uint64 ReplaceSectorNumber abi.SectorNumber }
Information provided by a miner when pre-committing a sector.
func (*SectorPreCommitInfo) MarshalCBOR ¶
func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error
func (*SectorPreCommitInfo) UnmarshalCBOR ¶
func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) error
type SectorPreCommitOnChainInfo ¶
type SectorPreCommitOnChainInfo struct { Info SectorPreCommitInfo PreCommitDeposit abi.TokenAmount PreCommitEpoch abi.ChainEpoch DealWeight abi.DealWeight // Integral of active deals over sector lifetime VerifiedDealWeight abi.DealWeight // Integral of active verified deals over sector lifetime }
Information stored on-chain for a pre-committed sector.
func (*SectorPreCommitOnChainInfo) MarshalCBOR ¶
func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error
func (*SectorPreCommitOnChainInfo) UnmarshalCBOR ¶
func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) error
type SectorStatus ¶ added in v0.8.0
type SectorStatus int
const ( SectorNotFound SectorStatus = iota SectorFaulty SectorTerminated SectorHealthy )
type Sectors ¶ added in v0.8.1
Sectors is a helper type for accessing/modifying a miner's sectors. It's safe to pass this object around as needed.
func (Sectors) Get ¶ added in v0.8.1
func (sa Sectors) Get(sectorNumber abi.SectorNumber) (info *SectorOnChainInfo, found bool, err error)
func (Sectors) Load ¶ added in v0.8.1
func (sa Sectors) Load(sectorNos *abi.BitField) ([]*SectorOnChainInfo, error)
func (Sectors) MustGet ¶ added in v0.8.1
func (sa Sectors) MustGet(sectorNumber abi.SectorNumber) (info *SectorOnChainInfo, err error)
func (Sectors) Store ¶ added in v0.8.1
func (sa Sectors) Store(infos ...*SectorOnChainInfo) error
type State ¶
type State struct { // Information not related to sectors. Info cid.Cid PreCommitDeposits abi.TokenAmount // Total funds locked as PreCommitDeposits LockedFunds abi.TokenAmount // Total rewards and added funds locked in vesting table VestingFunds cid.Cid // Array, AMT[ChainEpoch]TokenAmount InitialPledgeRequirement abi.TokenAmount // Sum of initial pledge requirements of all active sectors // Sectors that have been pre-committed but not yet proven. PreCommittedSectors cid.Cid // Map, HAMT[SectorNumber]SectorPreCommitOnChainInfo // Information for all proven and not-yet-expired sectors. Sectors cid.Cid // Array, AMT[SectorNumber]SectorOnChainInfo (sparse) // The first epoch in this miner's current proving period. This is the first epoch in which a PoSt for a // partition at the miner's first deadline may arrive. Alternatively, it is after the last epoch at which // a PoSt for the previous window is valid. // Always greater than zero, this may be greater than the current epoch for genesis miners in the first // WPoStProvingPeriod epochs of the chain; the epochs before the first proving period starts are exempt from Window // PoSt requirements. // Updated at the end of every period by a cron callback. ProvingPeriodStart abi.ChainEpoch // Index of the deadline within the proving period beginning at ProvingPeriodStart that has not yet been // finalized. // Updated at the end of each deadline window by a cron callback. CurrentDeadline uint64 // The sector numbers due for PoSt at each deadline in the current proving period, frozen at period start. // New sectors are added and expired ones removed at proving period boundary. // Faults are not subtracted from this in state, but on the fly. Deadlines cid.Cid // Deadlines with outstanding fees for early sector termination. EarlyTerminations *bitfield.BitField // Memoized power information FaultyPower PowerPair }
Balance of Miner Actor should be greater than or equal to the sum of PreCommitDeposits and LockedFunds. It is possible for balance to fall below the sum of PCD, LF and InitialPledgeRequirements, and this is a bad state (IP Debt) that limits a miner actor's behavior (i.e. no balance withdrawals) Excess balance as computed by st.GetAvailableBalance will be withdrawable or usable for pre-commit deposit or pledge lock-up.
func ConstructState ¶
func (*State) AddInitialPledgeRequirement ¶ added in v0.7.0
func (st *State) AddInitialPledgeRequirement(amount abi.TokenAmount)
func (*State) AddLockedFunds ¶
func (st *State) AddLockedFunds(store adt.Store, currEpoch abi.ChainEpoch, vestingSum abi.TokenAmount, spec *VestSpec) error
func (*State) AddPreCommitDeposit ¶
func (st *State) AddPreCommitDeposit(amount abi.TokenAmount)
func (*State) AssertBalanceInvariants ¶
func (st *State) AssertBalanceInvariants(balance abi.TokenAmount)
func (*State) AssignSectorsToDeadlines ¶ added in v0.8.0
func (st *State) AssignSectorsToDeadlines( store adt.Store, currentEpoch abi.ChainEpoch, sectors []*SectorOnChainInfo, partitionSize uint64, sectorSize abi.SectorSize, quant QuantSpec, ) (PowerPair, error)
Assign new sectors to deadlines.
func (*State) CheckVestedFunds ¶
func (st *State) CheckVestedFunds(store adt.Store, currEpoch abi.ChainEpoch) (abi.TokenAmount, error)
CheckVestedFunds returns the amount of vested funds that have vested before the provided epoch.
func (*State) DeadlineInfo ¶
func (st *State) DeadlineInfo(currEpoch abi.ChainEpoch) *DeadlineInfo
Returns deadline calculations for the current (according to state) proving period.
func (*State) DeletePrecommittedSectors ¶ added in v0.7.2
func (*State) DeleteSectors ¶
func (*State) FindPrecommittedSectors ¶ added in v0.8.0
func (st *State) FindPrecommittedSectors(store adt.Store, sectorNos ...abi.SectorNumber) ([]*SectorPreCommitOnChainInfo, error)
This method gets and returns the requested pre-committed sectors, skipping missing sectors.
func (*State) FindSector ¶ added in v0.8.0
func (*State) ForEachSector ¶
func (st *State) ForEachSector(store adt.Store, f func(*SectorOnChainInfo)) error
Iterates sectors. The pointer provided to the callback is not safe for re-use. Copy the pointed-to value in full to hold a reference.
func (*State) GetAvailableBalance ¶
func (st *State) GetAvailableBalance(actorBalance abi.TokenAmount) abi.TokenAmount
Unclaimed funds. Actor balance - (locked funds, precommit deposit, ip requirement) Can go negative if the miner is in IP debt
func (*State) GetMaxAllowedFaults ¶
func (*State) GetPrecommittedSector ¶
func (st *State) GetPrecommittedSector(store adt.Store, sectorNo abi.SectorNumber) (*SectorPreCommitOnChainInfo, bool, error)
func (*State) GetSector ¶
func (st *State) GetSector(store adt.Store, sectorNo abi.SectorNumber) (*SectorOnChainInfo, bool, error)
func (*State) GetUnlockedBalance ¶ added in v0.8.1
func (st *State) GetUnlockedBalance(actorBalance abi.TokenAmount) abi.TokenAmount
Unclaimed funds that are not locked -- includes funds used to cover initial pledge requirement
func (*State) HasSectorNo ¶
func (*State) LoadSectorInfos ¶
func (st *State) LoadSectorInfos(store adt.Store, sectors *abi.BitField) ([]*SectorOnChainInfo, error)
Loads sector info for a sequence of sectors.
func (*State) LoadSectorInfosForProof ¶ added in v0.5.1
func (st *State) LoadSectorInfosForProof(store adt.Store, provenSectors, expectedFaults *abi.BitField) ([]*SectorOnChainInfo, error)
Loads info for a set of sectors to be proven. If any of the sectors are declared faulty and not to be recovered, info for the first non-faulty sector is substituted instead. If any of the sectors are declared recovered, they are returned from this method.
func (*State) LoadSectorInfosWithFaultMask ¶
func (st *State) LoadSectorInfosWithFaultMask(store adt.Store, sectors *abi.BitField, faults *abi.BitField, faultStandIn abi.SectorNumber) ([]*SectorOnChainInfo, error)
Loads sector info for a sequence of sectors, substituting info for a stand-in sector for any that are faulty.
func (*State) MeetsInitialPledgeCondition ¶ added in v0.8.1
func (st *State) MeetsInitialPledgeCondition(balance abi.TokenAmount) bool
func (*State) PenalizeFundsInPriorityOrder ¶ added in v0.8.1
func (st *State) PenalizeFundsInPriorityOrder(store adt.Store, currEpoch abi.ChainEpoch, target, unlockedBalance abi.TokenAmount) (fromVesting abi.TokenAmount, fromBalance abi.TokenAmount, err error)
PenalizeFundsInPriorityOrder first unlocks unvested funds from the vesting table. If the target is not yet hit it deducts funds from the (new) available balance. Returns the amount unlocked from the vesting table and the amount taken from current balance. If the penalty exceeds the total amount available in the vesting table and unlocked funds the penalty is reduced to match. This must be fixed when handling bankrupcy: https://github.com/filecoin-project/specs-actors/issues/627
func (*State) PopEarlyTerminations ¶ added in v0.8.0
func (st *State) PopEarlyTerminations(store adt.Store, maxPartitions, maxSectors uint64) (result TerminationResult, hasMore bool, err error)
Pops up to max early terminated sectors from all deadlines.
Returns hasMore if we still have more early terminations to process.
func (*State) PutPrecommittedSector ¶
func (st *State) PutPrecommittedSector(store adt.Store, info *SectorPreCommitOnChainInfo) error
func (*State) PutSectors ¶ added in v0.7.2
func (st *State) PutSectors(store adt.Store, newSectors ...*SectorOnChainInfo) error
func (*State) QuantEndOfDeadline ¶ added in v0.8.0
Returns a quantization spec that quantizes values to the last epoch in each deadline.
func (*State) RescheduleSectorExpirations ¶ added in v0.8.0
func (st *State) RescheduleSectorExpirations(store adt.Store, currEpoch abi.ChainEpoch, sectors []SectorLocation, ssize abi.SectorSize, quant QuantSpec) error
Schedule's each sector to expire at its next deadline end.
If it can't find any given sector, it skips it.
This method assumes that each sector's power has not changed, despite the rescheduling.
TODO: distinguish bad arguments from invalid state https://github.com/filecoin-project/specs-actors/issues/597
func (*State) SaveDeadlines ¶
func (*State) SectorStatus ¶ added in v0.8.0
func (st *State) SectorStatus(store adt.Store, dlIdx, pIdx uint64, sector abi.SectorNumber) (SectorStatus, error)
Returns a sector's status (healthy, faulty, missing, not found, terminated)
func (*State) UnlockUnvestedFunds ¶
func (st *State) UnlockUnvestedFunds(store adt.Store, currEpoch abi.ChainEpoch, target abi.TokenAmount) (abi.TokenAmount, error)
Unlocks an amount of funds that have *not yet vested*, if possible. The soonest-vesting entries are unlocked first. Returns the amount actually unlocked.
func (*State) UnlockVestedFunds ¶
func (st *State) UnlockVestedFunds(store adt.Store, currEpoch abi.ChainEpoch) (abi.TokenAmount, error)
Unlocks all vesting funds that have vested before the provided epoch. Returns the amount unlocked.
func (*State) WalkSectors ¶ added in v0.8.0
func (st *State) WalkSectors( store adt.Store, locations []SectorLocation, beforeDeadlineCb func(dlIdx uint64, dl *Deadline) (update bool, err error), partitionCb func(dl *Deadline, partition *Partition, dlIdx, partIdx uint64, sectors *bitfield.BitField) (update bool, err error), afterDeadlineCb func(dlIdx uint64, dl *Deadline) (update bool, err error), ) error
Walks the given sectors, deadline by deadline, partition by partition, skipping missing partitions/sectors.
type SubmitWindowedPoStParams ¶
type SubmitWindowedPoStParams struct { // The deadline index which the submission targets. Deadline uint64 // The partitions being proven. Partitions []PoStPartition // Array of proofs, one per distinct registered proof type present in the sectors being proven. // In the usual case of a single proof type, this array will always have a single element (independent of number of partitions). Proofs []abi.PoStProof }
Information submitted by a miner to provide a Window PoSt.
func (*SubmitWindowedPoStParams) MarshalCBOR ¶
func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error
func (*SubmitWindowedPoStParams) UnmarshalCBOR ¶
func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) error
type TerminateSectorsParams ¶
type TerminateSectorsParams struct {
Terminations []TerminationDeclaration
}
func (*TerminateSectorsParams) MarshalCBOR ¶
func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error
func (*TerminateSectorsParams) UnmarshalCBOR ¶
func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) error
type TerminateSectorsReturn ¶ added in v0.8.0
type TerminateSectorsReturn struct { // Set to true if all early termination work has been completed. When // false, the miner may choose to repeatedly invoke TerminateSectors // with no new sectors to process the remainder of the pending // terminations. While pending terminations are outstanding, the miner // will not be able to withdraw funds. Done bool }
func (*TerminateSectorsReturn) MarshalCBOR ¶ added in v0.8.0
func (t *TerminateSectorsReturn) MarshalCBOR(w io.Writer) error
func (*TerminateSectorsReturn) UnmarshalCBOR ¶ added in v0.8.0
func (t *TerminateSectorsReturn) UnmarshalCBOR(r io.Reader) error
type TerminationDeclaration ¶ added in v0.8.0
func (*TerminationDeclaration) MarshalCBOR ¶ added in v0.8.0
func (t *TerminationDeclaration) MarshalCBOR(w io.Writer) error
func (*TerminationDeclaration) UnmarshalCBOR ¶ added in v0.8.0
func (t *TerminationDeclaration) UnmarshalCBOR(r io.Reader) error
type TerminationResult ¶ added in v0.8.0
type TerminationResult struct { // Sectors maps epochs at which sectors expired, to bitfields of sector // numbers. Sectors map[abi.ChainEpoch]*abi.BitField // Counts the number of partitions & sectors processed. PartitionsProcessed, SectorsProcessed uint64 }
func (*TerminationResult) Add ¶ added in v0.8.0
func (t *TerminationResult) Add(newResult TerminationResult) error
func (*TerminationResult) BelowLimit ¶ added in v0.8.0
func (t *TerminationResult) BelowLimit(maxPartitions, maxSectors uint64) bool
Returns true if we're below the partition/sector limit. Returns false if we're at (or above) the limit.
func (*TerminationResult) ForEach ¶ added in v0.8.0
func (t *TerminationResult) ForEach(cb func(epoch abi.ChainEpoch, sectors *abi.BitField) error) error
func (*TerminationResult) IsEmpty ¶ added in v0.8.0
func (t *TerminationResult) IsEmpty() bool
type VestSpec ¶
type VestSpec struct { InitialDelay abi.ChainEpoch // Delay before any amount starts vesting. VestPeriod abi.ChainEpoch // Period over which the total should vest, after the initial delay. StepDuration abi.ChainEpoch // Duration between successive incremental vests (independent of vesting period). Quantization abi.ChainEpoch // Maximum precision of vesting table (limits cardinality of table). }
Specification for a linear vesting schedule.
type WithdrawBalanceParams ¶
type WithdrawBalanceParams struct {
AmountRequested abi.TokenAmount
}
func (*WithdrawBalanceParams) MarshalCBOR ¶
func (t *WithdrawBalanceParams) MarshalCBOR(w io.Writer) error
func (*WithdrawBalanceParams) UnmarshalCBOR ¶
func (t *WithdrawBalanceParams) UnmarshalCBOR(r io.Reader) error
type WorkerKeyChange ¶
type WorkerKeyChange struct { NewWorker addr.Address // Must be an ID address EffectiveAt abi.ChainEpoch }
func (*WorkerKeyChange) MarshalCBOR ¶
func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error
func (*WorkerKeyChange) UnmarshalCBOR ¶
func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) error