Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data family TxId tx
- data family Header blk
- data family LedgerState blk
- data ShelleyLedgerEvent era
- = ShelleyLedgerEventBBODY (Event (EraRule "BBODY" era))
- | ShelleyLedgerEventTICK (Event (EraRule "TICK" era))
- newtype ApplyTxError era = ApplyTxError (NonEmpty (PredicateFailure (EraRule "LEDGER" era)))
- data family Validated x
- class HasHeader (Header blk) ⇒ GetHeader blk where
- getHeader ∷ blk → Header blk
- blockMatchesHeader ∷ Header blk → blk → Bool
- headerIsEBB ∷ Header blk → Maybe EpochNo
- data family StorageConfig blk
- data family CodecConfig blk
- data family BlockConfig blk
- data family Ticked st
- data family GenTx blk
- data family NestedCtxt_ blk ∷ (Type → Type) → Type → Type
- data family BlockQuery blk ∷ Type → Type
- 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), EncCBOR (ShelleyProtocolHeader proto), DecCBOR (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, DecCBOR (PState era), FromCBOR (LegacyPParams era), ToCBOR (LegacyPParams era)) ⇒ ShelleyCompatible proto era
- class (ShelleyCompatible (BlockProtocol blk) (ShelleyBlockLedgerEra blk), blk ~ ShelleyBlock (BlockProtocol blk) (ShelleyBlockLedgerEra blk)) ⇒ IsShelleyBlock blk
- type family ShelleyBlockLedgerEra blk where ...
- class (EraSegWits era, EraGov era, ApplyTx era, ApplyBlock era, EraTransition era, GetLedgerView era, NoThunks (StashedAVVMAddresses era), EncCBOR (StashedAVVMAddresses era), DecCBOR (StashedAVVMAddresses era), Show (StashedAVVMAddresses era), Eq (StashedAVVMAddresses era), DecCBOR (PredicateFailure (EraRule "LEDGER" era)), EncCBOR (PredicateFailure (EraRule "LEDGER" era)), DecCBOR (PredicateFailure (EraRule "UTXOW" era)), EncCBOR (PredicateFailure (EraRule "UTXOW" era)), DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (TranslationContext era)) ⇒ ShelleyBasedEra era
- newtype ShelleyHash crypto = ShelleyHash {
- unShelleyHash ∷ Hash crypto EraIndependentBlockHeader
- data CompactGenesis c
- newtype ShelleyLedgerError era = BBodyError (BlockTransitionError era)
- data ShelleyTip proto era = ShelleyTip {
- shelleyTipSlotNo ∷ !SlotNo
- shelleyTipBlockNo ∷ !BlockNo
- shelleyTipHash ∷ !(HeaderHash (ShelleyBlock proto era))
- newtype ShelleyTransition = ShelleyTransitionInfo {}
- data ShelleyLedgerConfig era = ShelleyLedgerConfig {}
- data ShelleyReapplyException = ∀ era.Show (BlockTransitionError era) ⇒ ShelleyReapplyException (BlockTransitionError era)
- data AlonzoMeasure = AlonzoMeasure {
- byteSize ∷ !(IgnoringOverflow ByteSize32)
- exUnits ∷ !(ExUnits' Natural)
- data ConwayMeasure = ConwayMeasure {}
- data ShelleyNodeToClientVersion
- = ShelleyNodeToClientVersion1
- | ShelleyNodeToClientVersion2
- | ShelleyNodeToClientVersion3
- | ShelleyNodeToClientVersion4
- | ShelleyNodeToClientVersion5
- | ShelleyNodeToClientVersion6
- | ShelleyNodeToClientVersion7
- | ShelleyNodeToClientVersion8
- | ShelleyNodeToClientVersion9
- | ShelleyNodeToClientVersion10
- | ShelleyNodeToClientVersion11
- data ShelleyNodeToNodeVersion = ShelleyNodeToNodeVersion1
- newtype NonMyopicMemberRewards c = NonMyopicMemberRewards {
- unNonMyopicMemberRewards ∷ Map (Either Coin (Credential 'Staking c)) (Map (KeyHash 'StakePool c) Coin)
- data StakeSnapshot crypto = StakeSnapshot {}
- data StakeSnapshots crypto = StakeSnapshots {
- ssStakeSnapshots ∷ !(Map (KeyHash 'StakePool crypto) (StakeSnapshot crypto))
- ssMarkTotal ∷ !Coin
- ssSetTotal ∷ !Coin
- ssGoTotal ∷ !Coin
- verifyBlockIntegrity ∷ ShelleyCompatible proto era ⇒ Word64 → ShelleyBlock proto era → Bool
- verifyHeaderIntegrity ∷ ProtocolHeaderSupportsKES proto ⇒ Word64 → ShelleyProtocolHeader proto → Bool
- mkShelleyBlock ∷ ShelleyCompatible proto era ⇒ Block (ShelleyProtocolHeader proto) era → ShelleyBlock proto era
- mkShelleyHeader ∷ ShelleyCompatible proto era ⇒ ShelleyProtocolHeader proto → Header (ShelleyBlock proto era)
- decodeShelleyBlock ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ∀ s. Decoder s (ByteString → ShelleyBlock proto era)
- decodeShelleyHeader ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ∀ s. Decoder s (ByteString → Header (ShelleyBlock proto era))
- encodeShelleyBlock ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ShelleyBlock proto era → Encoding
- encodeShelleyHeader ∷ ∀ proto era. ShelleyCompatible proto era ⇒ Header (ShelleyBlock proto era) → Encoding
- shelleyBinaryBlockInfo ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ShelleyBlock proto era → BinaryBlockInfo
- 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)
- compactGenesis ∷ ShelleyGenesis c → CompactGenesis c
- mkShelleyBlockConfig ∷ ∀ proto era. ShelleyBasedEra era ⇒ ProtVer → ShelleyGenesis (EraCrypto era) → [VKey 'BlockIssuer (EraCrypto era)] → BlockConfig (ShelleyBlock proto era)
- forgeShelleyBlock ∷ ∀ m era proto. (ShelleyCompatible proto era, Monad m) ⇒ HotKey (EraCrypto era) m → CanBeLeader proto → TopLevelConfig (ShelleyBlock proto era) → BlockNo → SlotNo → TickedLedgerState (ShelleyBlock proto era) → [Validated (GenTx (ShelleyBlock proto era))] → IsLeader proto → m (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)
- shelleyTipToPoint ∷ WithOrigin (ShelleyTip proto era) → Point (ShelleyBlock proto era)
- mkShelleyLedgerConfig ∷ ShelleyGenesis (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → ShelleyLedgerConfig era
- shelleyEraParams ∷ ShelleyGenesis c → EraParams
- shelleyEraParamsNeverHardForks ∷ ShelleyGenesis c → EraParams
- shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis (EraCrypto era)
- getPParams ∷ EraGov era ⇒ NewEpochState era → PParams era
- decodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ Decoder s (AnnTip (ShelleyBlock proto era))
- decodeShelleyLedgerState ∷ ∀ era proto s. ShelleyCompatible proto era ⇒ Decoder s (LedgerState (ShelleyBlock proto era))
- encodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ AnnTip (ShelleyBlock proto era) → Encoding
- encodeShelleyHeaderState ∷ ShelleyCompatible proto era ⇒ HeaderState (ShelleyBlock proto era) → Encoding
- encodeShelleyLedgerState ∷ ShelleyCompatible proto era ⇒ LedgerState (ShelleyBlock proto era) → Encoding
- fixedBlockBodyOverhead ∷ Num a ⇒ a
- mkShelleyTx ∷ ∀ era proto. ShelleyBasedEra era ⇒ Tx era → GenTx (ShelleyBlock proto era)
- mkShelleyValidatedTx ∷ ∀ era proto. ShelleyBasedEra era ⇒ Validated (Tx era) → Validated (GenTx (ShelleyBlock proto era))
- perTxOverhead ∷ Num a ⇒ a
- fromExUnits ∷ ExUnits → ExUnits' Natural
- querySupportedVersion ∷ BlockQuery (ShelleyBlock proto era) result → ShelleyNodeToClientVersion → Bool
- decodeShelleyQuery ∷ ∀ era proto. ShelleyBasedEra era ⇒ ∀ s. Decoder s (SomeSecond BlockQuery (ShelleyBlock proto era))
- decodeShelleyResult ∷ ∀ proto era result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) result → ∀ s. Decoder s result
- encodeShelleyQuery ∷ ∀ era proto result. ShelleyBasedEra era ⇒ BlockQuery (ShelleyBlock proto era) result → Encoding
- encodeShelleyResult ∷ ∀ proto era result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) result → result → Encoding
Documentation
A generalized transaction, GenTx
, identifier.
Instances
data family Header blk Source #
Instances
data family LedgerState blk Source #
Ledger state associated with a block
This is the Consensus notion of a ledger state. Each block type is
associated with one of the Ledger types for the ledger state. Virtually
every concept in this codebase revolves around this type, or the referenced
blk
. Whenever we use the type variable l
, we intend to denote that the
expected instantiation is either a LedgerState
or some wrapper over it
(like the ExtLedgerState
).
The main operations we can do with a LedgerState
are ticking (defined in
IsLedger
), and applying a block (defined in
ApplyBlock
).
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 ApplyTxError era Source #
ApplyTxError (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) |
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
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
GetHeader ByronBlock Source # | |
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 StorageConfig blk Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
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 BlockConfig blk Source #
Static configuration required to work with this type of blocks
Instances
data family Ticked st Source #
" Ticked " piece of state, either LedgerState
or ChainDepState
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. There are exactly two methods in the interface
that do that: tickChainDepState
and
applyChainTickLedgerResult
.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt
cfg st)
slot
. Thus a
protocolLedgerView
cfg
(applyChainTick
cfg slot st)LedgerView
can only be projected
from a Ticked
state, but cannot itself be ticked.
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
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
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 BlockQuery blk ∷ Type → Type Source #
Different queries supported by the ledger, indexed by the result type.
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), EncCBOR (ShelleyProtocolHeader proto), DecCBOR (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, DecCBOR (PState era), FromCBOR (LegacyPParams era), ToCBOR (LegacyPParams era)) ⇒ ShelleyCompatible proto era Source #
Instances
class (ShelleyCompatible (BlockProtocol blk) (ShelleyBlockLedgerEra blk), blk ~ ShelleyBlock (BlockProtocol blk) (ShelleyBlockLedgerEra blk)) ⇒ IsShelleyBlock blk Source #
Instances
(proto ~ BlockProtocol (ShelleyBlock proto era), ShelleyCompatible proto era) ⇒ IsShelleyBlock (ShelleyBlock proto era) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Block |
type family ShelleyBlockLedgerEra blk where ... Source #
ShelleyBlockLedgerEra (ShelleyBlock proto era) = era |
class (EraSegWits era, EraGov era, ApplyTx era, ApplyBlock era, EraTransition era, GetLedgerView era, NoThunks (StashedAVVMAddresses era), EncCBOR (StashedAVVMAddresses era), DecCBOR (StashedAVVMAddresses era), Show (StashedAVVMAddresses era), Eq (StashedAVVMAddresses era), DecCBOR (PredicateFailure (EraRule "LEDGER" era)), EncCBOR (PredicateFailure (EraRule "LEDGER" era)), DecCBOR (PredicateFailure (EraRule "UTXOW" era)), EncCBOR (PredicateFailure (EraRule "UTXOW" era)), DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (TranslationContext era)) ⇒ ShelleyBasedEra era Source #
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.
If this class becomes redundant, We can move it to ledger and re-export it from here.
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/IntersectMBO/ouroboros-network/issues/2890
Instances
newtype ShelleyHash crypto Source #
Instances
data CompactGenesis c 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
newtype ShelleyLedgerError era Source #
Instances
data ShelleyTip proto era Source #
ShelleyTip | |
|
Instances
newtype ShelleyTransition Source #
Information required to determine the hard fork point from Shelley to the next ledger
ShelleyTransitionInfo | |
|
Instances
Generic ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger type Rep ShelleyTransition ∷ Type → Type # | |
Show ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger showsPrec ∷ Int → ShelleyTransition → ShowS # show ∷ ShelleyTransition → String # showList ∷ [ShelleyTransition] → ShowS # | |
Eq ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger | |
NoThunks ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger | |
type Rep ShelleyTransition Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger type Rep ShelleyTransition = D1 ('MetaData "ShelleyTransition" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-cardano-0.20.0.0-inplace" 'True) (C1 ('MetaCons "ShelleyTransitionInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyAfterVoting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) |
data ShelleyLedgerConfig era Source #
ShelleyLedgerConfig | |
|
Instances
data ShelleyReapplyException Source #
∀ era.Show (BlockTransitionError era) ⇒ ShelleyReapplyException (BlockTransitionError era) |
data AlonzoMeasure Source #
Instances
data ConwayMeasure Source #
Instances
data ShelleyNodeToClientVersion Source #
ShelleyNodeToClientVersion1 | |
ShelleyNodeToClientVersion2 | New queries introduced |
ShelleyNodeToClientVersion3 | New query introduced |
ShelleyNodeToClientVersion4 | New queries introduced |
ShelleyNodeToClientVersion5 | New queries introduced: GetRewardInfoPools |
ShelleyNodeToClientVersion6 | New queries introduced: GetPoolDistr, GetPoolState, GetStakeSnapshots |
ShelleyNodeToClientVersion7 | New queries introduced: GetStakeDelegDeposits |
ShelleyNodeToClientVersion8 | New queries introduced: GetConstitutionHash, GetFilteredVoteDelegatees |
ShelleyNodeToClientVersion9 | New queries introduced: GetProposals, GetRatifyState |
ShelleyNodeToClientVersion10 | New queries introduced: GetFuturePParams |
ShelleyNodeToClientVersion11 | New queries introduced: GetBigLedgerPeerSnapshot |
Instances
data ShelleyNodeToNodeVersion Source #
Instances
newtype NonMyopicMemberRewards c Source #
NonMyopicMemberRewards | |
|
Instances
Show (NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query showsPrec ∷ Int → NonMyopicMemberRewards c → ShowS # show ∷ NonMyopicMemberRewards c → String # showList ∷ [NonMyopicMemberRewards c] → ShowS # | |
Crypto c ⇒ FromCBOR (NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query | |
Crypto c ⇒ ToCBOR (NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query toCBOR ∷ NonMyopicMemberRewards c → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (NonMyopicMemberRewards c) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [NonMyopicMemberRewards c] → Size Source # | |
Eq (NonMyopicMemberRewards c) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query (==) ∷ NonMyopicMemberRewards c → NonMyopicMemberRewards c → Bool # (/=) ∷ NonMyopicMemberRewards c → NonMyopicMemberRewards c → Bool # |
data StakeSnapshot crypto Source #
The stake snapshot returns information about the mark, set, go ledger snapshots for a pool,
plus the total active stake for each snapshot that can be used in a sigma
calculation.
Each snapshot is taken at the end of a different era. The go snapshot is the current one and was taken two epochs earlier, set was taken one epoch ago, and mark was taken immediately before the start of the current epoch.
Instances
data StakeSnapshots crypto Source #
StakeSnapshots | |
|
Instances
verifyBlockIntegrity ∷ ShelleyCompatible proto era ⇒ Word64 → ShelleyBlock proto era → Bool Source #
Verifies whether the block is not corrupted by checking its signature and witnesses.
verifyHeaderIntegrity Source #
∷ ProtocolHeaderSupportsKES proto | |
⇒ Word64 | Slots per KES period |
→ ShelleyProtocolHeader proto | |
→ Bool |
Verify that the signature on a header is correct and valid.
mkShelleyBlock ∷ ShelleyCompatible proto era ⇒ Block (ShelleyProtocolHeader proto) era → ShelleyBlock proto era Source #
mkShelleyHeader ∷ ShelleyCompatible proto era ⇒ ShelleyProtocolHeader proto → Header (ShelleyBlock proto era) Source #
decodeShelleyBlock ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ∀ s. Decoder s (ByteString → ShelleyBlock proto era) Source #
decodeShelleyHeader ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ∀ s. Decoder s (ByteString → Header (ShelleyBlock proto era)) Source #
encodeShelleyBlock ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ShelleyBlock proto era → Encoding Source #
encodeShelleyHeader ∷ ∀ proto era. ShelleyCompatible proto era ⇒ Header (ShelleyBlock proto era) → Encoding Source #
shelleyBinaryBlockInfo ∷ ∀ proto era. ShelleyCompatible proto era ⇒ ShelleyBlock proto era → BinaryBlockInfo 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
compactGenesis ∷ ShelleyGenesis c → CompactGenesis c Source #
Compacts the given ShelleyGenesis
.
mkShelleyBlockConfig ∷ ∀ proto era. ShelleyBasedEra era ⇒ ProtVer → ShelleyGenesis (EraCrypto era) → [VKey 'BlockIssuer (EraCrypto era)] → BlockConfig (ShelleyBlock proto era) Source #
∷ ∀ m era proto. (ShelleyCompatible proto era, Monad m) | |
⇒ HotKey (EraCrypto era) m | |
→ CanBeLeader proto | |
→ TopLevelConfig (ShelleyBlock proto era) | |
→ BlockNo | Current block number |
→ SlotNo | Current slot number |
→ TickedLedgerState (ShelleyBlock proto era) | Current ledger |
→ [Validated (GenTx (ShelleyBlock proto era))] | Txs to include |
→ IsLeader proto | |
→ m (ShelleyBlock proto era) |
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 #
shelleyTipToPoint ∷ WithOrigin (ShelleyTip proto era) → Point (ShelleyBlock proto era) Source #
mkShelleyLedgerConfig ∷ ShelleyGenesis (EraCrypto era) → TranslationContext era → EpochInfo (Except PastHorizonException) → ShelleyLedgerConfig era Source #
shelleyEraParamsNeverHardForks ∷ ShelleyGenesis c → EraParams Source #
Separate variant of shelleyEraParams
to be used for a Shelley-only chain.
shelleyLedgerGenesis ∷ ShelleyLedgerConfig era → ShelleyGenesis (EraCrypto era) Source #
getPParams ∷ EraGov era ⇒ NewEpochState era → PParams era Source #
decodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ Decoder s (AnnTip (ShelleyBlock proto era)) Source #
decodeShelleyLedgerState ∷ ∀ era proto s. ShelleyCompatible proto era ⇒ Decoder s (LedgerState (ShelleyBlock proto era)) Source #
encodeShelleyAnnTip ∷ ShelleyCompatible proto era ⇒ AnnTip (ShelleyBlock proto era) → Encoding Source #
encodeShelleyHeaderState ∷ ShelleyCompatible proto era ⇒ HeaderState (ShelleyBlock proto era) → Encoding Source #
encodeShelleyLedgerState ∷ ShelleyCompatible proto era ⇒ LedgerState (ShelleyBlock proto era) → Encoding Source #
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
.
mkShelleyTx ∷ ∀ era proto. ShelleyBasedEra era ⇒ Tx era → GenTx (ShelleyBlock proto era) Source #
mkShelleyValidatedTx ∷ ∀ era proto. ShelleyBasedEra era ⇒ Validated (Tx era) → Validated (GenTx (ShelleyBlock proto era)) Source #
perTxOverhead ∷ Num a ⇒ a Source #
querySupportedVersion ∷ BlockQuery (ShelleyBlock proto era) result → ShelleyNodeToClientVersion → Bool Source #
Is the given query supported by the given ShelleyNodeToClientVersion
?
decodeShelleyQuery ∷ ∀ era proto. ShelleyBasedEra era ⇒ ∀ s. Decoder s (SomeSecond BlockQuery (ShelleyBlock proto era)) Source #
decodeShelleyResult ∷ ∀ proto era result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) result → ∀ s. Decoder s result Source #
encodeShelleyQuery ∷ ∀ era proto result. ShelleyBasedEra era ⇒ BlockQuery (ShelleyBlock proto era) result → Encoding Source #
encodeShelleyResult ∷ ∀ proto era result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) result → result → Encoding Source #