Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Block header associated with Praos.
The choice of whether to associate the header with the ledger era or the protocol is a little artitrary. Functionally the header contains things which are associated with both ledger and protocol, and which are used by both.
We choose to associate the header with the protocol, since it more strongly
binds in that direction, and to assist with the mental picture that the
protocol is concerned with the block header, while the ledger is concerned
with the block body. However, in order to more cleanly illustrate which parts
of the header are _strictly_ protocol concerns, we also provide a view of the
header (in Views
) which extracts just
the fields needed for the Praos protocol. This also allows us to hide the
more detailed construction of the header.
Synopsis
- data Header crypto where
- pattern Header ∷ Crypto crypto ⇒ HeaderBody crypto → SignedKES crypto (HeaderBody crypto) → Header crypto
- data HeaderBody crypto = HeaderBody {
- hbBlockNo ∷ !BlockNo
- hbSlotNo ∷ !SlotNo
- hbPrev ∷ !(PrevHash crypto)
- hbVk ∷ !(VKey 'BlockIssuer crypto)
- hbVrfVk ∷ !(VerKeyVRF crypto)
- hbVrfRes ∷ !(CertifiedVRF crypto InputVRF)
- hbBodySize ∷ !Word32
- hbBodyHash ∷ !(Hash crypto EraIndependentBlockBody)
- hbOCert ∷ !(OCert crypto)
- hbProtVer ∷ !ProtVer
- headerHash ∷ Crypto crypto ⇒ Header crypto → Hash (HASH crypto) EraIndependentBlockHeader
- headerSize ∷ Header crypto → Int
Documentation
data Header crypto where Source #
Full header type, carrying its own memoised bytes.
pattern Header ∷ Crypto crypto ⇒ HeaderBody crypto → SignedKES crypto (HeaderBody crypto) → Header crypto |
Instances
Generic (Header crypto) Source # | |
Crypto crypto ⇒ Show (Header crypto) Source # | |
Crypto c ⇒ ToCBOR (Header c) Source # | |
Crypto c ⇒ DecCBOR (Annotator (Header c)) Source # | |
Crypto c ⇒ EncCBOR (Header c) Source # | |
Crypto c ⇒ Eq (Header c) Source # | Checks the binary representation first. |
Crypto crypto ⇒ NoThunks (Header crypto) Source # | |
type Rep (Header crypto) Source # | |
Defined in Ouroboros.Consensus.Protocol.Praos.Header |
data HeaderBody crypto Source #
The body of the header is the part which gets hashed to form the hash chain.
HeaderBody | |
|
Instances
headerHash ∷ Crypto crypto ⇒ Header crypto → Hash (HASH crypto) EraIndependentBlockHeader Source #
Hash a header
headerSize ∷ Header crypto → Int Source #
Compute the size of the header