cardano-api
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Consensus

Synopsis

Consensus modes

Consensus modes. The node supports several different modes with different combinations of consensus protocols and ledger eras.

The protocols supported in each era

Connection parameters for each mode

data ConsensusModeParams where Source #

The consensus-mode-specific parameters needed to connect to a local node that is using each consensus mode.

It is in fact only the Byron era that requires extra parameters, but this is of course inherited by the CardanoMode that uses the Byron era. The reason this parameter is needed stems from unfortunate design decisions from the legacy Byron era. The slots per epoch are needed to be able to decode epoch boundary blocks from the Byron era.

It is possible in future that we may be able to eliminate this parameter by discovering it from the node during the initial handshake.

newtype EpochSlots Source #

The number of slots per epoch.

Constructors

EpochSlots 

Fields

Instances

Instances details
Data EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EpochSlots -> c EpochSlots Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EpochSlots Source #

toConstr :: EpochSlots -> Constr Source #

dataTypeOf :: EpochSlots -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EpochSlots) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EpochSlots) Source #

gmapT :: (forall b. Data b => b -> b) -> EpochSlots -> EpochSlots Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> EpochSlots -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EpochSlots -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

Generic EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Cardano.Chain.Slotting.EpochSlots" "cardano-ledger-byron-1.1.0.0-7fb551a04b7ebd202180a636c363fd4c69d431c37908920ba820fedd2c0d0ade" 'True) (C1 ('MetaCons "EpochSlots" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
Read EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Show EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

FromCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

ToCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

DecCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

EncCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Buildable EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

build :: EpochSlots -> Builder

Eq EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Ord EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

NoThunks EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

noThunks :: Context -> EpochSlots -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> EpochSlots -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy EpochSlots -> String #

type Rep EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Cardano.Chain.Slotting.EpochSlots" "cardano-ledger-byron-1.1.0.0-7fb551a04b7ebd202180a636c363fd4c69d431c37908920ba820fedd2c0d0ade" 'True) (C1 ('MetaCons "EpochSlots" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

Conversions to and from types in the consensus library

Transactions in the consensus mode

Transactions in the context of a consensus mode, and other types used in the transaction submission protocol.

Transaction in a consensus mode

data TxInMode where Source #

A Tx in one of the eras supported by a given protocol mode.

For multi-era modes such as the CardanoMode this type is a sum of the different transaction types for all the eras. It is used in the LocalTxSubmission protocol.

Constructors

TxInMode :: forall era. ShelleyBasedEra era -> Tx era -> TxInMode

Shelley based transactions.

TxInByronSpecial :: GenTx ByronBlock -> TxInMode

Legacy Byron transactions and things we can post to the chain which are not actually transactions. This covers: update proposals, votes and delegation certs.

Instances

Instances details
Show TxInMode Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

Transaction id in a consensus mode

data TxIdInMode where Source #

A TxId in one of the eras supported by a given protocol mode.

For multi-era modes such as the CardanoMode this type is a sum of the different transaction types for all the eras. It is used in the LocalTxMonitoring protocol.

TODO Rename to TxIdInEra

Constructors

TxIdInMode :: forall era. CardanoEra era -> TxId -> TxIdInMode 

Transaction validation errors

data TxValidationError era where Source #

The transaction validations errors that can occur from trying to submit a transaction to a local node. The errors are specific to an era.

Instances

Instances details
ToJSON (TxValidationError era) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

Methods

toJSON :: TxValidationError era -> Value #

toEncoding :: TxValidationError era -> Encoding #

toJSONList :: [TxValidationError era] -> Value #

toEncodingList :: [TxValidationError era] -> Encoding #

omitField :: TxValidationError era -> Bool #

Generic (TxValidationError era) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

Associated Types

type Rep (TxValidationError era) 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

