Module epochs

Module epochs 

Source
Expand description

Sequential pipeline that populates the schema::epochs CF.

Driven by Checkpoint::epoch_info, which returns a populated sui_types::storage::EpochInfo for the new epoch on two cases: the genesis checkpoint, and the end-of-epoch checkpoint of the prior epoch (the one carrying end_of_epoch_data). Every other checkpoint returns None and contributes nothing.

Mirroring the index_epoch flow in sui-core::rpc_index:

  1. Emit a start operand for the new epoch — protocol version, reference gas price, start timestamp, start checkpoint, and BCS-encoded SuiSystemState, all read off the new system-state object the end-of-epoch transaction wrote to its outputs.
  2. If the new epoch is non-genesis, emit an end operand for the prior epoch, built from the boundary checkpoint (the prior epoch’s last, which carries end_of_epoch_data): its timestamp and sequence number, its network_total_transactions as tx_hi, the end-of-epoch commitments, and — unless the epoch ended in safe mode — the gas and stake counters from the change-epoch transaction’s SystemEpochInfoEvent. Mirrors the postgres kv_epoch_ends handler.

Structs§

Epochs
Pipeline marker for epochs.
Row
A partial StoredEpoch record keyed by epoch number, staged as a merge operand at commit time. Both the start and end partial records share this shape; the field-wise merge operator in schema::epochs combines them (and any re-seeds) into a full row.