Skip to content

Commit

Permalink
Merge 602d2e2 into 3c15da3
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilWindle authored Sep 27, 2024
2 parents 3c15da3 + 602d2e2 commit fa10b1e
Show file tree
Hide file tree
Showing 59 changed files with 1,733 additions and 538 deletions.
11 changes: 11 additions & 0 deletions l1-contracts/src/core/Leonidas.sol
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ contract Leonidas is Ownable, ILeonidas {
return _ts < GENESIS_TIME ? Slot.wrap(0) : SlotLib.fromTimestamp(_ts - GENESIS_TIME);
}

/**
* @notice Computes the epoch at a specific slot
*
* @param _slotNumber - The slot number to compute the epoch for
*
* @return The computed epoch
*/
function getEpochAtSlot(Slot _slotNumber) public pure override(ILeonidas) returns (Epoch) {
return Epoch.wrap(_slotNumber.unwrap() / EPOCH_DURATION);
}

/**
* @notice Adds a validator to the set WITHOUT setting up the epoch
* @param _validator - The validator to add
Expand Down
Loading

0 comments on commit fa10b1e

Please sign in to comment.