Clock

class Clock

A representation of network time.

All members of Clock start from 0 upon network boot.

epoch

The current epoch.

Type:

int

epoch_start_timestamp

The timestamp of the first Slot in this Epoch.

Type:

int

static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

leader_schedule_epoch

The future Epoch for which the leader schedule has most recently been calculated.

Type:

int

slot

The current Slot.

Type:

int

to_json()

Convert to a JSON string.

unix_timestamp

The approximate real world time of the current slot.

Type:

int

DEFAULT_DEV_SLOTS_PER_EPOCH: Final[int] = 8192
DEFAULT_HASHES_PER_SECOND: Final[int] = 2000000
DEFAULT_HASHES_PER_TICK: Final[int] = 12500
DEFAULT_MS_PER_SLOT: Final[int] = 400

The expected duration of a slot in milliseconds.

DEFAULT_SLOTS_PER_EPOCH: Final[int] = 432000

The number of slots per epoch after initial network warmup.

DEFAULT_S_PER_SLOT: Final[float] = 0.4
DEFAULT_TICKS_PER_SECOND: Final[int] = 160

The default tick rate that the cluster attempts to achieve.

DEFAULT_TICKS_PER_SLOT: Final[int] = 64
FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET: Final[int] = 2

Transaction forwarding, which leader to forward to

GENESIS_EPOCH: Final[int] = 0
HOLD_TRANSACTIONS_SLOT_OFFSET: Final[int] = 20

Transaction forwarding, how long to hold

INITIAL_RENT_EPOCH: Final[int] = 0
MAX_HASH_AGE_IN_SECONDS: Final[int] = 120

The window of recent blockhashes over which the bank will track signatures.

MAX_PROCESSING_AGE: Final[int] = 150

The maximum age of a blockhash that will be accepted by the leader

MAX_RECENT_BLOCKHASHES: Final[int] = 300

Max number of recent blockhashes (one blockhash per non-skipped slot)

MAX_TRANSACTION_FORWARDING_DELAY: Final[int] = 6
MAX_TRANSACTION_FORWARDING_DELAY_GPU: Final[int] = 2
MS_PER_TICK: Final[int] = 6

The number of milliseconds per tick.

NUM_CONSECUTIVE_LEADER_SLOTS: Final[int] = 4
SECONDS_PER_DAY: Final[int] = 86400
TICKS_PER_DAY: Final[int] = 13824000