ouroboros-consensus-cardano-0.12.1.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Shelley.ShelleyHFC

Description

This module is the Shelley Hard Fork Combinator

Synopsis

Documentation

type ShelleyBlockHFC proto era = HardForkBlock '[ShelleyBlock proto era] Source #

Shelley as the single era in the hard fork combinator

data ShelleyPartialLedgerConfig era Source #

Constructors

ShelleyPartialLedgerConfig 

Fields

Instances

Instances details
Generic (ShelleyPartialLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

Associated Types

type Rep (ShelleyPartialLedgerConfig era) :: Type -> Type Source #

(NoThunks (TranslationContext era), Era era) => NoThunks (ShelleyPartialLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

Methods

noThunks :: Context -> ShelleyPartialLedgerConfig era -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> ShelleyPartialLedgerConfig era -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy (ShelleyPartialLedgerConfig era) -> String

type Rep (ShelleyPartialLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

type Rep (ShelleyPartialLedgerConfig era) = D1 ('MetaData "ShelleyPartialLedgerConfig" "Ouroboros.Consensus.Shelley.ShelleyHFC" "ouroboros-consensus-cardano-0.12.1.0-B7PPTiiOqdjFK3zhRUwDA9" 'False) (C1 ('MetaCons "ShelleyPartialLedgerConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyLedgerConfig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ShelleyLedgerConfig era)) :*: S1 ('MetaSel ('Just "shelleyTriggerHardFork") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TriggerHardFork)))

crossEraForecastAcrossShelley :: forall eraFrom eraTo protoFrom protoTo. (TranslateProto protoFrom protoTo, LedgerSupportsProtocol (ShelleyBlock protoFrom eraFrom)) => RequiringBoth WrapLedgerConfig (CrossEraForecaster LedgerState WrapLedgerView) (ShelleyBlock protoFrom eraFrom) (ShelleyBlock protoTo eraTo) Source #

forecastAcrossShelley Source #

Arguments

:: forall protoFrom protoTo eraFrom eraTo. (TranslateProto protoFrom protoTo, LedgerSupportsProtocol (ShelleyBlock protoFrom eraFrom)) 
=> ShelleyLedgerConfig eraFrom 
-> ShelleyLedgerConfig eraTo 
-> Bound

Transition between the two eras

-> SlotNo

Forecast for this slot

-> LedgerState (ShelleyBlock protoFrom eraFrom) 
-> Except OutsideForecastRange (WrapLedgerView (ShelleyBlock protoTo eraTo)) 

Forecast from a Shelley-based era to the next Shelley-based era.

translateChainDepStateAcrossShelley :: forall eraFrom eraTo protoFrom protoTo. TranslateProto protoFrom protoTo => RequiringBoth WrapConsensusConfig (Translate WrapChainDepState) (ShelleyBlock protoFrom eraFrom) (ShelleyBlock protoTo eraTo) Source #

Orphan instances

(ShelleyBasedEra era, ShelleyBasedEra (PreviousEra era), Era (PreviousEra era), EraCrypto (PreviousEra era) ~ EraCrypto era) => TranslateEra era (ShelleyTip proto) Source # 
Instance details

Associated Types

type TranslationError era (ShelleyTip proto)

Methods

translateEra :: TranslationContext era -> ShelleyTip proto (PreviousEra era) -> Except (TranslationError era (ShelleyTip proto)) (ShelleyTip proto era)

(ShelleyBasedEra era, TranslateEra era (ShelleyTip proto), TranslateEra era NewEpochState, TranslationError era NewEpochState ~ Void) => TranslateEra era (LedgerState :.: ShelleyBlock proto) Source # 
Instance details

Associated Types

type TranslationError era (LedgerState :.: ShelleyBlock proto)

Methods

translateEra :: TranslationContext era -> (LedgerState :.: ShelleyBlock proto) (PreviousEra era) -> Except (TranslationError era (LedgerState :.: ShelleyBlock proto)) ((LedgerState :.: ShelleyBlock proto) era)

(ShelleyBasedEra era, TranslateEra era WrapTx) => TranslateEra era (GenTx :.: ShelleyBlock proto) Source # 
Instance details

Associated Types

type TranslationError era (GenTx :.: ShelleyBlock proto)

Methods

translateEra :: TranslationContext era -> (GenTx :.: ShelleyBlock proto) (PreviousEra era) -> Except (TranslationError era (GenTx :.: ShelleyBlock proto)) ((GenTx :.: ShelleyBlock proto) era)

(ShelleyBasedEra era, TranslateEra era WrapTx) => TranslateEra era (WrapValidatedGenTx :.: ShelleyBlock proto) Source # 
Instance details

Associated Types

type TranslationError era (WrapValidatedGenTx :.: ShelleyBlock proto)

Methods

translateEra :: TranslationContext era -> (WrapValidatedGenTx :.: ShelleyBlock proto) (PreviousEra era) -> Except (TranslationError era (WrapValidatedGenTx :.: ShelleyBlock proto)) ((WrapValidatedGenTx :.: ShelleyBlock proto) era)

PraosCrypto c => HasPartialConsensusConfig (Praos c) Source # 
Instance details

Associated Types

type PartialConsensusConfig (Praos c)

Methods

completeConsensusConfig :: proxy (Praos c) -> EpochInfo (Except PastHorizonException) -> PartialConsensusConfig (Praos c) -> ConsensusConfig (Praos c)

toPartialConsensusConfig :: proxy (Praos c) -> ConsensusConfig (Praos c) -> PartialConsensusConfig (Praos c)

PraosCrypto c => HasPartialConsensusConfig (TPraos c) Source # 
Instance details

Associated Types

type PartialConsensusConfig (TPraos c)

Methods

completeConsensusConfig :: proxy (TPraos c) -> EpochInfo (Except PastHorizonException) -> PartialConsensusConfig (TPraos c) -> ConsensusConfig (TPraos c)

toPartialConsensusConfig :: proxy (TPraos c) -> ConsensusConfig (TPraos c) -> PartialConsensusConfig (TPraos c)

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era)) => NoHardForks (ShelleyBlock proto era) Source # 
Instance details

Methods

getEraParams :: TopLevelConfig (ShelleyBlock proto era) -> EraParams

toPartialLedgerConfig :: proxy (ShelleyBlock proto era) -> LedgerConfig (ShelleyBlock proto era) -> PartialLedgerConfig (ShelleyBlock proto era)

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era)) => SingleEraBlock (ShelleyBlock proto era) Source # 
Instance details

Methods

singleEraTransition :: PartialLedgerConfig (ShelleyBlock proto era) -> EraParams -> Bound -> LedgerState (ShelleyBlock proto era) -> Maybe EpochNo

singleEraInfo :: proxy (ShelleyBlock proto era) -> SingleEraInfo (ShelleyBlock proto era)

ShelleyCompatible proto era => HasPartialLedgerConfig (ShelleyBlock proto era) Source # 
Instance details

Associated Types

type PartialLedgerConfig (ShelleyBlock proto era)

Methods

completeLedgerConfig :: proxy (ShelleyBlock proto era) -> EpochInfo (Except PastHorizonException) -> PartialLedgerConfig (ShelleyBlock proto era) -> LedgerConfig (ShelleyBlock proto era)

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era)) => SerialiseConstraintsHFC (ShelleyBlock proto era) Source # 
Instance details

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era)) => SupportedNetworkProtocolVersion (ShelleyBlockHFC proto era) Source #

