cardano-protocol-0.3.0.0: Cardano Protocol: shared crypto and block-header definitions
Safe HaskellNone
LanguageHaskell2010

Cardano.Protocol.Leios.BlockHeader

Description

Block header associated with Leios.

The Leios header body is the Praos header body with the protocol version replaced by BlockHeaderVersionInfo and two additional fields appended. Unlike the Praos header body, it is memoized, and its KES signature is made and checked over its original bytes. See Cardano.Protocol.Praos.BlockHeader for the remaining details.

Synopsis

Documentation

data Header crypto Source #

Constructors

Header 

Fields

Instances

Instances details
Crypto crypto ⇒ ToCBOR (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

toCBOR ∷ Header crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Header crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Header crypto] → Size Source #

Crypto crypto ⇒ DecCBOR (Annotator (Header crypto)) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

decCBOR ∷ Decoder s (Annotator (Header crypto)) Source #

dropCBOR ∷ Proxy (Annotator (Header crypto)) → Decoder s () Source #

label ∷ Proxy (Annotator (Header crypto)) → Text Source #

Crypto crypto ⇒ EncCBOR (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

encCBOR ∷ Header crypto → Encoding Source #

Crypto crypto ⇒ SafeToHash (Header crypto) Source #

The original header body bytes and the raw signature, so the encoding of the enclosing array does not affect the header hash.

Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Generic (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Associated Types

type Rep (Header crypto) 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (Header crypto) = D1 ('MetaData "Header" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'False) (C1 ('MetaCons "Header" 'PrefixI 'True) (S1 ('MetaSel ('Just "headerBody") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderBody crypto)) :*: S1 ('MetaSel ('Just "headerSig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignedKES (KES crypto) (HeaderBody crypto)))))

Methods

from ∷ Header crypto → Rep (Header crypto) x #

to ∷ Rep (Header crypto) x → Header crypto #

Crypto crypto ⇒ Show (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

showsPrec ∷ Int → Header crypto → ShowS #

show ∷ Header crypto → String #

showList ∷ [Header crypto] → ShowS #

Crypto crypto ⇒ Eq (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

(==) ∷ Header crypto → Header crypto → Bool #

(/=) ∷ Header crypto → Header crypto → Bool #

Crypto crypto ⇒ NoThunks (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

noThunks ∷ Context → Header crypto → IO (Maybe ThunkInfo) Source #

wNoThunks ∷ Context → Header crypto → IO (Maybe ThunkInfo) Source #

showTypeOf ∷ Proxy (Header crypto) → String Source #

(Crypto c, Era era) ⇒ EraBlockHeader (Header c) era Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

(Crypto c, Era era) ⇒ LeiosEraBlockHeader (Header c) era Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Crypto crypto ⇒ HashAnnotated (Header crypto) EraIndependentBlockHeader Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (Header crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (Header crypto) = D1 ('MetaData "Header" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'False) (C1 ('MetaCons "Header" 'PrefixI 'True) (S1 ('MetaSel ('Just "headerBody") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderBody crypto)) :*: S1 ('MetaSel ('Just "headerSig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignedKES (KES crypto) (HeaderBody crypto)))))

newtype HeaderBody crypto Source #

Constructors

HeaderBodyConstr (MemoBytes (HeaderBodyRaw crypto)) 

Bundled Patterns

pattern HeaderBody ∷ BlockNo → SlotNo → PrevHash → VKey 'BlockIssuer → VerKeyVRF (VRF crypto) → CertifiedVRF (VRF crypto) InputVRF → Word32 → Hash HASH EraIndependentBlockBody → OCert crypto → BlockHeaderVersionInfo → Bool → StrictMaybe EbReferencesAnnouncement → HeaderBody crypto 

Instances

Instances details
Typeable crypto ⇒ ToCBOR (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

toCBOR ∷ HeaderBody crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (HeaderBody crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [HeaderBody crypto] → Size Source #

SignableRepresentation (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Crypto crypto ⇒ DecCBOR (Annotator (HeaderBody crypto)) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

decCBOR ∷ Decoder s (Annotator (HeaderBody crypto)) Source #

dropCBOR ∷ Proxy (Annotator (HeaderBody crypto)) → Decoder s () Source #

label ∷ Proxy (Annotator (HeaderBody crypto)) → Text Source #

Crypto crypto ⇒ EncCBOR (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

encCBOR ∷ HeaderBody crypto → Encoding Source #

SafeToHash (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Memoized (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Associated Types

type RawType (HeaderBody crypto) 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type RawType (HeaderBody crypto) = HeaderBodyRaw crypto

Methods

getMemoBytes ∷ HeaderBody crypto → MemoBytes (RawType (HeaderBody crypto))

wrapMemoBytes ∷ MemoBytes (RawType (HeaderBody crypto)) → HeaderBody crypto

Generic (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Associated Types

type Rep (HeaderBody crypto) 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (HeaderBody crypto) = D1 ('MetaData "HeaderBody" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'True) (C1 ('MetaCons "HeaderBodyConstr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MemoBytes (HeaderBodyRaw crypto)))))

Methods

from ∷ HeaderBody crypto → Rep (HeaderBody crypto) x #

to ∷ Rep (HeaderBody crypto) x → HeaderBody crypto #

Crypto crypto ⇒ Show (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

showsPrec ∷ Int → HeaderBody crypto → ShowS #

show ∷ HeaderBody crypto → String #

showList ∷ [HeaderBody crypto] → ShowS #

Crypto crypto ⇒ Eq (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

(==) ∷ HeaderBody crypto → HeaderBody crypto → Bool #

(/=) ∷ HeaderBody crypto → HeaderBody crypto → Bool #

Crypto crypto ⇒ NoThunks (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type RawType (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type RawType (HeaderBody crypto) = HeaderBodyRaw crypto
type Rep (HeaderBody crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (HeaderBody crypto) = D1 ('MetaData "HeaderBody" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'True) (C1 ('MetaCons "HeaderBodyConstr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MemoBytes (HeaderBodyRaw crypto)))))

data HeaderBodyRaw crypto Source #

Constructors

HeaderBodyRaw 

Fields

Instances

Instances details
Crypto crypto ⇒ DecCBOR (Annotator (HeaderBodyRaw crypto)) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Crypto crypto ⇒ DecCBOR (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

decCBOR ∷ Decoder s (HeaderBodyRaw crypto) Source #

dropCBOR ∷ Proxy (HeaderBodyRaw crypto) → Decoder s () Source #

label ∷ Proxy (HeaderBodyRaw crypto) → Text Source #

Crypto crypto ⇒ EncCBOR (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

encCBOR ∷ HeaderBodyRaw crypto → Encoding Source #

Generic (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Associated Types

type Rep (HeaderBodyRaw crypto) 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (HeaderBodyRaw crypto) = D1 ('MetaData "HeaderBodyRaw" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'False) (C1 ('MetaCons "HeaderBodyRaw" 'PrefixI 'True) (((S1 ('MetaSel ('Just "hbrBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: (S1 ('MetaSel ('Just "hbrSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "hbrPrev") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrevHash))) :*: (S1 ('MetaSel ('Just "hbrVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VKey 'BlockIssuer)) :*: (S1 ('MetaSel ('Just "hbrVrfVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VerKeyVRF (VRF crypto))) :*: S1 ('MetaSel ('Just "hbrVrfRes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertifiedVRF (VRF crypto) InputVRF))))) :*: ((S1 ('MetaSel ('Just "hbrBodySize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "hbrBodyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash HASH EraIndependentBlockBody)) :*: S1 ('MetaSel ('Just "hbrOCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (OCert crypto)))) :*: (S1 ('MetaSel ('Just "hbrVersionInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockHeaderVersionInfo) :*: (S1 ('MetaSel ('Just "hbrBlockBodyContainsLeiosCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "hbrEbReferencesAnnouncement") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe EbReferencesAnnouncement)))))))

Methods

from ∷ HeaderBodyRaw crypto → Rep (HeaderBodyRaw crypto) x #

to ∷ Rep (HeaderBodyRaw crypto) x → HeaderBodyRaw crypto #

Crypto crypto ⇒ Show (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

showsPrec ∷ Int → HeaderBodyRaw crypto → ShowS #

show ∷ HeaderBodyRaw crypto → String #

showList ∷ [HeaderBodyRaw crypto] → ShowS #

Crypto crypto ⇒ Eq (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

Methods

(==) ∷ HeaderBodyRaw crypto → HeaderBodyRaw crypto → Bool #

(/=) ∷ HeaderBodyRaw crypto → HeaderBodyRaw crypto → Bool #

Crypto crypto ⇒ NoThunks (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type MemoHashIndex (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (HeaderBodyRaw crypto) Source # 
Instance details

Defined in Cardano.Protocol.Leios.BlockHeader

type Rep (HeaderBodyRaw crypto) = D1 ('MetaData "HeaderBodyRaw" "Cardano.Protocol.Leios.BlockHeader" "cardano-protocol-0.3.0.0-inplace" 'False) (C1 ('MetaCons "HeaderBodyRaw" 'PrefixI 'True) (((S1 ('MetaSel ('Just "hbrBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: (S1 ('MetaSel ('Just "hbrSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "hbrPrev") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrevHash))) :*: (S1 ('MetaSel ('Just "hbrVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VKey 'BlockIssuer)) :*: (S1 ('MetaSel ('Just "hbrVrfVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VerKeyVRF (VRF crypto))) :*: S1 ('MetaSel ('Just "hbrVrfRes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertifiedVRF (VRF crypto) InputVRF))))) :*: ((S1 ('MetaSel ('Just "hbrBodySize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "hbrBodyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash HASH EraIndependentBlockBody)) :*: S1 ('MetaSel ('Just "hbrOCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (OCert crypto)))) :*: (S1 ('MetaSel ('Just "hbrVersionInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockHeaderVersionInfo) :*: (S1 ('MetaSel ('Just "hbrBlockBodyContainsLeiosCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "hbrEbReferencesAnnouncement") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe EbReferencesAnnouncement)))))))

mkHeaderBody ∷ (Era era, Crypto crypto) ⇒ proxy era → HeaderBodyRaw crypto → HeaderBody crypto Source #

headerSize ∷ Crypto crypto ⇒ Header crypto → Int Source #

Size of the hashed bytes: the original header body bytes and the raw signature. This does not depend on the encoding of the enclosing array.