Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.ByronDual.Ledger
Synopsis
- type DualByronBlock = DualBlock ByronBlock ByronSpecBlock
- type DualByronBridge = BridgeLedger ByronBlock ByronSpecBlock
- data ByronSpecBridge = ByronSpecBridge {}
- newtype SpecToImplIds = SpecToImplIds {}
- bridgeToSpecKey ∷ DualByronBridge → PBftVerKeyHash PBftByronCrypto → VKey
- bridgeTransactionIds ∷ DualByronBridge → Map TxId TxId
- initByronSpecBridge ∷ ByronSpecGenesis → Map TxId TxId → ByronSpecBridge
- specToImplTx ∷ Tx → ATxAux ByteString → SpecToImplIds
- forgeDualByronBlock ∷ ∀ (mk ∷ MapKind). HasCallStack ⇒ TopLevelConfig DualByronBlock → BlockNo → SlotNo → TickedLedgerState DualByronBlock mk → [Validated (GenTx DualByronBlock)] → PBftIsLeader PBftByronCrypto → DualByronBlock
Shorthand
Bridge
data ByronSpecBridge Source #
Bridge the gap between the Byron implementation and specification
The relation between the Byron implementation and specification for the
linear case is tested in the Byron implementation itself, specifically
in ts_prop_generatedChainsAreValidated
. The main goal of the consensus
DualByron tests is to lift these tests to the general consensus setting,
where time is not linear but branching.
In the linear case, the tests maintain some state linking the spec and the implementation. In the consensus case, this state cannot be maintained like this, and so it has to become part of transactions, blocks, and the ledger state itself.
Constructors
ByronSpecBridge | |
Fields
|
Instances
newtype SpecToImplIds Source #
Constructors
SpecToImplIds | |
Instances
Monoid SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger Methods mappend ∷ SpecToImplIds → SpecToImplIds → SpecToImplIds # mconcat ∷ [SpecToImplIds] → SpecToImplIds # | |||||
Semigroup SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger Methods (<>) ∷ SpecToImplIds → SpecToImplIds → SpecToImplIds # sconcat ∷ NonEmpty SpecToImplIds → SpecToImplIds # stimes ∷ Integral b ⇒ b → SpecToImplIds → SpecToImplIds # | |||||
Generic SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger Associated Types
| |||||
Show SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger Methods showsPrec ∷ Int → SpecToImplIds → ShowS # show ∷ SpecToImplIds → String # showList ∷ [SpecToImplIds] → ShowS # | |||||
Eq SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger | |||||
Serialise SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger Methods encode ∷ SpecToImplIds → Encoding Source # decode ∷ Decoder s SpecToImplIds Source # encodeList ∷ [SpecToImplIds] → Encoding Source # decodeList ∷ Decoder s [SpecToImplIds] Source # | |||||
type Rep SpecToImplIds Source # | |||||
Defined in Ouroboros.Consensus.ByronDual.Ledger type Rep SpecToImplIds = D1 ('MetaData "SpecToImplIds" "Ouroboros.Consensus.ByronDual.Ledger" "ouroboros-consensus-cardano-0.24.0.0-inplace-unstable-byron-testlib" 'True) (C1 ('MetaCons "SpecToImplIds" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSpecToImplIds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbstractToConcreteIdMaps))) |
bridgeToSpecKey ∷ DualByronBridge → PBftVerKeyHash PBftByronCrypto → VKey Source #
Translate issuer key
We get a proof from PBFT that we are the leader, including a signing key (of
type SigningKey
). In order to produce the corresponding abstract block, we
need a VKey
.
Arguments
∷ ByronSpecGenesis | |
→ Map TxId TxId | Mapping for the transaction in the initial UTxO |
→ ByronSpecBridge |
specToImplTx ∷ Tx → ATxAux ByteString → SpecToImplIds Source #
Construct singleton SpecToImplIds
for a transaction
Block forging
Arguments
∷ ∀ (mk ∷ MapKind). HasCallStack | |
⇒ TopLevelConfig DualByronBlock | |
→ BlockNo | Current block number |
→ SlotNo | Current slot number |
→ TickedLedgerState DualByronBlock mk | Ledger |
→ [Validated (GenTx DualByronBlock)] | Txs to add in the block |
→ PBftIsLeader PBftByronCrypto | Leader proof ( |
→ DualByronBlock |
Orphan instances
Bridge ByronBlock ByronSpecBlock Source # | |||||||||||||
Associated Types
Methods updateBridgeWithBlock ∷ DualBlock ByronBlock ByronSpecBlock → BridgeLedger ByronBlock ByronSpecBlock → BridgeLedger ByronBlock ByronSpecBlock Source # updateBridgeWithTx ∷ Validated (GenTx (DualBlock ByronBlock ByronSpecBlock)) → BridgeLedger ByronBlock ByronSpecBlock → BridgeLedger ByronBlock ByronSpecBlock Source # |