Forward to the ShelleyBlock instance. Only supports HardForkNodeToNodeDisabled, which is compatible with nodes running with ShelleyBlock.

Instance details

Methods

supportedNodeToNodeVersions :: Proxy (ShelleyBlockHFC proto era) -> Map NodeToNodeVersion (BlockNodeToNodeVersion (ShelleyBlockHFC proto era))

supportedNodeToClientVersions :: Proxy (ShelleyBlockHFC proto era) -> Map NodeToClientVersion (BlockNodeToClientVersion (ShelleyBlockHFC proto era))

latestReleasedNodeVersion :: Proxy (ShelleyBlockHFC proto era) -> (Maybe NodeToNodeVersion, Maybe NodeToClientVersion)

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era)) => SerialiseHFC '[ShelleyBlock proto era] Source #

Use the default implementations. This means the serialisation of blocks includes an era wrapper. Each block should do this from the start to be prepared for future hard forks without having to do any bit twiddling.

Instance details

Methods

encodeDiskHfcBlock :: CodecConfig (HardForkBlock '[ShelleyBlock proto era]) -> HardForkBlock '[ShelleyBlock proto era] -> Encoding

decodeDiskHfcBlock :: CodecConfig (HardForkBlock '[ShelleyBlock proto era]) -> forall s. Decoder s (ByteString -> HardForkBlock '[ShelleyBlock proto era])

reconstructHfcPrefixLen :: proxy (Header (HardForkBlock '[ShelleyBlock proto era])) -> PrefixLen

reconstructHfcNestedCtxt :: proxy (Header (HardForkBlock '[ShelleyBlock proto era])) -> ShortByteString -> SizeInBytes -> SomeSecond (NestedCtxt Header) (HardForkBlock '[ShelleyBlock proto era])

getHfcBinaryBlockInfo :: HardForkBlock '[ShelleyBlock proto era] -> BinaryBlockInfo

estimateHfcBlockSize :: Header (HardForkBlock '[ShelleyBlock proto era]) -> SizeInBytes