Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype SlotNo = SlotNo {}
- getTheSlotOfNoReturn ∷ HasCallStack ⇒ SlotNo → ShelleyBase (EpochNo, SlotNo, EpochNo)
- newtype Duration = Duration {}
- (-*) ∷ SlotNo → SlotNo → Duration
- (+*) ∷ SlotNo → Duration → SlotNo
- (*-) ∷ SlotNo → Duration → SlotNo
- newtype EpochNo = EpochNo {}
- newtype EpochSize = EpochSize {}
- data EpochInfo (m ∷ TYPE LiftedRep → Type)
- newtype BlockNo = BlockNo {}
- epochFromSlot ∷ SlotNo → Reader Globals EpochNo
- epochInfoEpoch ∷ HasCallStack ⇒ EpochInfo Identity → SlotNo → EpochNo
- epochInfoFirst ∷ HasCallStack ⇒ EpochInfo Identity → EpochNo → SlotNo
- epochInfoSize ∷ HasCallStack ⇒ EpochInfo Identity → EpochNo → EpochSize
Documentation
The 0-based index for the Ourboros time slot.
Instances
getTheSlotOfNoReturn ∷ HasCallStack ⇒ SlotNo → ShelleyBase (EpochNo, SlotNo, EpochNo) Source #
Figure out a slot number that is two stability windows before the end of the next epoch. Together with the slot number we also return the current epoch number and the next epoch number.
The reason why it is called the point of no return, is because that is the point when HardForkCombinator (HFC) initiates a controlled hard fork, if there is a major protocol version update that forks into a new era.
Instances
An epoch, i.e. the number of the epoch.
Instances
Instances
data EpochInfo (m ∷ TYPE LiftedRep → Type) Source #
Information about epochs
Different epochs may have different sizes and different slot lengths. This
information is encapsulated by EpochInfo
. It is parameterized over a monad
m
because the information about how long each epoch is may depend on
information derived from the blockchain itself. It ultimately requires acess
to state, and so either uses the monad for that or uses the monad to reify
failure due to cached state information being too stale for the current
query.
The 0-based index of the block in the blockchain. BlockNo is <= SlotNo and is only equal at slot N if there is a block for every slot where N <= SlotNo.