| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Shelley.API.Forecast
Description
Forecast API for the consensus layer.
This module provides a type-safe interface for extracting protocol-relevant data from the ledger state, both for the current slot and for future slots within the stability window.
Synopsis
- class (STS (EraRule "TICKF" era), BaseM (EraRule "TICKF" era) ~ ShelleyBase, Environment (EraRule "TICKF" era) ~ (), State (EraRule "TICKF" era) ~ NewEpochState era, Signal (EraRule "TICKF" era) ~ SlotNo, PredicateFailure (EraRule "TICKF" era) ~ Void, EraGov era, EraCertState era) ⇒ EraForecast era where
- type Forecast (t ∷ Timeline) era = (r ∷ Type) | r → t era
- mkForecast ∷ ∀ (t ∷ Timeline). NewEpochState era → Forecast t era
- poolDistrForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) PoolDistr
- maxBlockHeaderSizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Word16
- maxBlockBodySizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Word32
- protocolVersionForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) ProtVer
- data Timeline
- class (EraForecast era, AtMostEra "Alonzo" era) ⇒ ShelleyEraForecast era where
- genDelegsForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) GenDelegs
- decentralizationForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) UnitInterval
- extraEntropyForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Nonce
- currentForecast ∷ EraForecast era ⇒ NewEpochState era → Forecast 'Current era
- futureForecast ∷ EraForecast era ⇒ Globals → SlotNo → NewEpochState era → Forecast 'Future era
- forecastChainChecks ∷ ∀ (t ∷ Timeline) era. EraForecast era ⇒ Forecast t era → ChainChecksPParams
Core forecast class
class (STS (EraRule "TICKF" era), BaseM (EraRule "TICKF" era) ~ ShelleyBase, Environment (EraRule "TICKF" era) ~ (), State (EraRule "TICKF" era) ~ NewEpochState era, Signal (EraRule "TICKF" era) ~ SlotNo, PredicateFailure (EraRule "TICKF" era) ~ Void, EraGov era, EraCertState era) ⇒ EraForecast era where Source #
Core class for extracting forecast data from the ledger state.
Associated Types
type Forecast (t ∷ Timeline) era = (r ∷ Type) | r → t era Source #
Per-era forecast type.
Methods
mkForecast ∷ ∀ (t ∷ Timeline). NewEpochState era → Forecast t era Source #
Extract a forecast from a NewEpochState
poolDistrForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) PoolDistr Source #
maxBlockHeaderSizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Word16 Source #
maxBlockBodySizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Word32 Source #
protocolVersionForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) ProtVer Source #
Instances
| EraForecast ShelleyEra Source # | |||||
Defined in Cardano.Ledger.Shelley.Forecast Associated Types
Methods mkForecast ∷ ∀ (t ∷ Timeline). NewEpochState ShelleyEra → Forecast t ShelleyEra Source # poolDistrForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) PoolDistr Source # maxBlockHeaderSizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) Word16 Source # maxBlockBodySizeForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) Word32 Source # protocolVersionForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) ProtVer Source # | |||||
Type-level tag distinguishing current from future forecasts.
TPraos-era extension (Shelley through Alonzo)
class (EraForecast era, AtMostEra "Alonzo" era) ⇒ ShelleyEraForecast era where Source #
Additional forecast fields available only in TPraos eras.
Methods
genDelegsForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) GenDelegs Source #
decentralizationForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) UnitInterval Source #
extraEntropyForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t era) Nonce Source #
Instances
| ShelleyEraForecast ShelleyEra Source # | |
Defined in Cardano.Ledger.Shelley.Forecast Methods genDelegsForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) GenDelegs Source # decentralizationForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) UnitInterval Source # extraEntropyForecastL ∷ ∀ (t ∷ Timeline). Lens' (Forecast t ShelleyEra) Nonce Source # | |
Main functions
currentForecast ∷ EraForecast era ⇒ NewEpochState era → Forecast 'Current era Source #
Extract the forecast for the current slot.
futureForecast ∷ EraForecast era ⇒ Globals → SlotNo → NewEpochState era → Forecast 'Future era Source #
TICKF a NewEpochState and then extract the forecast from it.
Conversion helpers
forecastChainChecks ∷ ∀ (t ∷ Timeline) era. EraForecast era ⇒ Forecast t era → ChainChecksPParams Source #
Construct ChainChecksPParams from any forecast.