Epochs module keeps EpochInfo
objects and modify the information as epochs info changes.
Epochs are initialized as part of genesis initialization, and modified on begin blockers or end blockers.
message EpochInfo {
string identifier = 1;
google.protobuf.Timestamp start_time = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"start_time\""
];
google.protobuf.Duration duration = 3 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.jsontag) = "duration,omitempty",
(gogoproto.moretags) = "yaml:\"duration\""
];
int64 current_epoch = 4;
google.protobuf.Timestamp current_epoch_start_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"current_epoch_start_time\""
];
bool epoch_counting_started = 6;
bool current_epoch_ended = 7;
}
EpochInfo keeps identifier
, start_time
,duration
, current_epoch
, current_epoch_start_time
, epoch_counting_started
, current_epoch_ended
.
identifier
keeps epoch identification string.start_time
keeps epoch counting start time, if block time passesstart_time
,epoch_counting_started
is set.duration
keeps target epoch duration.current_epoch
keeps current active epoch number.current_epoch_start_time
keeps the start time of current epoch.epoch_number
is counted only whenepoch_counting_started
flag is set.- If
current_epoch_ended
is set, epoch number is increased on next block.