pub struct Partition {
    pub sectors: BitField,
    pub unproven: BitField,
    pub faults: BitField,
    pub recoveries: BitField,
    pub terminated: BitField,
    pub expirations_epochs: Cid,
    pub early_terminated: Cid,
    pub live_power: PowerPair,
    pub unproven_power: PowerPair,
    pub faulty_power: PowerPair,
    pub recovering_power: PowerPair,
}

Fields

sectors: BitField

Sector numbers in this partition, including faulty, unproven and terminated sectors.

unproven: BitField

Unproven sectors in this partition. This bitfield will be cleared on a successful window post (or at the end of the partition’s next deadline). At that time, any still unproven sectors will be added to the faulty sector bitfield.

faults: BitField

Subset of sectors detected/declared faulty and not yet recovered (excl. from PoSt). Faults ∩ Terminated = ∅

recoveries: BitField

Subset of faulty sectors expected to recover on next PoSt Recoveries ∩ Terminated = ∅

terminated: BitField

Subset of sectors terminated but not yet removed from partition (excl. from PoSt)

expirations_epochs: Cid

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.

early_terminated: Cid

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.

live_power: PowerPair

Power of not-yet-terminated sectors (incl faulty & unproven).

unproven_power: PowerPair

Power of yet-to-be-proved sectors (never faulty).

faulty_power: PowerPair

Power of currently-faulty sectors. FaultyPower <= LivePower.

recovering_power: PowerPair

Power of expected-to-recover sectors. RecoveringPower <= FaultyPower.

Implementations

Live sectors are those that are not terminated (but may be faulty).

Active sectors are those that are neither terminated nor faulty nor unproven, i.e. actively contributing power.

Active power is power of non-faulty sectors.

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.

marks a set of sectors faulty

Declares a set of sectors faulty. Already faulty sectors are ignored, terminated sectors are skipped, and recovering sectors are reverted to faulty.

  • New faults 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).

Returns the power of the now-faulty sectors.

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. Returns the power of the now-recovered sectors.

Activates unproven sectors, returning the activated power.

Declares sectors as recovering. Non-faulty and already recovering sectors will be skipped.

Removes sectors from recoveries and recovering power. Assumes sectors are currently faulty and recovering.

RescheduleExpirations moves expiring sectors to the target expiration, skipping any sectors it can’t find.

The power of the rescheduled sectors is assumed to have not changed since initial scheduling.

Note: see the docs on State.RescheduleSectorExpirations for details on why we skip sectors/partitions we can’t find.

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.

Record the epoch of any sectors expiring early, for termination fee calculation later.

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.

PopExpiredSectors traverses the expiration queue up to and including some epoch, and marks all expiring sectors as terminated. Returns the expired sector aggregates.

pub fn record_missed_post<BS: BlockStore>(
    &mut self,
    store: &BS,
    fault_expiration: ChainEpoch,
    quant: QuantSpec
) -> Result<(PowerPair, PowerPair, PowerPair), Box<dyn StdError>>

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.

Discovers how skipped faults declared during post intersect with existing faults and recoveries, records the new faults in state. Returns the amount of power newly faulty, or declared recovered but faulty again.

  • Skipped faults that are not in the provided partition triggers an error.
  • Skipped faults that are already declared (but not delcared recovered) are ignored.

Test invariants about the partition power are valid.

Trait Implementations

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.