pub struct State {
Show 15 fields pub info: Cid, pub pre_commit_deposits: TokenAmount, pub locked_funds: TokenAmount, pub vesting_funds: Cid, pub fee_debt: TokenAmount, pub initial_pledge: TokenAmount, pub pre_committed_sectors: Cid, pub pre_committed_sectors_cleanup: Cid, pub allocated_sectors: Cid, pub sectors: Cid, pub proving_period_start: ChainEpoch, pub current_deadline: usize, pub deadlines: Cid, pub early_terminations: BitField, pub deadline_cron_active: bool,
}
Expand description

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.

Fields

info: Cid

Contains static info about this miner

pre_commit_deposits: TokenAmount

Total funds locked as pre_commit_deposit

locked_funds: TokenAmount

Total rewards and added funds locked in vesting table

vesting_funds: Cid

VestingFunds (Vesting Funds schedule for the miner).

fee_debt: TokenAmount

Absolute value of debt this miner owes from unpaid fees.

initial_pledge: TokenAmount

Sum of initial pledge requirements of all active sectors.

pre_committed_sectors: Cid

Sectors that have been pre-committed but not yet proven. Map, HAMT<SectorNumber, SectorPreCommitOnChainInfo>

pre_committed_sectors_cleanup: Cidallocated_sectors: Cid

Allocated sector IDs. Sector IDs can never be reused once allocated.

sectors: Cid

Information for all proven and not-yet-garbage-collected sectors.

Sectors are removed from this AMT when the partition to which the sector belongs is compacted.

proving_period_start: ChainEpoch

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.

current_deadline: usize

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.

deadlines: Cid

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.

early_terminations: BitField

Deadlines with outstanding fees for early sector termination.

deadline_cron_active: bool

Implementations

Returns deadline calculations for the current (according to state) proving period.

Returns deadline calculations for the current (according to state) proving period.

Marks a set of sector numbers as having been allocated. If policy is DenyCollisions, fails if the set intersects with the sector numbers already allocated.

Stores a pre-committed sector info, failing if the sector number is already present.

Gets and returns the requested pre-committed sectors, skipping missing sectors.

Returns the deadline and partition index for a sector number.

Schedules 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.

Note: this method is used to “upgrade” sectors, rescheduling the now-replaced sectors to expire at the end of the next deadline. Given the expense of sealing a sector, this function skips missing/faulty/terminated “upgraded” sectors instead of failing. That way, the new sectors can still be proved.

Assign new sectors to deadlines.

Pops up to max_sectors early terminated sectors from all deadlines.

Returns true if we still have more early terminations to process.

Loads sector info for a sequence of sectors.

Loads the vesting funds table from the store.

Saves the vesting table to the store.

First vests and unlocks the vested funds AND then locks the given funds in the vesting table.

Draws from vesting table and unlocked funds to repay up to the fee debt. Returns the amount unlocked from the vesting table and the amount taken from current balance. If the fee debt exceeds the total amount available for repayment the fee debt field is updated to track the remaining debt. Otherwise it is set to zero.

Repays the full miner actor fee debt. Returns the amount that must be burnt and an error if there are not sufficient funds to cover repayment. Miner state repays from unlocked funds and fails if unlocked funds are insufficient to cover fee debt. FeeDebt will be zero after a successful call.

Unlocks an amount of funds that have not yet vested, if possible. The soonest-vesting entries are unlocked first. Returns the amount actually unlocked.

Unlocks all vesting funds that have vested before the provided epoch. Returns the amount unlocked.

CheckVestedFunds returns the amount of vested funds that have vested before the provided epoch.

Unclaimed funds that are not locked – includes funds used to cover initial pledge requirement.

Unclaimed funds. Actor balance - (locked funds, precommit deposit, ip requirement) Can go negative if the miner is in IP debt.

pre-commit expiry

Trait Implementations

Marshalls cbor encodable object into cbor bytes

Unmarshals cbor encoded bytes to object

Returns the content identifier of the raw block of data Default is Blake2b256 hash Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.