dline

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: Apache-2.0, MIT Imports: 1 Imported by: 105

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Deadline parameters
	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..d.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).

	// Protocol parameters
	WPoStPeriodDeadlines   uint64
	WPoStProvingPeriod     abi.ChainEpoch // the number of epochs in a window post proving period
	WPoStChallengeWindow   abi.ChainEpoch
	WPoStChallengeLookback abi.ChainEpoch
	FaultDeclarationCutoff abi.ChainEpoch
}

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 NewInfo

func NewInfo(periodStart abi.ChainEpoch, deadlineIdx uint64, currEpoch abi.ChainEpoch, wPoStPeriodDeadlines uint64, wPoStProvingPeriod, wPoStChallengeWindow, wPoStChallengeLookback, faultDeclarationCutoff abi.ChainEpoch) *Info

Returns deadline-related calculations for a deadline in some proving period and the current epoch.

func (*Info) FaultCutoffPassed

func (d *Info) FaultCutoffPassed() bool

Whether the deadline's fault cutoff has passed.

func (*Info) HasElapsed

func (d *Info) HasElapsed() bool

Whether the current deadline has already closed.

func (*Info) IsOpen

func (d *Info) IsOpen() bool

Whether the current deadline is currently open.

func (*Info) Last

func (d *Info) Last() abi.ChainEpoch

The last epoch during which a proof may be submitted.

func (*Info) NextNotElapsed

func (d *Info) NextNotElapsed() *Info

Returns the next instance of this deadline that has not yet elapsed.

func (*Info) NextOpen

func (d *Info) NextOpen() abi.ChainEpoch

Epoch at which the subsequent deadline opens.

func (*Info) NextPeriodStart

func (d *Info) NextPeriodStart() abi.ChainEpoch

The first epoch in the next proving period.

func (*Info) PeriodElapsed

func (d *Info) PeriodElapsed() bool

Whether the proving period has elapsed.

func (*Info) PeriodEnd

func (d *Info) PeriodEnd() abi.ChainEpoch

The last epoch in the proving period.

func (*Info) PeriodStarted

func (d *Info) PeriodStarted() bool

Whether the proving period has begun.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL