package
5.2.0
Repository: https://github.com/prysmaticlabs/prysm.git
Documentation: pkg.go.dev

# Packages

Package testing includes useful mocks for slot tickers in unit tests.

# Functions

AbsoluteValueSlotDifference between two slots.
BeginsAt computes the timestamp where the given slot begins, relative to the genesis timestamp.
CountdownToGenesis starts a ticker at the specified duration logging the remaining minutes until the genesis chainstart event along with important genesis state metadata such as number of genesis validators.
CurrentSlot returns the current slot as determined by the local clock and provided genesis time.
DivideSlotBy divides the SECONDS_PER_SLOT configuration parameter by a specified number.
Duration computes the span of time between two instants, represented as Slots.
EpochEnd returns the last slot number of the current epoch.
EpochsSinceGenesis returns the number of epochs since the provided genesis time.
EpochStart returns the first slot number of the current epoch.
IsEpochEnd returns true if the given slot number is an epoch ending slot number.
IsEpochStart returns true if the given slot number is an epoch starting slot number.
MaxSafeEpoch gives the largest epoch value that can be safely converted to a slot.
MultiplySlotBy multiplies the SECONDS_PER_SLOT configuration parameter by a specified number.
NewSlotTicker starts and returns a new SlotTicker instance.
NewSlotTickerWithIntervals starts and returns a SlotTicker instance that allows several offsets of time from genesis, Caller is responsible to input the intervals in increasing order and none bigger or equal than SecondsPerSlot.
NewSlotTickerWithOffset starts and returns a SlotTicker instance that allows a offset of time from genesis, entering a offset greater than secondsPerSlot is not allowed.
PrevSlot returns previous slot, with an exception in slot 0 to prevent underflow.
RoundUpToNearestEpoch rounds up the provided slot value to the nearest epoch.
SecondsSinceSlotStart returns the number of seconds elapsed since the given slot start time.
SecondsUntilNextEpochStart returns how many seconds until the next Epoch start from the current time and slot.
Since computes the number of time slots that have occurred since the given timestamp.
SinceEpochStarts returns number of slots since the start of the epoch.
SinceGenesis returns the number of slots since the provided genesis time.
StartTime returns the start time in terms of its unix epoch value.
SyncCommitteePeriod returns the sync committee period of input epoch `e`.
SyncCommitteePeriodStartEpoch returns the start epoch of a sync committee period.
TimeIntoSlot returns the time duration elapsed between the current time and the start of the current slot.
ToEpoch returns the epoch number of the input slot.
ToForkVersion translates a slot into it's corresponding version.
ToTime takes the given slot and genesis time to determine the start time of the slot.
UnsafeEpochStart is a version of EpochStart that panics if there is an overflow.
ValidateClock validates a provided slot against the local clock to ensure slots that are unreasonable are returned with an error.
VerifyTime validates the input slot is not from the future.
VotingPeriodStartTime returns the current voting period's start time depending on the provided genesis and current slot.
WithinVotingWindow returns whether the current time is within the voting window (eg.

# Constants

MaxSlotBuffer specifies the max buffer given to slots from incoming objects.

# Structs

SlotInterval is a wrapper that contains a slot and the interval index that triggered the ticker.
SlotIntervalTicker is similar to a slot ticker but it returns also the index of the interval that triggered the event.
SlotTicker is a special ticker for the beacon chain block.

# Interfaces

The IntervalTicker is similar to the Ticker interface but exposes also the interval along with the slot number.
The Ticker interface defines a type which can expose a receive-only channel firing slot events.