Skip to content

Commit

Permalink
Account for Genesis Slot in Epoch index calc
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Feb 16, 2024
1 parent 688788a commit a2661d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tips/TIP-0046/tip-0046.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ timestamp `Unix Timestamp` (in seconds) is calculated as follows:

Each epoch has a corresponding epoch index, which is a `uint32`. To calculate the epoch index of a slot index, that is,
the index of the epoch to which the slot belongs, the protocol parameter `Slots Per Epoch Exponent` is used. The epoch
index of a slot index `Slot Index` is `Slot Index >> Slots Per Epoch Exponent`, where `>>` is the _zero-fill
right-shift_ or _logical shift_ operation.
index of a slot index `Slot Index` is calculated as follows:

- If `Slot Index <= Genesis Slot` then the epoch index is `0`.
- Otherwise the epoch index is `(Slot Index - Genesis Slot) >> Slots Per Epoch Exponent)`, where `>>` is the _zero-fill
right-shift_ or _logical shift_ operation.

## Slot Commitment

Expand Down

0 comments on commit a2661d2

Please sign in to comment.