Epoch Schedule

class EpochSchedule

Configuration for epochs and slots.

Parameters:

slots_per_epoch (int) – The maximum number of slots in each epoch.

static custom(slots_per_epoch, leader_schedule_slot_offset, warmup)
static default()

Create a new default EpochSchedule.

Returns:

The default EpochSchedule.

Return type:

EpochSchedule

first_normal_epoch

Basically log2(slots_per_epoch) - log2(MINIMUM_SLOTS_PER_EPOCH)

Type:

int

first_normal_slot

Basically MINIMUM_SLOTS_PER_EPOCH * (2.pow(first_normal_epoch) - 1)

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.

get_epoch(slot)

Get epoch for the given slot

get_epoch_and_slot_index(slot)

get epoch and offset into the epoch for the given slot

get_first_slot_in_epoch(epoch)
get_last_slot_in_epoch(epoch)
get_leader_schedule_epoch(slot)

Get the epoch for which the given slot should save off information about stakers.

get_slots_in_epoch(epoch)

Get the length of the given epoch (in slots).

leader_schedule_slot_offset

A number of slots before beginning of an epoch to calculate a leader schedule for that epoch.

Type:

int

slots_per_epoch

The maximum number of slots in each epoch.

Type:

int

to_json()

Convert to a JSON string.

warmup

Whether epochs start short and grow

Type:

bool

static without_warmup()