Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype ApplyTxError era = ApplyTxError [ PredicateFailure ( EraRule "LEDGER" era)]
- data family BlockQuery blk :: Type -> Type
- data family GenTx blk
- data family TxId tx
- data family Validated x
- data family LedgerState blk
- data family BlockConfig blk
- data family CodecConfig blk
- data family StorageConfig blk
- data family Header blk
-
class
HasHeader
(
Header
blk) =>
GetHeader
blk
where
- getHeader :: blk -> Header blk
- blockMatchesHeader :: Header blk -> blk -> Bool
- headerIsEBB :: Header blk -> Maybe EpochNo
- data family NestedCtxt_ blk :: ( Type -> Type ) -> Type -> Type
- data family Ticked st
- class ( ShelleyBasedEra era, GetLedgerView era, State ( EraRule "PPUP" era) ~ PPUPState era, Default ( State ( EraRule "PPUP" era)), HasField "_maxBBSize" ( PParams era) Natural , HasField "_maxBHSize" ( PParams era) Natural , HasField "_maxTxSize" ( PParams era) Natural , HasField "_a0" ( PParams era) NonNegativeInterval , HasField "_nOpt" ( PParams era) Natural , HasField "_rho" ( PParams era) UnitInterval , HasField "_tau" ( PParams era) UnitInterval , ValidateScript era, FromCBOR ( PParams era), ToCBOR ( PParams era), HasField "_protocolVersion" ( PParamsDelta era) ( StrictMaybe ProtVer ), FromCBOR ( PParamsDelta era), AdditionalGenesisConfig era ~ TranslationContext era, ToCBORGroup ( TxSeq era), NoThunks ( TranslationContext era), FromCBOR ( Annotator ( Witnesses era)), ToCBOR ( Witnesses era), Eq ( TxSeq era), Show ( TxSeq era), FromCBOR ( Annotator ( TxSeq era))) => ShelleyBasedEra era
- verifyHeaderIntegrity :: ProtocolHeaderSupportsKES proto => Word64 -> ShelleyProtocolHeader proto -> Bool
-
newtype
ShelleyHash
crypto =
ShelleyHash
{
- unShelleyHash :: Hash crypto EraIndependentBlockHeader
-
data
ShelleyBlock
proto era =
ShelleyBlock
{
- shelleyBlockRaw :: !( Block ( ShelleyProtocolHeader proto) era)
- shelleyBlockHeaderHash :: !( ShelleyHash ( ProtoCrypto proto))
- class ( ShelleyBasedEra era, ShelleyProtocol proto, Eq ( ShelleyProtocolHeader proto), Show ( ShelleyProtocolHeader proto), NoThunks ( ShelleyProtocolHeader proto), ToCBOR ( ShelleyProtocolHeader proto), FromCBOR ( Annotator ( ShelleyProtocolHeader proto)), Show ( CannotForgeError proto), SelectView proto ~ PraosChainSelectView ( EraCrypto era), SignedHeader ( ShelleyProtocolHeader proto), DecodeDisk ( ShelleyBlock proto era) ( ChainDepState proto), EncodeDisk ( ShelleyBlock proto era) ( ChainDepState proto), EraCrypto era ~ ProtoCrypto proto, HasPartialConsensusConfig proto) => ShelleyCompatible proto era
- mkShelleyBlock :: ShelleyCompatible proto era => Block ( ShelleyProtocolHeader proto) era -> ShelleyBlock proto era
- mkShelleyHeader :: ShelleyCompatible proto era => ShelleyProtocolHeader proto -> Header ( ShelleyBlock proto era)
- fromShelleyPrevHash :: EraCrypto era ~ ProtoCrypto proto => PrevHash ( EraCrypto era) -> ChainHash ( ShelleyBlock proto era)
- toShelleyPrevHash :: EraCrypto era ~ ProtoCrypto proto => ChainHash ( Header ( ShelleyBlock proto era)) -> PrevHash ( EraCrypto era)
- encodeShelleyBlock :: ShelleyCompatible proto era => ShelleyBlock proto era -> Encoding
- decodeShelleyBlock :: ShelleyCompatible proto era => Decoder s ( ByteString -> ShelleyBlock proto era)
- shelleyBinaryBlockInfo :: ShelleyCompatible proto era => ShelleyBlock proto era -> BinaryBlockInfo
- encodeShelleyHeader :: ShelleyCompatible proto era => Header ( ShelleyBlock proto era) -> Encoding
- decodeShelleyHeader :: ShelleyCompatible proto era => Decoder s ( ByteString -> Header ( ShelleyBlock proto era))
- data ShelleyNodeToClientVersion
- data ShelleyNodeToNodeVersion = ShelleyNodeToNodeVersion1
- verifyBlockIntegrity :: ShelleyCompatible proto era => Word64 -> ShelleyBlock proto era -> Bool
- data CompactGenesis era
- mkShelleyBlockConfig :: ShelleyBasedEra era => ProtVer -> ShelleyGenesis era -> [ VKey ' BlockIssuer ( EraCrypto era)] -> BlockConfig ( ShelleyBlock proto era)
- compactGenesis :: ShelleyGenesis era -> CompactGenesis era
- data ShelleyReapplyException = forall era. Show ( BlockTransitionError era) => ShelleyReapplyException ( BlockTransitionError era)
-
data
ShelleyLedgerEvent
era
- = ShelleyLedgerEventBBODY ( Event ( EraRule "BBODY" era))
- | ShelleyLedgerEventTICK ( Event ( EraRule "TICK" era))
- newtype ShelleyTransition = ShelleyTransitionInfo { }
-
data
ShelleyTip
proto era =
ShelleyTip
{
- shelleyTipSlotNo :: ! SlotNo
- shelleyTipBlockNo :: ! BlockNo
- shelleyTipHash :: !( HeaderHash ( ShelleyBlock proto era))
-
data
ShelleyLedgerConfig
era =
ShelleyLedgerConfig
{
- shelleyLedgerCompactGenesis :: !( CompactGenesis era)
- shelleyLedgerGlobals :: ! Globals
- shelleyLedgerTranslationContext :: !( TranslationContext era)
- newtype ShelleyLedgerError era = BBodyError ( BlockTransitionError era)
- shelleyLedgerGenesis :: ShelleyLedgerConfig era -> ShelleyGenesis era
- shelleyEraParams :: ShelleyGenesis era -> EraParams
- shelleyEraParamsNeverHardForks :: ShelleyGenesis era -> EraParams
- mkShelleyLedgerConfig :: ShelleyGenesis era -> TranslationContext era -> EpochInfo ( Except PastHorizonException ) -> MaxMajorProtVer -> ShelleyLedgerConfig era
- shelleyTipToPoint :: WithOrigin ( ShelleyTip proto era) -> Point ( ShelleyBlock proto era)
- castShelleyTip :: HeaderHash ( ShelleyBlock proto era) ~ HeaderHash ( ShelleyBlock proto' era') => ShelleyTip proto era -> ShelleyTip proto' era'
- shelleyLedgerTipPoint :: LedgerState ( ShelleyBlock proto era) -> Point ( ShelleyBlock proto era)
- getPParams :: NewEpochState era -> PParams era
- encodeShelleyAnnTip :: ShelleyCompatible proto era => AnnTip ( ShelleyBlock proto era) -> Encoding
- decodeShelleyAnnTip :: ShelleyCompatible proto era => Decoder s ( AnnTip ( ShelleyBlock proto era))
- encodeShelleyHeaderState :: ShelleyCompatible proto era => HeaderState ( ShelleyBlock proto era) -> Encoding
- encodeShelleyLedgerState :: ShelleyCompatible proto era => LedgerState ( ShelleyBlock proto era) -> Encoding
- decodeShelleyLedgerState :: forall era proto s. ShelleyCompatible proto era => Decoder s ( LedgerState ( ShelleyBlock proto era))
-
newtype
NonMyopicMemberRewards
c =
NonMyopicMemberRewards
{
- unNonMyopicMemberRewards :: Map ( Either Coin ( Credential ' Staking c)) ( Map ( KeyHash ' StakePool c) Coin )
- querySupportedVersion :: BlockQuery ( ShelleyBlock proto era) result -> ShelleyNodeToClientVersion -> Bool
- encodeShelleyQuery :: ShelleyBasedEra era => BlockQuery ( ShelleyBlock proto era) result -> Encoding
- decodeShelleyQuery :: ShelleyBasedEra era => Decoder s ( SomeSecond BlockQuery ( ShelleyBlock proto era))
- encodeShelleyResult :: ShelleyCompatible proto era => BlockQuery ( ShelleyBlock proto era) result -> result -> Encoding
- decodeShelleyResult :: ShelleyCompatible proto era => BlockQuery ( ShelleyBlock proto era) result -> forall s. Decoder s result
- data WithTop a
- data AlonzoMeasure = AlonzoMeasure { }
- fixedBlockBodyOverhead :: Num a => a
- perTxOverhead :: Num a => a
- mkShelleyTx :: forall era proto. ShelleyBasedEra era => Tx era -> GenTx ( ShelleyBlock proto era)
- mkShelleyValidatedTx :: forall era proto. ShelleyBasedEra era => Validated ( Tx era) -> Validated ( GenTx ( ShelleyBlock proto era))
- fromExUnits :: ExUnits -> ExUnits' ( WithTop Natural )
- forgeShelleyBlock :: forall m era proto. ( ShelleyCompatible proto era, TxLimits ( ShelleyBlock proto era), Monad m) => HotKey ( EraCrypto era) m -> CanBeLeader proto -> TopLevelConfig ( ShelleyBlock proto era) -> Overrides ( ShelleyBlock proto era) -> BlockNo -> SlotNo -> TickedLedgerState ( ShelleyBlock proto era) -> [ Validated ( GenTx ( ShelleyBlock proto era))] -> IsLeader proto -> m ( ShelleyBlock proto era)
Documentation
newtype ApplyTxError era Source #
ApplyTxError [ PredicateFailure ( EraRule "LEDGER" era)] |
Instances
data family BlockQuery blk :: Type -> Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
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
A generalized transaction,
GenTx
, identifier.
Instances
data family Validated x Source #
" Validated " transaction or block
The ledger defines how to validate transactions and blocks. It's possible the type before and after validation may be distinct (eg Alonzo transactions), which originally motivated this family.
We also gain the related benefit that certain interface functions, such as those that reapply blocks, can have a more precise type now. TODO
Similarly, the Node-to-Client mini protocols can explicitly indicate that the
client trusts the blocks from the local server, by having the server send
Validated
blocks to the client. TODO
Note that validation has different implications for a transaction than for a block. In particular, a validated transaction can be " reapplied " to different ledger states, whereas a validated block must only be " reapplied " to the exact same ledger state (eg as part of rebuilding from an on-disk ledger snapshot).
Since the ledger defines validation, see the ledger details for concrete
examples of what determines the validity (wrt to a
LedgerState
) of a
transaction and/or block. Example properties include: a transaction's claimed
inputs exist and are still unspent, a block carries a sufficient
cryptographic signature, etc.
Instances
data family LedgerState blk Source #
Ledger state associated with a block
Instances
data family BlockConfig blk Source #
Static configuration required to work with this type of blocks
Instances
data family CodecConfig blk Source #
Static configuration required for serialisation and deserialisation of types pertaining to this type of block.
Data family instead of type family to get better type inference.
Instances
data family StorageConfig blk Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
Instances
data family Header blk Source #
Instances
class HasHeader ( Header blk) => GetHeader blk where Source #
getHeader :: blk -> Header blk Source #
blockMatchesHeader :: Header blk -> blk -> Bool Source #
Check whether the header is the header of the block.
For example, by checking whether the hash of the body stored in the header matches that of the block.
headerIsEBB :: Header blk -> Maybe EpochNo Source #
When the given header is the header of an Epoch Boundary Block, returns its epoch number.
Instances
ShelleyCompatible proto era => GetHeader ( ShelleyBlock proto era) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Block getHeader :: ShelleyBlock proto era -> Header ( ShelleyBlock proto era) Source # blockMatchesHeader :: Header ( ShelleyBlock proto era) -> ShelleyBlock proto era -> Bool Source # headerIsEBB :: Header ( ShelleyBlock proto era) -> Maybe EpochNo Source # |
data family NestedCtxt_ blk :: ( Type -> Type ) -> Type -> Type Source #
Context identifying what kind of block we have
In almost all places we will use
NestedCtxt
rather than
NestedCtxt_
.
Instances
data family Ticked st Source #
" Ticked " piece of state (
LedgerState
,
LedgerView
,
ChainIndepState
)
Ticking refers to the passage of time (the ticking of the clock). When a piece of state is marked as ticked, it means that time-related changes have been applied to the state (or forecast).
Some examples of time related changes:
- Scheduled delegations might have been applied in Byron
- New leader schedule computed for Shelley
- Transition from Byron to Shelley activated in the hard fork combinator.
- Nonces switched out at the start of a new epoch.
Instances
class ( ShelleyBasedEra era, GetLedgerView era, State ( EraRule "PPUP" era) ~ PPUPState era, Default ( State ( EraRule "PPUP" era)), HasField "_maxBBSize" ( PParams era) Natural , HasField "_maxBHSize" ( PParams era) Natural , HasField "_maxTxSize" ( PParams era) Natural , HasField "_a0" ( PParams era) NonNegativeInterval , HasField "_nOpt" ( PParams era) Natural , HasField "_rho" ( PParams era) UnitInterval , HasField "_tau" ( PParams era) UnitInterval , ValidateScript era, FromCBOR ( PParams era), ToCBOR ( PParams era), HasField "_protocolVersion" ( PParamsDelta era) ( StrictMaybe ProtVer ), FromCBOR ( PParamsDelta era), AdditionalGenesisConfig era ~ TranslationContext era, ToCBORGroup ( TxSeq era), NoThunks ( TranslationContext era), FromCBOR ( Annotator ( Witnesses era)), ToCBOR ( Witnesses era), Eq ( TxSeq era), Show ( TxSeq era), FromCBOR ( Annotator ( TxSeq era))) => ShelleyBasedEra era Source #
The ledger already defines
ShelleyBasedEra
as
the
top-level
constraint on an era, however, consensus often needs some more functionality
than the ledger currently provides.
Either the functionality shouldn't or can't live in the ledger, in which case
it can be part and remain part of
ShelleyBasedEra
. Or, the functionality
should
live in the ledger, but hasn't yet been added to the ledger, or it
hasn't yet been propagated to this repository, in which case it can be added
to this class until that is the case.
By having the same name as the class defined in ledger, we can, if this class becomes redundant, switch to the ledger-defined one without having to update all the code using it. We can just export the right one from this module.
TODO Currently we include some constraints on the update state which are needed to determine the hard fork point. In the future this should be replaced with an appropriate API - see https://github.com/input-output-hk/ouroboros-network/issues/2890
Instances
verifyHeaderIntegrity Source #
:: ProtocolHeaderSupportsKES proto | |
=> Word64 |
Slots per KES period |
-> ShelleyProtocolHeader proto | |
-> Bool |
Verify that the signature on a header is correct and valid.
newtype ShelleyHash crypto Source #
Instances
data ShelleyBlock proto era Source #
Shelley-based block type.
This block is parametrised over both the (ledger) era and the protocol.
ShelleyBlock | |
|
Instances
class ( ShelleyBasedEra era, ShelleyProtocol proto, Eq ( ShelleyProtocolHeader proto), Show ( ShelleyProtocolHeader proto), NoThunks ( ShelleyProtocolHeader proto), ToCBOR ( ShelleyProtocolHeader proto), FromCBOR ( Annotator ( ShelleyProtocolHeader proto)), Show ( CannotForgeError proto), SelectView proto ~ PraosChainSelectView ( EraCrypto era), SignedHeader ( ShelleyProtocolHeader proto), DecodeDisk ( ShelleyBlock proto era) ( ChainDepState proto), EncodeDisk ( ShelleyBlock proto era) ( ChainDepState proto), EraCrypto era ~ ProtoCrypto proto, HasPartialConsensusConfig proto) => ShelleyCompatible proto era Source #
Instances
PraosCrypto c => ShelleyCompatible ( Praos c) ( BabbageEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
|
( PraosCrypto c, PraosCrypto c) => ShelleyCompatible ( TPraos c) ( BabbageEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
|
( PraosCrypto c, Signable ( DSIGN c) ( Hash ( HASH c) EraIndependentTxBody )) => ShelleyCompatible ( TPraos c) ( AlonzoEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
|
( PraosCrypto c, Signable ( DSIGN c) ( Hash ( HASH c) EraIndependentTxBody )) => ShelleyCompatible ( TPraos c) ( MaryEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
|
( PraosCrypto c, Signable ( DSIGN c) ( Hash ( HASH c) EraIndependentTxBody )) => ShelleyCompatible ( TPraos c) ( AllegraEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
|
( PraosCrypto c, Signable ( DSIGN c) ( Hash ( HASH c) EraIndependentTxBody )) => ShelleyCompatible ( TPraos c) ( ShelleyEra c) Source # | |
Defined in Ouroboros.Consensus.Shelley.HFEras |
mkShelleyBlock :: ShelleyCompatible proto era => Block ( ShelleyProtocolHeader proto) era -> ShelleyBlock proto era Source #
mkShelleyHeader :: ShelleyCompatible proto era => ShelleyProtocolHeader proto -> Header ( ShelleyBlock proto era) Source #
fromShelleyPrevHash :: EraCrypto era ~ ProtoCrypto proto => PrevHash ( EraCrypto era) -> ChainHash ( ShelleyBlock proto era) Source #
From
cardano-ledger-specs
to
ouroboros-consensus
toShelleyPrevHash :: EraCrypto era ~ ProtoCrypto proto => ChainHash ( Header ( ShelleyBlock proto era)) -> PrevHash ( EraCrypto era) Source #
From
ouroboros-consensus
to
cardano-ledger-specs
encodeShelleyBlock :: ShelleyCompatible proto era => ShelleyBlock proto era -> Encoding Source #
decodeShelleyBlock :: ShelleyCompatible proto era => Decoder s ( ByteString -> ShelleyBlock proto era) Source #
shelleyBinaryBlockInfo :: ShelleyCompatible proto era => ShelleyBlock proto era -> BinaryBlockInfo Source #
encodeShelleyHeader :: ShelleyCompatible proto era => Header ( ShelleyBlock proto era) -> Encoding Source #
decodeShelleyHeader :: ShelleyCompatible proto era => Decoder s ( ByteString -> Header ( ShelleyBlock proto era)) Source #
data ShelleyNodeToClientVersion Source #
ShelleyNodeToClientVersion1 | |
ShelleyNodeToClientVersion2 |
New queries introduced |
ShelleyNodeToClientVersion3 |
New query introduced |
ShelleyNodeToClientVersion4 |
New queries introduced |
ShelleyNodeToClientVersion5 |
New queries introduced: GetRewardInfoPools |
Instances
data ShelleyNodeToNodeVersion Source #
Instances
verifyBlockIntegrity :: ShelleyCompatible proto era => Word64 -> ShelleyBlock proto era -> Bool Source #
Verifies whether the block is not corrupted by checking its signature and witnesses.
data CompactGenesis era Source #
Compact variant of
ShelleyGenesis
with some fields erased that are
only used on start-up and that should not be kept in memory forever.
Concretely:
-
The
sgInitialFunds
field is erased. It is only used to set up the initial UTxO in tests and testnets. -
The
sgStaking
field is erased. It is only used to register initial stake pools in tests and benchmarks.
Instances
mkShelleyBlockConfig :: ShelleyBasedEra era => ProtVer -> ShelleyGenesis era -> [ VKey ' BlockIssuer ( EraCrypto era)] -> BlockConfig ( ShelleyBlock proto era) Source #
compactGenesis :: ShelleyGenesis era -> CompactGenesis era Source #
Compacts the given
ShelleyGenesis
.
data ShelleyReapplyException Source #
forall era. Show ( BlockTransitionError era) => ShelleyReapplyException ( BlockTransitionError era) |
Instances
data ShelleyLedgerEvent era Source #
All events emitted by the Shelley ledger API
ShelleyLedgerEventBBODY ( Event ( EraRule "BBODY" era)) |
An event emitted when (re)applying a block |
ShelleyLedgerEventTICK ( Event ( EraRule "TICK" era)) |
An event emitted during the chain tick |
newtype ShelleyTransition Source #
Information required to determine the hard fork point from Shelley to the next ledger
ShelleyTransitionInfo | |
|
Instances
data ShelleyTip proto era Source #
ShelleyTip | |
|
Instances
data ShelleyLedgerConfig era Source #
ShelleyLedgerConfig | |
|
Instances
newtype ShelleyLedgerError era Source #
BBodyError ( BlockTransitionError era) |
Instances
shelleyLedgerGenesis :: ShelleyLedgerConfig era -> ShelleyGenesis era Source #
shelleyEraParams :: ShelleyGenesis era -> EraParams Source #
shelleyEraParamsNeverHardForks :: ShelleyGenesis era -> EraParams Source #
Separate variant of
shelleyEraParams
to be used for a Shelley-only chain.
mkShelleyLedgerConfig :: ShelleyGenesis era -> TranslationContext era -> EpochInfo ( Except PastHorizonException ) -> MaxMajorProtVer -> ShelleyLedgerConfig era Source #
shelleyTipToPoint :: WithOrigin ( ShelleyTip proto era) -> Point ( ShelleyBlock proto era) Source #
castShelleyTip :: HeaderHash ( ShelleyBlock proto era) ~ HeaderHash ( ShelleyBlock proto' era') => ShelleyTip proto era -> ShelleyTip proto' era' Source #
shelleyLedgerTipPoint :: LedgerState ( ShelleyBlock proto era) -> Point ( ShelleyBlock proto era) Source #
getPParams :: NewEpochState era -> PParams era Source #
encodeShelleyAnnTip :: ShelleyCompatible proto era => AnnTip ( ShelleyBlock proto era) -> Encoding Source #
decodeShelleyAnnTip :: ShelleyCompatible proto era => Decoder s ( AnnTip ( ShelleyBlock proto era)) Source #
encodeShelleyHeaderState :: ShelleyCompatible proto era => HeaderState ( ShelleyBlock proto era) -> Encoding Source #
encodeShelleyLedgerState :: ShelleyCompatible proto era => LedgerState ( ShelleyBlock proto era) -> Encoding Source #
decodeShelleyLedgerState :: forall era proto s. ShelleyCompatible proto era => Decoder s ( LedgerState ( ShelleyBlock proto era)) Source #
newtype NonMyopicMemberRewards c Source #
NonMyopicMemberRewards | |
|
Instances
Eq ( NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query (==) :: NonMyopicMemberRewards c -> NonMyopicMemberRewards c -> Bool Source # (/=) :: NonMyopicMemberRewards c -> NonMyopicMemberRewards c -> Bool Source # |
|
Show ( NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query |
|
Crypto c => Serialise ( NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query encode :: NonMyopicMemberRewards c -> Encoding Source # decode :: Decoder s ( NonMyopicMemberRewards c) Source # encodeList :: [ NonMyopicMemberRewards c] -> Encoding Source # decodeList :: Decoder s [ NonMyopicMemberRewards c] Source # |
querySupportedVersion :: BlockQuery ( ShelleyBlock proto era) result -> ShelleyNodeToClientVersion -> Bool Source #
Is the given query supported by the given
ShelleyNodeToClientVersion
?
encodeShelleyQuery :: ShelleyBasedEra era => BlockQuery ( ShelleyBlock proto era) result -> Encoding Source #
decodeShelleyQuery :: ShelleyBasedEra era => Decoder s ( SomeSecond BlockQuery ( ShelleyBlock proto era)) Source #
encodeShelleyResult :: ShelleyCompatible proto era => BlockQuery ( ShelleyBlock proto era) result -> result -> Encoding Source #
decodeShelleyResult :: ShelleyCompatible proto era => BlockQuery ( ShelleyBlock proto era) result -> forall s. Decoder s result Source #
Add a unique top element to a lattice.
TODO This should be relocated to `cardano-base:Data.Measure'.
Instances
Eq a => Eq ( WithTop a) Source # | |
Ord a => Ord ( WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool |
|
Show a => Show ( WithTop a) Source # | |
Generic ( WithTop a) Source # | |
Measure a => BoundedMeasure ( WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool |
|
Measure a => Measure ( WithTop a) Source # | |
type Rep ( WithTop a) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Mempool
type
Rep
(
WithTop
a) =
D1
('
MetaData
"WithTop" "Ouroboros.Consensus.Shelley.Ledger.Mempool" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" '
False
) (
C1
('
MetaCons
"NotTop" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
a))
:+:
C1
('
MetaCons
"Top" '
PrefixI
'
False
) (
U1
::
Type
->
Type
))
|
data AlonzoMeasure Source #
Instances
fixedBlockBodyOverhead :: Num a => a Source #
txInBlockSize
is used to estimate how many transactions we can grab from
the Mempool to put into the block we are going to forge without exceeding
the maximum block body size according to the ledger. If we exceed that
limit, we will have forged a block that is invalid according to the ledger.
We ourselves won't even adopt it, causing us to lose our slot, something we
must try to avoid.
For this reason it is better to overestimate the size of a transaction than to underestimate. The only downside is that we maybe could have put one (or more?) transactions extra in that block.
As the sum of the serialised transaction sizes is not equal to the size of
the serialised block body (
TxSeq
) consisting of those transactions
(see cardano-node#1545 for an example), we account for some extra overhead
per transaction as a safety margin.
Also see
perTxOverhead
.
perTxOverhead :: Num a => a Source #
See
fixedBlockBodyOverhead
.
mkShelleyTx :: forall era proto. ShelleyBasedEra era => Tx era -> GenTx ( ShelleyBlock proto era) Source #
mkShelleyValidatedTx :: forall era proto. ShelleyBasedEra era => Validated ( Tx era) -> Validated ( GenTx ( ShelleyBlock proto era)) Source #
:: forall m era proto. ( ShelleyCompatible proto era, TxLimits ( ShelleyBlock proto era), Monad m) | |
=> HotKey ( EraCrypto era) m | |
-> CanBeLeader proto | |
-> TopLevelConfig ( ShelleyBlock proto era) | |
-> Overrides ( ShelleyBlock proto era) |
How to override max tx capacity defined by ledger |
-> BlockNo |
Current block number |
-> SlotNo |
Current slot number |
-> TickedLedgerState ( ShelleyBlock proto era) |
Current ledger |
-> [ Validated ( GenTx ( ShelleyBlock proto era))] |
Txs to add in the block |
-> IsLeader proto | |
-> m ( ShelleyBlock proto era) |