pub struct Deadline {
    pub partitions: Cid,
    pub expirations_epochs: Cid,
    pub partitions_posted: BitField,
    pub early_terminations: BitField,
    pub live_sectors: u64,
    pub total_sectors: u64,
    pub faulty_power: PowerPair,
    pub optimistic_post_submissions: Cid,
    /* private fields */
}
Expand description

Deadline holds the state for all sectors due at a specific deadline.

Fields

partitions: Cid

Partitions in this deadline, in order. The keys of this AMT are always sequential integers beginning with zero.

expirations_epochs: Cid

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.

partitions_posted: BitFieldearly_terminations: BitField

Partitions with sectors that terminated early.

live_sectors: u64

The number of non-terminated sectors in this deadline (incl faulty).

total_sectors: u64

The total number of sectors in this deadline (incl dead).

faulty_power: PowerPair

Memoized sum of faulty power in partitions.

optimistic_post_submissions: Cid

Implementations

Adds some partition numbers to the set expiring at an epoch.

PopExpiredSectors terminates expired sectors from all partitions. Returns the expired sector aggregates.

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). The sectors are assumed to be non-faulty.

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.

Processes all PoSt submissions, marking unproven sectors as faulty and clearing failed recoveries. It returns the power delta, and any power that should be penalized (new faults and failed recoveries).

Processes a series of posts, recording proven partitions and marking skipped sectors as faulty.

It returns a PoStResult containing the list of proven and skipped sectors and changes to power (newly faulty power, power that should have been proven recovered but wasn’t, and newly recovered power).

NOTE: This function does not actually verify any proofs. The returned sectors and ignored_sectors must subsequently be validated against the PoSt submitted by the miner.

pub fn record_post_proofs<BS: BlockStore>(
    &mut self,
    store: &BS,
    partitions: &BitField,
    proofs: &[PoStProof]
) -> Result<(), Box<dyn StdError>>

pub fn take_post_proofs<BS: BlockStore>(
    &mut self,
    store: &BS,
    idx: u64
) -> Result<(BitField, Vec<PoStProof>), Box<dyn StdError>>

RescheduleSectorExpirations reschedules the expirations of the given sectors to the target epoch, 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.

Trait Implementations

Formats the value using the given formatter. 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 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.