type Rep (TxValidationError era) = D1 ('MetaData "TxValidationError" "Cardano.Api.Consensus.Internal.InMode" "cardano-api-10.17.0.0-inplace" 'False) (C1 ('MetaCons "ByronTxValidationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApplyTxErr ByronBlock))) :+: C1 ('MetaCons "ShelleyTxValidationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShelleyBasedEra era)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApplyTxErr (ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))))))
Show (TxValidationError era) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

type Rep (TxValidationError era) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.InMode

type Rep (TxValidationError era) = D1 ('MetaData "TxValidationError" "Cardano.Api.Consensus.Internal.InMode" "cardano-api-10.17.0.0-inplace" 'False) (C1 ('MetaCons "ByronTxValidationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApplyTxErr ByronBlock))) :+: C1 ('MetaCons "ShelleyTxValidationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShelleyBasedEra era)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApplyTxErr (ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))))))

Consensus protocol

data SomeBlockType where Source #

Constructors

SomeBlockType :: forall blk. BlockType blk -> SomeBlockType 

reflBlockType :: BlockType blk -> BlockType blk' -> Maybe (blk :~: blk') Source #

class (RunNode blk, IOLike m) => Protocol (m :: Type -> Type) blk where Source #

Associated Types

data ProtocolInfoArgs blk Source #

Instances

Instances details
IOLike m => Protocol m ByronBlockHFC Source #

Run PBFT against the Byron ledger

Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

(CardanoHardForkConstraints StandardCrypto, IOLike m) => Protocol m (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

(IOLike m, LedgerSupportsProtocol (ShelleyBlock (TPraos StandardCrypto) ShelleyEra)) => Protocol m (ShelleyBlockHFC (TPraos StandardCrypto) ShelleyEra) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

class RunNode blk => ProtocolClient blk where Source #

Node client support for each consensus protocol.

This is like Protocol but for clients of the node, so with less onerous requirements than to run a node.

Associated Types

data ProtocolClientInfoArgs blk Source #

Instances

Instances details
ProtocolClient ByronBlockHFC Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

CardanoHardForkConstraints StandardCrypto => ProtocolClient (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

LedgerSupportsProtocol (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) => ProtocolClient (ShelleyBlockHFC (TPraos StandardCrypto) ShelleyEra) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

Reexports from ouroboros-consensus

data ByronBlock Source #

Byron block

We cache two bits of information:

  • We cache the slot number as this is not readily available for EBBs. Having it cached allows us to e.g. give a HasHeader instance.
  • We cache the hash as this is expensive to compute and we need it often.

Instances

Instances details
Show ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ProtocolClient ByronBlockHFC Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

Eq ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ConvertRawHash ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

GetHeader ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

GetPrevHash ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Condense ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

HasHeader ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

IOLike m => Protocol m ByronBlockHFC Source #

Run PBFT against the Byron ledger

Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

SerialiseNodeToClient ByronBlock ByronPartialLedgerConfig 
Instance details

Defined in Ouroboros.Consensus.Byron.ByronHFC

StandardHash ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

ShowProxy ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

(CardanoHardForkConstraints StandardCrypto, IOLike m) => Protocol m (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

ShowProxy (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Generic (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Associated Types

type Rep (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

type Rep (Header ByronBlock) = D1 ('MetaData "Header" "Ouroboros.Consensus.Byron.Ledger.Block" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ByronHeader" 'PrefixI 'True) ((S1 ('MetaSel ('Just "byronHeaderRaw") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ABlockOrBoundaryHdr ByteString)) :*: S1 ('MetaSel ('Just "byronHeaderSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Just "byronHeaderHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronHash) :*: S1 ('MetaSel ('Just "byronHeaderBlockSizeHint") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SizeInBytes))))
Show (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

CardanoHardForkConstraints StandardCrypto => ProtocolClient (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

Eq (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

NoThunks (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

Methods

noThunks :: Context -> Header ByronBlock -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> Header ByronBlock -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (Header ByronBlock) -> String #

Condense (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

HasHeader (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

CardanoHardForkConstraints c => IndexedMemPack (LedgerState (HardForkBlock (CardanoEras c)) EmptyMK) (CardanoTxOut c) 
Instance details

Defined in Ouroboros.Consensus.Cardano.Ledger

data ProtocolClientInfoArgs ByronBlockHFC Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

data ProtocolInfoArgs ByronBlockHFC Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

data BlockConfig ByronBlock

Extended configuration we need for Byron

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type BlockProtocol ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.PBFT

newtype CodecConfig ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

data Header ByronBlock

Byron header

See ByronBlock for comments on why we cache certain values.

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

newtype StorageConfig ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type CannotForge ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Node

type ForgeStateInfo ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Node

type ForgeStateUpdateError ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Node

data NestedCtxt_ ByronBlock f a

Since the Byron header does not contain the size, we include it in the nested type instead.

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Serialisation

type TentativeHeaderState ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Node

type TentativeHeaderView ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Node

type HardForkIndices ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type PartialLedgerConfig ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.ByronHFC

type OtherHeaderEnvelopeError ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.HeaderValidation

type TipInfo ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.HeaderValidation

data LedgerState ByronBlock mk 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerUpdate ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Inspect

type LedgerWarning ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Inspect

data BlockQuery ByronBlock fp result 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type ApplyTxErr ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data GenTx ByronBlock

Generalized transactions in Byron

This is effectively the same as AMempoolPayload but we cache the transaction ID (a hash).

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type TxMeasure ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type BlockNodeToClientVersion ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.NetworkProtocolVersion

type BlockNodeToNodeVersion ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.NetworkProtocolVersion

type HeaderHash ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

type Rep (BlockConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (BlockConfig ByronBlock) = D1 ('MetaData "BlockConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ByronConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronGenesisConfig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Config) :*: (S1 ('MetaSel ('Just "byronProtocolVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtocolVersion) :*: S1 ('MetaSel ('Just "byronSoftwareVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SoftwareVersion))))
type Rep (CodecConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (CodecConfig ByronBlock) = D1 ('MetaData "CodecConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'True) (C1 ('MetaCons "ByronCodecConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "getByronEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EpochSlots)))
type Rep (Header ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Block

type Rep (Header ByronBlock) = D1 ('MetaData "Header" "Ouroboros.Consensus.Byron.Ledger.Block" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ByronHeader" 'PrefixI 'True) ((S1 ('MetaSel ('Just "byronHeaderRaw") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ABlockOrBoundaryHdr ByteString)) :*: S1 ('MetaSel ('Just "byronHeaderSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Just "byronHeaderHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronHash) :*: S1 ('MetaSel ('Just "byronHeaderBlockSizeHint") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SizeInBytes))))
type Rep (StorageConfig ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Config

type Rep (StorageConfig ByronBlock) = D1 ('MetaData "StorageConfig" "Ouroboros.Consensus.Byron.Ledger.Config" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'True) (C1 ('MetaCons "ByronStorageConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "getByronBlockConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BlockConfig ByronBlock))))
type Rep (Validated (GenTx ByronBlock)) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (Validated (GenTx ByronBlock)) = D1 ('MetaData "Validated" "Ouroboros.Consensus.Byron.Ledger.Mempool" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'True) (C1 ('MetaCons "ValidatedByronTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronBlock))))
type Rep (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data ProtocolClientInfoArgs (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

data ProtocolInfoArgs (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Api.Consensus.Internal.Protocol

type HardForkTxMeasure (CardanoEras c) 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

newtype CanonicalTxIn (CardanoEras c) 
Instance details

Defined in Ouroboros.Consensus.Cardano.Ledger

type HardForkTxOut (CardanoEras c) 
Instance details

Defined in Ouroboros.Consensus.Cardano.Ledger

newtype Validated (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type AuxLedgerEvent (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerCfg (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerErr (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data TxId (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type TxIn (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type TxOut (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock mk) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock mk) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronLedgerTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin BlockNo)) :*: (S1 ('MetaSel ('Just "byronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "byronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition))))
data Ticked (LedgerState ByronBlock) (mk :: MapKind)

The ticked Byron ledger state

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock) mk) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock) mk) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "TickedByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedByronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedByronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition)))
newtype CanonicalTxIn '[ByronBlock] 
Instance details

Defined in Ouroboros.Consensus.Byron.ByronHFC

type HardForkTxOut '[ByronBlock] 
Instance details

Defined in Ouroboros.Consensus.Byron.ByronHFC

type family ChainDepState p Source #

Protocol-specific state

NOTE: This chain is blockchain dependent, i.e., updated when new blocks come in (more precisely, new headers), and subject to rollback.

Instances

Instances details
type ChainDepState (HardForkProtocol xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

type ChainDepState (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type ChainDepState (Bft c) = ()
type ChainDepState (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type ChainDepState (Praos c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

type ChainDepState (TPraos c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type ChainDepState (ModChainSel p s) 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

data family GenTx blk Source #

Generalized transaction

The mempool (and, accordingly, blocks) consist of "generalized transactions"; this could be "proper" transactions (transferring funds) but also other kinds of things such as update proposals, delegations, etc.

Instances

Instances details
Inject GenTx 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject :: forall x (xs :: [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) => InjectionIndex xs x -> GenTx x -> GenTx (HardForkBlock xs) Source #

Isomorphic GenTx 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

Methods

project :: NoHardForks blk => GenTx (HardForkBlock '[blk]) -> GenTx blk Source #

inject :: NoHardForks blk => GenTx blk -> GenTx (HardForkBlock '[blk]) Source #

(Typeable m, Typeable a) => ShowProxy (GenTx (DualBlock m a) :: Type) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

(Typeable m, Typeable a) => ShowProxy (TxId (GenTx (DualBlock m a)) :: Type) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showProxy :: Proxy (TxId (GenTx (DualBlock m a))) -> String Source #

Bridge m a => Show (Validated (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Bridge m a => Show (GenTx (DualBlock m a)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Show (GenTxId m) => Show (TxId (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Eq (GenTxId m) => Eq (TxId (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

(==) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

(/=) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

Ord (GenTxId m) => Ord (TxId (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

compare :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Ordering Source #

(<) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

(<=) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

(>) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

(>=) :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> Bool Source #

max :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) Source #

min :: TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) -> TxId (GenTx (DualBlock m a)) Source #

NoThunks (Validated (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

noThunks :: Context -> Validated (GenTx (DualBlock m a)) -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> Validated (GenTx (DualBlock m a)) -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (Validated (GenTx (DualBlock m a))) -> String #

NoThunks (GenTx (DualBlock m a)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

noThunks :: Context -> GenTx (DualBlock m a) -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> GenTx (DualBlock m a) -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (GenTx (DualBlock m a)) -> String #

NoThunks (TxId (GenTx (DualBlock m a))) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

noThunks :: Context -> TxId (GenTx (DualBlock m a)) -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> TxId (GenTx (DualBlock m a)) -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (TxId (GenTx (DualBlock m a))) -> String #

Bridge m a => HasTxId (GenTx (DualBlock m a)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

txId :: GenTx (DualBlock m a) -> TxId (GenTx (DualBlock m a)) Source #

data GenTx ByronBlock

Generalized transactions in Byron

This is effectively the same as AMempoolPayload but we cache the transaction ID (a hash).

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type TranslationError era (GenTx :.: ShelleyBlock proto) 
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

type Rep (Validated (GenTx (HardForkBlock xs))) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep (Validated (GenTx (HardForkBlock xs))) = D1 ('MetaData "Validated" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.27.0.0-98d4bbbb4794985db6f0fbc4f516e4cbc877408de54ac32fbd1eed03abfeb508" 'True) (C1 ('MetaCons "HardForkValidatedGenTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "getHardForkValidatedGenTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraValidatedGenTx xs))))
type Rep (Validated (GenTx ByronBlock)) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (Validated (GenTx ByronBlock)) = D1 ('MetaData "Validated" "Ouroboros.Consensus.Byron.Ledger.Mempool" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'True) (C1 ('MetaCons "ValidatedByronTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronBlock))))
type Rep (Validated (GenTx (ShelleyBlock proto era))) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

type Rep (Validated (GenTx (ShelleyBlock proto era))) = D1 ('MetaData "Validated" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ShelleyValidatedTx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxId) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Validated (Tx era)))))
type Rep (GenTx (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep (GenTx (HardForkBlock xs)) = D1 ('MetaData "GenTx" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.27.0.0-98d4bbbb4794985db6f0fbc4f516e4cbc877408de54ac32fbd1eed03abfeb508" 'True) (C1 ('MetaCons "HardForkGenTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "getHardForkGenTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraGenTx xs))))
type Rep (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

type Rep (GenTx (ShelleyBlock proto era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

type Rep (GenTx (ShelleyBlock proto era)) = D1 ('MetaData "GenTx" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-cardano-0.25.1.0-582e32434684e3551683d7670b1accb15b237e2048628eacef46fe86e338c4c7" 'False) (C1 ('MetaCons "ShelleyTx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxId) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Tx era))))
type Rep (TxId (GenTx (HardForkBlock xs))) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

type Rep (TxId (GenTx (HardForkBlock xs))) = D1 ('MetaData "TxId" "Ouroboros.Consensus.HardFork.Combinator.Mempool" "ouroboros-consensus-0.27.0.0-98d4bbbb4794985db6f0fbc4f516e4cbc877408de54ac32fbd1eed03abfeb508" 'True) (C1 ('MetaCons "HardForkGenTxId" 'PrefixI 'True) (S1 ('MetaSel ('Just "getHardForkGenTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraGenTxId xs))))
newtype Validated (GenTx (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

data Validated (GenTx (DualBlock m a)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

newtype Validated (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

data Validated (GenTx (ShelleyBlock proto era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

newtype GenTx (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

newtype TxId (GenTx (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Mempool

newtype TxId (GenTx (DualBlock m a)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

data TxId (GenTx ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Mempool

newtype TxId (GenTx (ShelleyBlock proto era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

newtype TxId (GenTx (ShelleyBlock proto era)) = ShelleyTxId TxId
data GenTx (DualBlock m a) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

data GenTx (ShelleyBlock proto era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool

data GenTx (ShelleyBlock proto era) = ShelleyTx !TxId !(Tx era)

data EraMismatch Source #

Extra info for errors caused by applying a block, header, transaction, or query from one era to a ledger from a different era.

Constructors

EraMismatch 

Fields

Instances

Instances details
Generic EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

Associated Types

type Rep EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

type Rep EraMismatch = D1 ('MetaData "EraMismatch" "Ouroboros.Consensus.HardFork.Combinator.AcrossEras" "ouroboros-consensus-0.27.0.0-98d4bbbb4794985db6f0fbc4f516e4cbc877408de54ac32fbd1eed03abfeb508" 'False) (C1 ('MetaCons "EraMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "ledgerEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "otherEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))
Show EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

Eq EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

type Rep EraMismatch 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.AcrossEras

type Rep EraMismatch = D1 ('MetaData "EraMismatch" "Ouroboros.Consensus.HardFork.Combinator.AcrossEras" "ouroboros-consensus-0.27.0.0-98d4bbbb4794985db6f0fbc4f516e4cbc877408de54ac32fbd1eed03abfeb508" 'False) (C1 ('MetaCons "EraMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "ledgerEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "otherEraName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))

data PastHorizonException Source #

We tried to convert something that is past the horizon

That is, we tried to convert something that is past the point in time beyond which we lack information due to uncertainty about the next hard fork.

class ConsensusProtocol p => PraosProtocolSupportsNode p Source #

The node has Praos-aware code that inspects nonces in order to support some Cardano API queries that are crucial to the user exprience

The interface being used for that has grown and needs review, but we're adding to it here under time pressure. See https://github.com/IntersectMBO/cardano-node/issues/3864

Minimal complete definition

getPraosNonces, getOpCertCounters

data ShelleyGenesisStaking Source #

Genesis Shelley staking configuration.

This allows us to configure some initial stake pools and delegation to them, in order to test Praos in a static configuration, without requiring on-chain registration and delegation.

For simplicity, pools defined in the genesis staking do not pay deposits for their registration.

Constructors

ShelleyGenesisStaking 

Fields

  • sgsPools :: ListMap (KeyHash 'StakePool) PoolParams

    Pools to register

    The key in this map is the hash of the public key of the _pool_. This need not correspond to any payment or staking key, but must correspond to the cold key held by TPraosIsCoreNode.

  • sgsStake :: ListMap (KeyHash 'Staking) (KeyHash 'StakePool)

    Stake-holding key hash credentials and the pools to delegate that stake to. We require the raw staking key hash in order to:

    • Avoid pointer addresses, which would be tricky when there's no slot or transaction to point to.
    • Avoid script credentials.

Instances

Instances details
FromJSON ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

ToJSON ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Monoid ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Semigroup ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ShelleyGenesisStaking = D1 ('MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.16.0.0-c94e4acbae2c451b736d7fa131482fce1d6ffd0e83dcc66450421e4714554169" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'StakePool) PoolParams)) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'Staking) (KeyHash 'StakePool)))))
Show ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

DecCBOR ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

EncCBOR ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Eq ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

NoThunks ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

noThunks :: Context -> ShelleyGenesisStaking -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> ShelleyGenesisStaking -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy ShelleyGenesisStaking -> String #

type Rep ShelleyGenesisStaking 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ShelleyGenesisStaking = D1 ('MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.16.0.0-c94e4acbae2c451b736d7fa131482fce1d6ffd0e83dcc66450421e4714554169" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'StakePool) PoolParams)) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'Staking) (KeyHash 'StakePool)))))

interpreterToEpochInfo :: forall (xs :: [Type]). Interpreter xs -> EpochInfo (Except PastHorizonException) Source #

Construct an EpochInfo for a snapshot of the ledger state

unsafeExtendSafeZone :: forall (xs :: [Type]). Interpreter xs -> Interpreter xs Source #

UNSAFE: extend the safe zone of the current era of the given Interpreter to be unbounded, ignoring any future hard forks.

This only has effect when the Interpreter was obtained in an era that was not the final one (in the final era, this is a no-op). The Interpreter will be made to believe that the current era is the final era, making its horizon unbounded, and thus never returning a PastHorizonException.

Use of this function is strongly discouraged, as it will ignore any future hard forks, and the results produced by the Interpreter can thus be incorrect.

txId :: HasTxId tx => tx -> TxId tx Source #

Return the TxId of a GenTx.

NOTE: a TxId must be unique up to ledger rules, i.e., two GenTxs with the same TxId must be the same transaction according to the ledger. However, we do not assume that a TxId uniquely determines a GenTx: two GenTxs with the same TxId can differ in, e.g., witnesses.

Should be cheap as this will be called often.