Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains the code for handling the various kinds of version that we care about:
- Protocol versions
- Plutus ledger languages
- Plutus Core language versions
Synopsis
- newtype MajorProtocolVersion = MajorProtocolVersion {}
- shelleyPV :: MajorProtocolVersion
- allegraPV :: MajorProtocolVersion
- maryPV :: MajorProtocolVersion
- alonzoPV :: MajorProtocolVersion
- vasilPV :: MajorProtocolVersion
- valentinePV :: MajorProtocolVersion
- changPV :: MajorProtocolVersion
- changPlus1PV :: MajorProtocolVersion
- knownPVs :: Set MajorProtocolVersion
- futurePV :: MajorProtocolVersion
- data PlutusLedgerLanguage
- data Version = Version {}
- ledgerLanguageIntroducedIn :: PlutusLedgerLanguage -> MajorProtocolVersion
- ledgerLanguagesAvailableIn :: MajorProtocolVersion -> Set PlutusLedgerLanguage
- plcVersionsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
- plcVersionsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set Version
- builtinsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
- builtinsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set DefaultFun
Cardano Protocol versions
newtype MajorProtocolVersion Source #
This represents the major component of the Cardano protocol version. The ledger can only supply the major component of the protocol version, not the minor component, and Plutus should only need to care about the major component anyway. This relies on careful understanding between us and the ledger as to what this means.
Instances
Protocol Version aliases
shelleyPV :: MajorProtocolVersion Source #
Shelley era was introduced in protocol version 2.0
allegraPV :: MajorProtocolVersion Source #
Allegra era was introduced in protocol version 3.0
maryPV :: MajorProtocolVersion Source #
Mary era was introduced in protocol version 4.0
alonzoPV :: MajorProtocolVersion Source #
Alonzo era was introduced in protocol version 5.0
vasilPV :: MajorProtocolVersion Source #
The Vasil HF introduced the Babbage era and Plutus V2
valentinePV :: MajorProtocolVersion Source #
Valentine was an intra-era HF where builtin functions VerifyEcdsaSecp256k1Signature
and
VerifySchnorrSecp256k1Signature
were enabled.
changPV :: MajorProtocolVersion Source #
The Chang HF introduced the Conway era and Plutus V3
changPlus1PV :: MajorProtocolVersion Source #
The Chang+1 HF will be an intra-era HF where some new builtin functions are introduced in Plutus V2 and V3.
knownPVs :: Set MajorProtocolVersion Source #
The set of protocol versions that are "known", i.e. that have been released and have actual differences associated with them.
futurePV :: MajorProtocolVersion Source #
This is a placeholder for when we don't yet know what protocol version will be used for something. It's a very high protocol version that should never appear in reality. New builtins should always be given this protocol version until they've been finalised.
We should not assign names to future protocol versions until it's confirmed that they are correct, otherwise we could accidentally associate something with the wrong protocol version.
Plutus ledger languages
data PlutusLedgerLanguage Source #
The Plutus ledger language. These are entirely different script languages from the ledger's perspective, which on our side are interpreted in very similar ways.
It is a simple enumerated datatype (there is no major and minor components as in protocol version) and the ordering of constructors is essential for deriving Enum,Ord,Bounded.
IMPORTANT: this is different from the Plutus Core language version, Version
Instances
Plutus Core language versions
Instances
Generic Version | |
Show Version | |
NFData Version | |
Defined in PlutusCore.Version | |
Eq Version | |
Ord Version | |
Hashable Version | |
Defined in PlutusCore.Version | |
Pretty Version | |
Defined in PlutusCore.Version prettyList :: [Version] -> Doc ann | |
type Rep Version | |
Defined in PlutusCore.Version type Rep Version = D1 ('MetaData "Version" "PlutusCore.Version" "plutus-core-1.36.0.0-7ehJj5tIPqoJIiiivXkX9N" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "_versionMajor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "_versionMinor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "_versionPatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))) |
Version-testing functions
ledgerLanguageIntroducedIn :: PlutusLedgerLanguage -> MajorProtocolVersion Source #
Query the protocol version that a specific Plutus ledger language was first introduced in.
ledgerLanguagesAvailableIn :: MajorProtocolVersion -> Set PlutusLedgerLanguage Source #
Which Plutus language versions are available in the given MajorProtocolVersion
?
See Note [New builtins/language versions and protocol versions]
plcVersionsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version) Source #
A map indicating which Plutus Core versions were introduced in which
MajorProtocolVersion
and PlutusLedgerLanguage
. Each version should appear at most once.
This must be updated when new versions are added. See Note [New builtins/language versions and protocol versions]
plcVersionsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set Version Source #
Which Plutus Core language versions are available in the given PlutusLedgerLanguage
and MajorProtocolVersion
?
See Note [New builtins/language versions and protocol versions]
builtinsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun) Source #
A map indicating which builtin functions were introduced in which MajorProtocolVersion
.
This must be updated when new builtins are added. See Note [New builtins/language versions and protocol versions]
builtinsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set DefaultFun Source #
Which builtin functions are available in the given given PlutusLedgerLanguage
and MajorProtocolVersion
?
See Note [New builtins/language versions and protocol versions]