Expand description
Information about the network’s clock, ticks, slots, etc.
Time in Solana is marked primarily by slots, which occur approximately every 400 milliseconds, and are numbered sequentially. For every slot, a leader is chosen from the validator set, and that leader is expected to produce a new block, though sometimes leaders may fail to do so. Blocks can be identified by their slot number, and some slots do not contain a block.
An approximation of the passage of real-world time can be calculated by
multiplying a number of slots by DEFAULT_MS_PER_SLOT
, which is a constant target
time for the network to produce slots. Note though that this method suffers
a variable amount of drift, as the network does not produce slots at exactly
the target rate, and the greater number of slots being calculated for, the
greater the drift. Epochs cannot be used this way as they contain variable
numbers of slots.
The network’s current view of the real-world time can always be accessed via
Clock::unix_timestamp
, which is produced by an oracle derived from the
validator set.
Modules§
- sysvar
sysvar
Structs§
- Clock
- A representation of network time.
Constants§
- DEFAULT_
DEV_ SLOTS_ PER_ EPOCH - DEFAULT_
HASHES_ PER_ SECOND - DEFAULT_
HASHES_ PER_ TICK - DEFAULT_
MS_ PER_ SLOT - The expected duration of a slot (400 milliseconds).
- DEFAULT_
SLOTS_ PER_ EPOCH - The number of slots per epoch after initial network warmup.
- DEFAULT_
S_ PER_ SLOT - DEFAULT_
TICKS_ PER_ SECOND - The default tick rate that the cluster attempts to achieve (160 per second).
- DEFAULT_
TICKS_ PER_ SLOT - FORWARD_
TRANSACTIONS_ TO_ LEADER_ AT_ SLOT_ OFFSET - Transaction forwarding, which leader to forward to and how long to hold
- GENESIS_
EPOCH - HOLD_
TRANSACTIONS_ SLOT_ OFFSET - INITIAL_
RENT_ EPOCH - MAX_
HASH_ AGE_ IN_ SECONDS - The time window of recent block hash values over which the bank will track signatures.
- MAX_
PROCESSING_ AGE - MAX_
RECENT_ BLOCKHASHES - MAX_
TRANSACTION_ FORWARDING_ DELAY - More delay is expected if CUDA is not enabled (as signature verification takes longer)
- MAX_
TRANSACTION_ FORWARDING_ DELAY_ GPU - This is maximum time consumed in forwarding a transaction from one node to next, before it can be processed in the target node
- MS_
PER_ TICK - The number of milliseconds per tick (6).
- NUM_
CONSECUTIVE_ LEADER_ SLOTS - SECONDS_
PER_ DAY - TICKS_
PER_ DAY - UPDATED_
HASHES_ PER_ SECOND_ 2 - UPDATED_
HASHES_ PER_ SECOND_ 3 - UPDATED_
HASHES_ PER_ SECOND_ 4 - UPDATED_
HASHES_ PER_ SECOND_ 5 - UPDATED_
HASHES_ PER_ SECOND_ 6 - UPDATED_
HASHES_ PER_ TICK2 - UPDATED_
HASHES_ PER_ TICK3 - UPDATED_
HASHES_ PER_ TICK4 - UPDATED_
HASHES_ PER_ TICK5 - UPDATED_
HASHES_ PER_ TICK6
Type Aliases§
- BankId
- Uniquely distinguishes every version of a slot.
- Epoch
- The unit of time a given leader schedule is honored.
- Slot
- The unit of time given to a leader for encoding a block.
- Slot
Count - The number of slots in a epoch.
- Slot
Index - An index to the slots of a epoch.
- Unix
Timestamp - An approximate measure of real-world time.