Struct forest_actor::miner::Partition[][src]

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

Fields

sectors: BitField

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

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

faulty_power: PowerPair

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

recovering_power: PowerPair

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

Implementations

impl Partition[src]

pub fn new(empty_array_cid: Cid) -> Self[src]

pub fn live_sectors(&self) -> BitField[src]

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

pub fn active_sectors(&self) -> BitField[src]

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

pub fn active_power(&self) -> PowerPair[src]

Active power is power of non-faulty sectors.

pub fn add_sectors<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &[SectorOnChainInfo],
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<PowerPair, Box<dyn StdError>>
[src]

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.

pub fn add_faults<BS: BlockStore>(
    &mut self,
    store: &BS,
    sector_numbers: &BitField,
    sectors: &[SectorOnChainInfo],
    fault_expiration: ChainEpoch,
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<PowerPair, Box<dyn StdError>>
[src]

marks a set of sectors faulty

pub fn declare_faults<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &Sectors<'_, BS>,
    sector_numbers: &mut UnvalidatedBitField,
    fault_expiration_epoch: ChainEpoch,
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<(BitField, PowerPair), Box<dyn StdError>>
[src]

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.

pub fn recover_faults<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &Sectors<'_, BS>,
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<PowerPair, Box<dyn StdError>>
[src]

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.

pub fn declare_faults_recovered<BS: BlockStore>(
    &mut self,
    sectors: &Sectors<'_, BS>,
    sector_size: SectorSize,
    sector_numbers: &mut UnvalidatedBitField
) -> Result<(), Box<dyn StdError>>
[src]

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

pub fn remove_recoveries(
    &mut self,
    sector_numbers: &BitField,
    power: &PowerPair
)
[src]

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

pub fn reschedule_expirations<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &Sectors<'_, BS>,
    new_expiration: ChainEpoch,
    sector_numbers: &mut UnvalidatedBitField,
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<BitField, Box<dyn StdError>>
[src]

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.

pub fn replace_sectors<BS: BlockStore>(
    &mut self,
    store: &BS,
    old_sectors: &[SectorOnChainInfo],
    new_sectors: &[SectorOnChainInfo],
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<(PowerPair, TokenAmount), Box<dyn StdError>>
[src]

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.

pub fn record_early_termination<BS: BlockStore>(
    &mut self,
    store: &BS,
    epoch: ChainEpoch,
    sectors: &BitField
) -> Result<(), Box<dyn StdError>>
[src]

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

pub fn terminate_sectors<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &Sectors<'_, BS>,
    epoch: ChainEpoch,
    sector_numbers: &mut UnvalidatedBitField,
    sector_size: SectorSize,
    quant: QuantSpec
) -> Result<ExpirationSet, Box<dyn StdError>>
[src]

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.

pub fn pop_expired_sectors<BS: BlockStore>(
    &mut self,
    store: &BS,
    until: ChainEpoch,
    quant: QuantSpec
) -> Result<ExpirationSet, Box<dyn StdError>>
[src]

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), Box<dyn StdError>>
[src]

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.

pub fn pop_early_terminations<BS: BlockStore>(
    &mut self,
    store: &BS,
    max_sectors: u64
) -> Result<(TerminationResult, bool), Box<dyn StdError>>
[src]

pub fn record_skipped_faults<BS: BlockStore>(
    &mut self,
    store: &BS,
    sectors: &Sectors<'_, BS>,
    sector_size: SectorSize,
    quant: QuantSpec,
    fault_expiration: ChainEpoch,
    skipped: &mut UnvalidatedBitField
) -> Result<(PowerPair, PowerPair), ActorError>
[src]

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.

Trait Implementations

impl Clone for Partition[src]

impl<'de> Deserialize<'de> for Partition[src]

impl Serialize for Partition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,