mechanism
the epoch clock
how epochs are bounded and advanced on chain
an epoch is a fixed window of 7 days, measured on chain by slot derived timestamps rather than wall clock trust. the program stores the start time of the current epoch and the fixed length. an epoch is over when the on chain time passes start plus length.
advancing the clock is permissionless. anyone can call the crank once an epoch has elapsed. the crank closes the open epoch, computes the swept total, opens the pool for that epoch, and sets the start of the next epoch to the prior boundary so that no time is lost and no time is double counted. because the boundary is deterministic, the identity of the caller does not change the result.
if the crank is late, the math is unchanged. the elapsed epochs are well defined by the stored start time and the fixed length, so a delayed crank settles every skipped epoch in order at the correct rate. the clock cannot be rushed and it cannot be stalled into giving a different answer.