Skip to content

Commit

Permalink
Merge pull request #4857 from IntersectMBO/jj/lazy-predfailures
Browse files Browse the repository at this point in the history
Made predicate failure and environment fields lazy
lehins authored Jan 28, 2025
2 parents 85543d6 + 014420f commit 95907f5
Showing 40 changed files with 263 additions and 257 deletions.
1 change: 1 addition & 0 deletions eras/allegra/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.7.0.0

* Made the fields of predicate failures and environments lazy
* Add `Era era` constraint to `NoThunks` instance for `TimeLock`
* Remove `Era era` constraint from:
* `getRequireSignatureTimelock`
26 changes: 13 additions & 13 deletions eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs
Original file line number Diff line number Diff line change
@@ -70,29 +70,29 @@ import Validation
-- ==========================================================

data AllegraUtxoPredFailure era
= BadInputsUTxO !(Set TxIn) -- The bad transaction inputs
= BadInputsUTxO (Set TxIn) -- The bad transaction inputs
| OutsideValidityIntervalUTxO
!ValidityInterval -- transaction's validity interval
!SlotNo -- current slot
| MaxTxSizeUTxO !(Mismatch 'RelLTEQ Integer)
ValidityInterval -- transaction's validity interval
SlotNo -- current slot
| MaxTxSizeUTxO (Mismatch 'RelLTEQ Integer)
| InputSetEmptyUTxO
| FeeTooSmallUTxO !(Mismatch 'RelGTEQ Coin)
| ValueNotConservedUTxO !(Mismatch 'RelEQ (Value era)) -- Consumed, then produced
| FeeTooSmallUTxO (Mismatch 'RelGTEQ Coin)
| ValueNotConservedUTxO (Mismatch 'RelEQ (Value era)) -- Consumed, then produced
| WrongNetwork
!Network -- the expected network id
!(Set Addr) -- the set of addresses with incorrect network IDs
Network -- the expected network id
(Set Addr) -- the set of addresses with incorrect network IDs
| WrongNetworkWithdrawal
!Network -- the expected network id
!(Set RewardAccount) -- the set of reward addresses with incorrect network IDs
Network -- the expected network id
(Set RewardAccount) -- the set of reward addresses with incorrect network IDs
| OutputTooSmallUTxO
![TxOut era] -- list of supplied transaction outputs that are too small
[TxOut era] -- list of supplied transaction outputs that are too small
| UpdateFailure (EraRuleFailure "PPUP" era) -- Subtransition Failures
| OutputBootAddrAttrsTooBig
![TxOut era] -- list of supplied bad transaction outputs
[TxOut era] -- list of supplied bad transaction outputs
| -- Kept for backwards compatibility: no longer used because the `MultiAsset` type of mint doesn't allow for this possibility
TriesToForgeADA -- TODO: remove
| OutputTooBigUTxO
![TxOut era] -- list of supplied bad transaction outputs
[TxOut era] -- list of supplied bad transaction outputs
deriving (Generic)

type instance EraRuleFailure "UTXO" AllegraEra = AllegraUtxoPredFailure AllegraEra
1 change: 1 addition & 0 deletions eras/alonzo/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.13.0.0

* Made the fields of predicate failures and environments lazy
* Add `MemPack` instance for `Addr28Extra`, `DataHash32`, `AlonzoTxOut` and `PlutusScript AlonzoEra`
* Deprecate `hashAlonzoTxAuxData`
* Stop re-exporting deprecated `AuxiliaryDataHash` from `Cardano.Ledger.Alonzo.TxAuxData`
2 changes: 1 addition & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ import NoThunks.Class (NoThunks (..))

data AlonzoBbodyPredFailure era
= ShelleyInAlonzoBbodyPredFailure (ShelleyBbodyPredFailure era)
| TooManyExUnits !(Mismatch 'RelLTEQ ExUnits)
| TooManyExUnits (Mismatch 'RelLTEQ ExUnits)
deriving (Generic)

newtype AlonzoBbodyEvent era
42 changes: 21 additions & 21 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs
Original file line number Diff line number Diff line change
@@ -119,58 +119,58 @@ import Validation
data AlonzoUtxoPredFailure era
= -- | The bad transaction inputs
BadInputsUTxO
!(Set TxIn)
(Set TxIn)
| OutsideValidityIntervalUTxO
-- | transaction's validity interval
!ValidityInterval
ValidityInterval
-- | current slot
!SlotNo
| MaxTxSizeUTxO !(Mismatch 'RelLTEQ Integer)
SlotNo
| MaxTxSizeUTxO (Mismatch 'RelLTEQ Integer)
| InputSetEmptyUTxO
| FeeTooSmallUTxO !(Mismatch 'RelGTEQ Coin)
| ValueNotConservedUTxO !(Mismatch 'RelEQ (Value era))
| FeeTooSmallUTxO (Mismatch 'RelGTEQ Coin)
| ValueNotConservedUTxO (Mismatch 'RelEQ (Value era))
| -- | the set of addresses with incorrect network IDs
WrongNetwork
-- | the expected network id
!Network
Network
-- | the set of addresses with incorrect network IDs
!(Set Addr)
(Set Addr)
| WrongNetworkWithdrawal
-- | the expected network id
!Network
Network
-- | the set of reward addresses with incorrect network IDs
!(Set RewardAccount)
(Set RewardAccount)
| -- | list of supplied transaction outputs that are too small
OutputTooSmallUTxO
![TxOut era]
[TxOut era]
| -- | Subtransition Failures
UtxosFailure (PredicateFailure (EraRule "UTXOS" era))
| -- | list of supplied bad transaction outputs
OutputBootAddrAttrsTooBig
![TxOut era]
[TxOut era]
| -- Kept for backwards compatibility: no longer used because the `MultiAsset` type of mint doesn't allow for this possibility
TriesToForgeADA
| -- | list of supplied bad transaction output triples (actualSize,PParameterMaxValue,TxOut)
OutputTooBigUTxO
![(Integer, Integer, TxOut era)]
[(Integer, Integer, TxOut era)]
| InsufficientCollateral
-- | balance computed
!DeltaCoin
DeltaCoin
-- | the required collateral for the given fee
!Coin
Coin
| -- | The UTxO entries which have the wrong kind of script
ScriptsNotPaidUTxO
!(UTxO era)
| ExUnitsTooBigUTxO !(Mismatch 'RelLTEQ ExUnits)
(UTxO era)
| ExUnitsTooBigUTxO (Mismatch 'RelLTEQ ExUnits)
| -- | The inputs marked for use as fees contain non-ADA tokens
CollateralContainsNonADA !(Value era)
CollateralContainsNonADA (Value era)
| -- | Wrong Network ID in body
WrongNetworkInTxBody !(Mismatch 'RelEQ Network)
WrongNetworkInTxBody (Mismatch 'RelEQ Network)
| -- | slot number outside consensus forecast range
OutsideForecast
!SlotNo
SlotNo
| -- | There are too many collateral inputs
TooManyCollateralInputs !(Mismatch 'RelLTEQ Natural)
TooManyCollateralInputs (Mismatch 'RelLTEQ Natural)
| NoCollateralInputs
deriving (Generic)

16 changes: 8 additions & 8 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs
Original file line number Diff line number Diff line change
@@ -92,26 +92,26 @@ import Validation
-- | The Predicate failure type in the Alonzo Era. It embeds the Predicate
-- failure type of the Shelley Era, as they share some failure modes.
data AlonzoUtxowPredFailure era
= ShelleyInAlonzoUtxowPredFailure !(ShelleyUtxowPredFailure era)
= ShelleyInAlonzoUtxowPredFailure (ShelleyUtxowPredFailure era)
| -- | List of scripts for which no redeemers were supplied
MissingRedeemers
![(PlutusPurpose AsItem era, ScriptHash)]
[(PlutusPurpose AsItem era, ScriptHash)]
| MissingRequiredDatums
-- TODO: Make this NonEmpty #4066

-- | Set of missing data hashes
!(Set DataHash)
(Set DataHash)
-- | Set of received data hashes
!(Set DataHash)
(Set DataHash)
| NotAllowedSupplementalDatums
-- TODO: Make this NonEmpty #4066

-- | Set of unallowed data hashes
!(Set DataHash)
(Set DataHash)
-- | Set of acceptable supplemental data hashes
!(Set DataHash)
(Set DataHash)
| PPViewHashesDontMatch
!(Mismatch 'RelEQ (StrictMaybe ScriptIntegrityHash))
(Mismatch 'RelEQ (StrictMaybe ScriptIntegrityHash))
| -- | Set of witnesses which were needed and not supplied
MissingRequiredSigners -- TODO: remove once in Conway. It is now redundant. See #3972
(Set (KeyHash 'Witness))
@@ -121,7 +121,7 @@ data AlonzoUtxowPredFailure era
(Set TxIn)
| -- | List of redeemers not needed
ExtraRedeemers
![PlutusPurpose AsIx era]
[PlutusPurpose AsIx era]
deriving (Generic)

type instance EraRuleFailure "UTXOW" AlonzoEra = AlonzoUtxowPredFailure AlonzoEra
1 change: 1 addition & 0 deletions eras/babbage/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.11.0.0

* Made the fields of predicate failures and environments lazy
* Add `MemPack` instance for `BabbageTxOut` and `PlutusScript BabbageEra`
* Deprecate `Babbage` type synonym
* Remove crypto parametrization from `BabbageEra`
10 changes: 5 additions & 5 deletions eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs
Original file line number Diff line number Diff line change
@@ -108,20 +108,20 @@ import Validation (Validation, failureIf, failureUnless)

-- | Predicate failure for the Babbage Era
data BabbageUtxoPredFailure era
= AlonzoInBabbageUtxoPredFailure !(AlonzoUtxoPredFailure era) -- Inherited from Alonzo
= AlonzoInBabbageUtxoPredFailure (AlonzoUtxoPredFailure era) -- Inherited from Alonzo
| -- | The collateral is not equivalent to the total collateral asserted by the transaction
IncorrectTotalCollateralField
-- | collateral provided
!DeltaCoin
DeltaCoin
-- | collateral amount declared in transaction body
!Coin
Coin
| -- | list of supplied transaction outputs that are too small,
-- together with the minimum value for the given output.
BabbageOutputTooSmallUTxO
![(TxOut era, Coin)]
[(TxOut era, Coin)]
| -- | TxIns that appear in both inputs and reference inputs
BabbageNonDisjointRefInputs
!(NonEmpty TxIn)
(NonEmpty TxIn)
deriving (Generic)

type instance EraRuleFailure "UTXO" BabbageEra = BabbageUtxoPredFailure BabbageEra
8 changes: 4 additions & 4 deletions eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs
Original file line number Diff line number Diff line change
@@ -92,15 +92,15 @@ import NoThunks.Class (InspectHeapNamed (..), NoThunks (..))
import Validation (failureUnless)

data BabbageUtxowPredFailure era
= AlonzoInBabbageUtxowPredFailure !(AlonzoUtxowPredFailure era) -- TODO: embed and translate
= AlonzoInBabbageUtxowPredFailure (AlonzoUtxowPredFailure era) -- TODO: embed and translate
| -- | Embed UTXO rule failures
UtxoFailure !(PredicateFailure (EraRule "UTXO" era))
UtxoFailure (PredicateFailure (EraRule "UTXO" era))
| -- | the set of malformed script witnesses
MalformedScriptWitnesses
!(Set ScriptHash)
(Set ScriptHash)
| -- | the set of malformed script witnesses
MalformedReferenceScripts
!(Set ScriptHash)
(Set ScriptHash)
deriving (Generic)

type instance EraRuleFailure "UTXOW" BabbageEra = BabbageUtxowPredFailure BabbageEra
1 change: 1 addition & 0 deletions eras/conway/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.19.0.0

* Made the fields of predicate failures and environments lazy
* Add `MemPack` instance for `PlutusScript ConwayEra`
* Deprecate `Conway` type synonym
* Remove crypto parametrization from `ConwayEra`
Original file line number Diff line number Diff line change
@@ -561,14 +561,14 @@ ratifySignalL = lens unRatifySignal (\x y -> x {unRatifySignal = y})
instance EraPParams era => NFData (RatifySignal era)

data RatifyEnv era = RatifyEnv
{ reStakeDistr :: !(Map (Credential 'Staking) (CompactForm Coin))
, reStakePoolDistr :: !PoolDistr
, reDRepDistr :: !(Map DRep (CompactForm Coin))
, reDRepState :: !(Map (Credential 'DRepRole) DRepState)
, reCurrentEpoch :: !EpochNo
, reCommitteeState :: !(CommitteeState era)
, reDelegatees :: !(Map (Credential 'Staking) DRep)
, rePoolParams :: !(Map (KeyHash 'StakePool) PoolParams)
{ reStakeDistr :: Map (Credential 'Staking) (CompactForm Coin)
, reStakePoolDistr :: PoolDistr
, reDRepDistr :: Map DRep (CompactForm Coin)
, reDRepState :: Map (Credential 'DRepRole) DRepState
, reCurrentEpoch :: EpochNo
, reCommitteeState :: CommitteeState era
, reDelegatees :: Map (Credential 'Staking) DRep
, rePoolParams :: Map (KeyHash 'StakePool) PoolParams
}
deriving (Generic)

10 changes: 5 additions & 5 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Bbody.hs
Original file line number Diff line number Diff line change
@@ -91,12 +91,12 @@ maxRefScriptSizePerBlock :: Int
maxRefScriptSizePerBlock = 1024 * 1024 -- 1MiB

data ConwayBbodyPredFailure era
= WrongBlockBodySizeBBODY !(Mismatch 'RelEQ Int)
| InvalidBodyHashBBODY !(Mismatch 'RelEQ (Hash HASH EraIndependentBlockBody))
= WrongBlockBodySizeBBODY (Mismatch 'RelEQ Int)
| InvalidBodyHashBBODY (Mismatch 'RelEQ (Hash HASH EraIndependentBlockBody))
| -- | LEDGERS rule subtransition Failures
LedgersFailure !(PredicateFailure (EraRule "LEDGERS" era))
| TooManyExUnits !(Mismatch 'RelLTEQ ExUnits)
| BodyRefScriptsSizeTooBig !(Mismatch 'RelLTEQ Int)
LedgersFailure (PredicateFailure (EraRule "LEDGERS" era))
| TooManyExUnits (Mismatch 'RelLTEQ ExUnits)
| BodyRefScriptsSizeTooBig (Mismatch 'RelLTEQ Int)
deriving (Generic)

deriving instance
2 changes: 1 addition & 1 deletion eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ import GHC.Generics (Generic)
import NoThunks.Class (NoThunks)

data CertEnv era = CertEnv
{ cePParams :: !(PParams era)
{ cePParams :: PParams era
, ceCurrentEpoch :: EpochNo
-- ^ Lazy on purpose, because not all certificates need to know the current EpochNo
, ceCurrentCommittee :: StrictMaybe (Committee era)
8 changes: 4 additions & 4 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Certs.hs
Original file line number Diff line number Diff line change
@@ -86,8 +86,8 @@ import Lens.Micro
import NoThunks.Class (NoThunks (..))

data CertsEnv era = CertsEnv
{ certsTx :: !(Tx era)
, certsPParams :: !(PParams era)
{ certsTx :: Tx era
, certsPParams :: PParams era
, certsCurrentEpoch :: EpochNo
-- ^ Lazy on purpose, because not all certificates need to know the current EpochNo
, certsCurrentCommittee :: StrictMaybe (Committee era)
@@ -113,9 +113,9 @@ instance (EraPParams era, NFData (Tx era)) => NFData (CertsEnv era)
data ConwayCertsPredFailure era
= -- | Withdrawals that are missing or do not withdrawal the entire amount
WithdrawalsNotInRewardsCERTS
!(Map.Map RewardAccount Coin)
(Map.Map RewardAccount Coin)
| -- | CERT rule subtransition Failures
CertFailure !(PredicateFailure (EraRule "CERT" era))
CertFailure (PredicateFailure (EraRule "CERT" era))
deriving (Generic)

type instance EraRuleFailure "CERTS" ConwayEra = ConwayCertsPredFailure ConwayEra
16 changes: 8 additions & 8 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs
Original file line number Diff line number Diff line change
@@ -137,11 +137,11 @@ import NoThunks.Class (NoThunks (..))
import Validation (failureUnless)

data GovEnv era = GovEnv
{ geTxId :: !TxId
, geEpoch :: !EpochNo
, gePParams :: !(PParams era)
, gePPolicy :: !(StrictMaybe ScriptHash)
, geCertState :: !(CertState era)
{ geTxId :: TxId
, geEpoch :: EpochNo
, gePParams :: PParams era
, gePPolicy :: StrictMaybe ScriptHash
, geCertState :: CertState era
}
deriving (Generic)

@@ -165,11 +165,11 @@ data ConwayGovPredFailure era
| MalformedProposal (GovAction era)
| ProposalProcedureNetworkIdMismatch RewardAccount Network
| TreasuryWithdrawalsNetworkIdMismatch (Set.Set RewardAccount) Network
| ProposalDepositIncorrect !(Mismatch 'RelEQ Coin)
| ProposalDepositIncorrect (Mismatch 'RelEQ Coin)
| -- | Some governance actions are not allowed to be voted on by certain types of
-- Voters. This failure lists all governance action ids with their respective voters
-- that are not allowed to vote on those governance actions.
DisallowedVoters !(NonEmpty (Voter, GovActionId))
DisallowedVoters (NonEmpty (Voter, GovActionId))
| ConflictingCommitteeUpdate
-- | Credentials that are mentioned as members to be both removed and added
(Set.Set (Credential 'ColdCommitteeRole))
@@ -182,7 +182,7 @@ data ConwayGovPredFailure era
-- | The PrevGovActionId of the HardForkInitiation that fails
(StrictMaybe (GovPurposeId 'HardForkPurpose era))
-- | Its protocol version and the protocal version of the previous gov-action pointed to by the proposal
!(Mismatch 'RelGT ProtVer)
(Mismatch 'RelGT ProtVer)
| InvalidPolicyHash
-- | The policy script hash in the proposal
(StrictMaybe ScriptHash)
14 changes: 7 additions & 7 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/GovCert.hs
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ import Lens.Micro ((&), (.~), (^.))
import NoThunks.Class (NoThunks (..))

data ConwayGovCertEnv era = ConwayGovCertEnv
{ cgcePParams :: !(PParams era)
{ cgcePParams :: PParams era
, cgceCurrentEpoch :: EpochNo
-- ^ Lazy on purpose, because not all certificates need to know the current EpochNo
, cgceCurrentCommittee :: StrictMaybe (Committee era)
@@ -114,15 +114,15 @@ deriving instance EraPParams era => Show (ConwayGovCertEnv era)
deriving instance EraPParams era => Eq (ConwayGovCertEnv era)

data ConwayGovCertPredFailure era
= ConwayDRepAlreadyRegistered !(Credential 'DRepRole)
| ConwayDRepNotRegistered !(Credential 'DRepRole)
| ConwayDRepIncorrectDeposit !(Mismatch 'RelEQ Coin)
| ConwayCommitteeHasPreviouslyResigned !(Credential 'ColdCommitteeRole)
| ConwayDRepIncorrectRefund !(Mismatch 'RelEQ Coin)
= ConwayDRepAlreadyRegistered (Credential 'DRepRole)
| ConwayDRepNotRegistered (Credential 'DRepRole)
| ConwayDRepIncorrectDeposit (Mismatch 'RelEQ Coin)
| ConwayCommitteeHasPreviouslyResigned (Credential 'ColdCommitteeRole)
| ConwayDRepIncorrectRefund (Mismatch 'RelEQ Coin)
| -- | Predicate failure whenever an update to an unknown committee member is
-- attempted. Current Constitutional Committee and all available proposals will be
-- searched before reporting this predicate failure.
ConwayCommitteeIsUnknown !(Credential 'ColdCommitteeRole)
ConwayCommitteeIsUnknown (Credential 'ColdCommitteeRole)
deriving (Show, Eq, Generic)

type instance EraRuleFailure "GOVCERT" ConwayEra = ConwayGovCertPredFailure ConwayEra
50 changes: 25 additions & 25 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxo.hs
Original file line number Diff line number Diff line change
@@ -85,74 +85,74 @@ data ConwayUtxoPredFailure era
UtxosFailure (PredicateFailure (EraRule "UTXOS" era))
| -- | The bad transaction inputs
BadInputsUTxO
!(Set TxIn)
(Set TxIn)
| OutsideValidityIntervalUTxO
-- | transaction's validity interval
!ValidityInterval
ValidityInterval
-- | current slot
!SlotNo
SlotNo
| MaxTxSizeUTxO
!(Mismatch 'RelLTEQ Integer)
(Mismatch 'RelLTEQ Integer)
| InputSetEmptyUTxO
| FeeTooSmallUTxO
!(Mismatch 'RelGTEQ Coin) -- The values are serialised in reverse order
(Mismatch 'RelGTEQ Coin) -- The values are serialised in reverse order
| ValueNotConservedUTxO
!(Mismatch 'RelEQ (Value era)) -- Serialise consumed first, then produced
(Mismatch 'RelEQ (Value era)) -- Serialise consumed first, then produced
| -- | the set of addresses with incorrect network IDs
WrongNetwork
-- | the expected network id
!Network
Network
-- | the set of addresses with incorrect network IDs
!(Set Addr)
(Set Addr)
| WrongNetworkWithdrawal
-- | the expected network id
!Network
Network
-- | the set of reward addresses with incorrect network IDs
!(Set RewardAccount)
(Set RewardAccount)
| -- | list of supplied transaction outputs that are too small
OutputTooSmallUTxO
![TxOut era]
[TxOut era]
| -- | list of supplied bad transaction outputs
OutputBootAddrAttrsTooBig
![TxOut era]
[TxOut era]
| -- | list of supplied bad transaction output triples (actualSize,PParameterMaxValue,TxOut)
OutputTooBigUTxO
![(Int, Int, TxOut era)]
[(Int, Int, TxOut era)]
| InsufficientCollateral
-- | balance computed
!DeltaCoin
DeltaCoin
-- | the required collateral for the given fee
!Coin
Coin
| -- | The UTxO entries which have the wrong kind of script
ScriptsNotPaidUTxO
!(UTxO era)
(UTxO era)
| ExUnitsTooBigUTxO
!(Mismatch 'RelLTEQ ExUnits) -- The values are serialised in reverse order
(Mismatch 'RelLTEQ ExUnits) -- The values are serialised in reverse order
| -- | The inputs marked for use as fees contain non-ADA tokens
CollateralContainsNonADA !(Value era)
CollateralContainsNonADA (Value era)
| -- | Wrong Network ID in body
WrongNetworkInTxBody
!(Mismatch 'RelEQ Network) -- The values are serialised in reverse order
(Mismatch 'RelEQ Network) -- The values are serialised in reverse order
| -- | slot number outside consensus forecast range
OutsideForecast
!SlotNo
SlotNo
| -- | There are too many collateral inputs
TooManyCollateralInputs
!(Mismatch 'RelLTEQ Natural) -- The values are serialised in reverse order
(Mismatch 'RelLTEQ Natural) -- The values are serialised in reverse order
| NoCollateralInputs
| -- | The collateral is not equivalent to the total collateral asserted by the transaction
IncorrectTotalCollateralField
-- | collateral provided
!DeltaCoin
DeltaCoin
-- | collateral amount declared in transaction body
!Coin
Coin
| -- | list of supplied transaction outputs that are too small,
-- together with the minimum value for the given output.
BabbageOutputTooSmallUTxO
![(TxOut era, Coin)]
[(TxOut era, Coin)]
| -- | TxIns that appear in both inputs and reference inputs
BabbageNonDisjointRefInputs
!(NonEmpty TxIn)
(NonEmpty TxIn)
deriving (Generic)

type instance EraRuleFailure "UTXO" ConwayEra = ConwayUtxoPredFailure ConwayEra
34 changes: 17 additions & 17 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxow.hs
Original file line number Diff line number Diff line change
@@ -73,60 +73,60 @@ import NoThunks.Class (InspectHeapNamed (..), NoThunks (..))
data ConwayUtxowPredFailure era
= UtxoFailure (PredicateFailure (EraRule "UTXO" era))
| InvalidWitnessesUTXOW
![VKey 'Witness]
[VKey 'Witness]
| -- | witnesses which failed in verifiedWits function
MissingVKeyWitnessesUTXOW
-- | witnesses which were needed and not supplied
!(Set (KeyHash 'Witness))
(Set (KeyHash 'Witness))
| -- | missing scripts
MissingScriptWitnessesUTXOW
!(Set ScriptHash)
(Set ScriptHash)
| -- | failed scripts
ScriptWitnessNotValidatingUTXOW
!(Set ScriptHash)
(Set ScriptHash)
| -- | hash of the full metadata
MissingTxBodyMetadataHash
!TxAuxDataHash
TxAuxDataHash
| -- | hash of the metadata included in the transaction body
MissingTxMetadata
!TxAuxDataHash
TxAuxDataHash
| ConflictingMetadataHash
!(Mismatch 'RelEQ TxAuxDataHash)
(Mismatch 'RelEQ TxAuxDataHash)
| -- | Contains out of range values (string`s too long)
InvalidMetadata
| -- | extraneous scripts
ExtraneousScriptWitnessesUTXOW
!(Set ScriptHash)
(Set ScriptHash)
| MissingRedeemers
![(PlutusPurpose AsItem era, ScriptHash)]
[(PlutusPurpose AsItem era, ScriptHash)]
| MissingRequiredDatums
-- TODO: Make this NonEmpty #4066

-- | Set of missing data hashes
!(Set DataHash)
(Set DataHash)
-- | Set of received data hashes
!(Set DataHash)
(Set DataHash)
| NotAllowedSupplementalDatums
-- TODO: Make this NonEmpty #4066

-- | Set of unallowed data hashes.
!(Set DataHash)
(Set DataHash)
-- | Set of acceptable supplemental data hashes
!(Set DataHash)
(Set DataHash)
| PPViewHashesDontMatch
!(Mismatch 'RelEQ (StrictMaybe ScriptIntegrityHash))
(Mismatch 'RelEQ (StrictMaybe ScriptIntegrityHash))
| -- | Set of transaction inputs that are TwoPhase scripts, and should have a DataHash but don't
UnspendableUTxONoDatumHash
-- TODO: Make this NonEmpty #4066
(Set TxIn)
| -- | List of redeemers not needed
ExtraRedeemers ![PlutusPurpose AsIx era]
ExtraRedeemers [PlutusPurpose AsIx era]
| -- | Embed UTXO rule failures
MalformedScriptWitnesses
!(Set ScriptHash)
(Set ScriptHash)
| -- | the set of malformed script witnesses
MalformedReferenceScripts
!(Set ScriptHash)
(Set ScriptHash)
deriving (Generic)

type instance EraRuleFailure "UTXOW" ConwayEra = ConwayUtxowPredFailure ConwayEra
1 change: 1 addition & 0 deletions eras/shelley/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.16.0.0

* Made the fields of predicate failures and environments lazy
* Changed the type of `sgSecurityParam` to `NonZero Word64`
* Following functions now expect a `NonZero Word64` security parameter:
* `startStep`
12 changes: 6 additions & 6 deletions eras/shelley/impl/src/Cardano/Ledger/Chain.hs
Original file line number Diff line number Diff line change
@@ -48,14 +48,14 @@ pparamsToChainChecksPParams pp =

data ChainPredicateFailure
= HeaderSizeTooLargeCHAIN
!Int -- Header Size
!Word16 -- Max Header Size
Int -- Header Size
Word16 -- Max Header Size
| BlockSizeTooLargeCHAIN
!Word32 -- Block Size
!Word32 -- Max Block Size
Word32 -- Block Size
Word32 -- Max Block Size
| ObsoleteNodeCHAIN
!Version -- protocol version used
!Version -- max protocol version
Version -- protocol version used
Version -- max protocol version
deriving (Generic, Show, Eq, Ord)

instance NoThunks ChainPredicateFailure
36 changes: 18 additions & 18 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Deleg.hs
Original file line number Diff line number Diff line change
@@ -81,12 +81,12 @@ import Lens.Micro ((^.))
import NoThunks.Class (NoThunks (..))

data DelegEnv era = DelegEnv
{ slotNo :: !SlotNo
{ slotNo :: SlotNo
, deCurEpochNo :: EpochNo
-- ^ Lazy on purpose, because not all certificates need to know the current EpochNo
, ptr_ :: !Ptr
, acnt_ :: !AccountState
, ppDE :: !(PParams era) -- The protocol parameters are only used for the HardFork mechanism
, ptr_ :: Ptr
, acnt_ :: AccountState
, ppDE :: PParams era -- The protocol parameters are only used for the HardFork mechanism
}
deriving (Generic)

@@ -98,34 +98,34 @@ instance NFData (PParams era) => NFData (DelegEnv era)

data ShelleyDelegPredFailure era
= StakeKeyAlreadyRegisteredDELEG
!(Credential 'Staking) -- Credential which is already registered
(Credential 'Staking) -- Credential which is already registered
| StakeKeyNotRegisteredDELEG
!(Credential 'Staking) -- Credential which is not registered
(Credential 'Staking) -- Credential which is not registered
| StakeKeyNonZeroAccountBalanceDELEG
!Coin -- The remaining reward account balance
Coin -- The remaining reward account balance
| StakeDelegationImpossibleDELEG
!(Credential 'Staking) -- Credential that is not registered
(Credential 'Staking) -- Credential that is not registered
| WrongCertificateTypeDELEG -- The TxCertPool constructor should not be used by this transition
| GenesisKeyNotInMappingDELEG
!(KeyHash 'Genesis) -- Unknown Genesis KeyHash
(KeyHash 'Genesis) -- Unknown Genesis KeyHash
| DuplicateGenesisDelegateDELEG
!(KeyHash 'GenesisDelegate) -- Keyhash which is already delegated to
(KeyHash 'GenesisDelegate) -- Keyhash which is already delegated to
| InsufficientForInstantaneousRewardsDELEG
!MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
!(Mismatch 'RelLTEQ Coin)
MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
(Mismatch 'RelLTEQ Coin)
| MIRCertificateTooLateinEpochDELEG
!(Mismatch 'RelLT SlotNo)
(Mismatch 'RelLT SlotNo)
| DuplicateGenesisVRFDELEG
!(VRFVerKeyHash 'GenDelegVRF) -- VRF KeyHash which is already delegated to
(VRFVerKeyHash 'GenDelegVRF) -- VRF KeyHash which is already delegated to
| MIRTransferNotCurrentlyAllowed
| MIRNegativesNotCurrentlyAllowed
| InsufficientForTransferDELEG
!MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
!(Mismatch 'RelLTEQ Coin)
MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
(Mismatch 'RelLTEQ Coin)
| MIRProducesNegativeUpdate
| MIRNegativeTransfer
!MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
!Coin -- amount attempted to transfer
MIRPot -- which pot the rewards are to be drawn from, treasury or reserves
Coin -- amount attempted to transfer
deriving (Show, Eq, Generic)

type instance EraRuleFailure "DELEG" ShelleyEra = ShelleyDelegPredFailure ShelleyEra
16 changes: 8 additions & 8 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs
Original file line number Diff line number Diff line change
@@ -99,13 +99,13 @@ import NoThunks.Class (NoThunks (..))
import Validation (failureUnless)

data DelegsEnv era = DelegsEnv
{ delegsSlotNo :: !SlotNo
{ delegsSlotNo :: SlotNo
, delegsEpochNo :: EpochNo
-- ^ Lazy on purpose, because not all certificates need to know the current EpochNo
, delegsIx :: !TxIx
, delegspp :: !(PParams era)
, delegsTx :: !(Tx era)
, delegsAccount :: !AccountState
, delegsIx :: TxIx
, delegspp :: PParams era
, delegsTx :: Tx era
, delegsAccount :: AccountState
}

deriving stock instance
@@ -117,12 +117,12 @@ deriving stock instance
data ShelleyDelegsPredFailure era
= -- | Target pool which is not registered
DelegateeNotRegisteredDELEG
!(KeyHash 'StakePool)
(KeyHash 'StakePool)
| -- | Withdrawals that are missing or do not withdrawal the entire amount
WithdrawalsNotInRewardsDELEGS
!(Map RewardAccount Coin)
(Map RewardAccount Coin)
| -- | Subtransition Failures
DelplFailure !(PredicateFailure (EraRule "DELPL" era))
DelplFailure (PredicateFailure (EraRule "DELPL" era))
deriving (Generic)

type instance EraRuleFailure "DELEGS" ShelleyEra = ShelleyDelegsPredFailure ShelleyEra
12 changes: 6 additions & 6 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs
Original file line number Diff line number Diff line change
@@ -90,12 +90,12 @@ import NoThunks.Class (NoThunks (..))
-- ========================================================

data LedgerEnv era = LedgerEnv
{ ledgerSlotNo :: !SlotNo
, ledgerEpochNo :: !(Maybe EpochNo)
, ledgerIx :: !TxIx
, ledgerPp :: !(PParams era)
, ledgerAccount :: !AccountState
, ledgerMempool :: !Bool
{ ledgerSlotNo :: SlotNo
, ledgerEpochNo :: Maybe EpochNo
, ledgerIx :: TxIx
, ledgerPp :: PParams era
, ledgerAccount :: AccountState
, ledgerMempool :: Bool
}
deriving (Generic)

Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ import NoThunks.Class (NoThunks (..))
data ShelleyNewEpochPredFailure era
= EpochFailure (PredicateFailure (EraRule "EPOCH" era)) -- Subtransition Failures
| CorruptRewardUpdate
!RewardUpdate -- The reward update which violates an invariant
RewardUpdate -- The reward update which violates an invariant
| MirFailure (PredicateFailure (EraRule "MIR" era)) -- Subtransition Failures
deriving (Generic)

4 changes: 2 additions & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Newpp.hs
Original file line number Diff line number Diff line change
@@ -45,8 +45,8 @@ data ShelleyNewppState era
= NewppState (PParams era) (ShelleyGovState era)

data NewppEnv era = NewppEnv
{ neCertState :: !(CertState era)
, neUTxOState :: !(UTxOState era)
{ neCertState :: CertState era
, neUTxOState :: UTxOState era
}

instance
18 changes: 9 additions & 9 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Pool.hs
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ import Lens.Micro ((^.))
import NoThunks.Class (NoThunks (..))

data PoolEnv era
= PoolEnv !EpochNo !(PParams era)
= PoolEnv EpochNo (PParams era)
deriving (Generic)

instance EraPParams era => EncCBOR (PoolEnv era) where
@@ -90,18 +90,18 @@ instance NFData (PParams era) => NFData (PoolEnv era)

data ShelleyPoolPredFailure era
= StakePoolNotRegisteredOnKeyPOOL
!(KeyHash 'StakePool) -- KeyHash which cannot be retired since it is not registered
(KeyHash 'StakePool) -- KeyHash which cannot be retired since it is not registered
| StakePoolRetirementWrongEpochPOOL
!(Mismatch 'RelGT EpochNo)
!(Mismatch 'RelLTEQ EpochNo)
(Mismatch 'RelGT EpochNo)
(Mismatch 'RelLTEQ EpochNo)
| StakePoolCostTooLowPOOL
!(Mismatch 'RelGTEQ Coin)
(Mismatch 'RelGTEQ Coin)
| WrongNetworkPOOL
!(Mismatch 'RelEQ Network)
!(KeyHash 'StakePool) -- Stake Pool ID
(Mismatch 'RelEQ Network)
(KeyHash 'StakePool) -- Stake Pool ID
| PoolMedataHashTooBig
!(KeyHash 'StakePool) -- Stake Pool ID
!Int -- Size of the metadata hash
(KeyHash 'StakePool) -- Stake Pool ID
Int -- Size of the metadata hash
deriving (Eq, Show, Generic)

type instance EraRuleFailure "POOL" ShelleyEra = ShelleyPoolPredFailure ShelleyEra
10 changes: 5 additions & 5 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ppup.hs
Original file line number Diff line number Diff line change
@@ -90,23 +90,23 @@ data ShelleyPpupPredFailure era
-- `mismatchSupplied` ~ key hashes which were a part of the update.
-- `mismatchExpected` ~ key hashes of the genesis keys.
NonGenesisUpdatePPUP
!(Mismatch 'RelSubset (Set (KeyHash 'Genesis)))
(Mismatch 'RelSubset (Set (KeyHash 'Genesis)))
| -- | An update was proposed for the wrong epoch.
-- The first 'EpochNo' is the current epoch.
-- The second 'EpochNo' is the epoch listed in the update.
-- The last parameter indicates if the update was intended
-- for the current or the next epoch.
PPUpdateWrongEpoch
!EpochNo
!EpochNo
!VotingPeriod
EpochNo
EpochNo
VotingPeriod
| -- | An update was proposed which contains an invalid protocol version.
-- New protocol versions must either increase the major
-- number by exactly one and set the minor version to zero,
-- or keep the major version the same and increase the minor
-- version by exactly one.
PVCannotFollowPPUP
!ProtVer
ProtVer
deriving (Show, Eq, Generic)

type instance EraRuleFailure "PPUP" ShelleyEra = ShelleyPpupPredFailure ShelleyEra
2 changes: 1 addition & 1 deletion eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Rupd.hs
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ import GHC.Generics (Generic)
import NoThunks.Class (NoThunks (..))

data RupdEnv era
= RupdEnv !BlocksMade !(EpochState era)
= RupdEnv BlocksMade (EpochState era)

data ShelleyRupdPredFailure era -- No predicate failures
deriving (Show, Eq, Generic)
2 changes: 1 addition & 1 deletion eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Snap.hs
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ deriving instance Eq (SnapEvent era)

instance NFData (SnapEvent era)

data SnapEnv era = SnapEnv !(LedgerState era) !(PParams era)
data SnapEnv era = SnapEnv (LedgerState era) (PParams era)

instance EraTxOut era => STS (ShelleySNAP era) where
type State (ShelleySNAP era) = SnapShots
22 changes: 11 additions & 11 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs
Original file line number Diff line number Diff line change
@@ -170,27 +170,27 @@ instance (Era era, NFData (Event (EraRule "PPUP" era)), NFData (TxOut era)) => N

data ShelleyUtxoPredFailure era
= BadInputsUTxO
!(Set TxIn) -- The bad transaction inputs
(Set TxIn) -- The bad transaction inputs
| ExpiredUTxO
!(Mismatch 'RelLTEQ SlotNo)
(Mismatch 'RelLTEQ SlotNo)
| MaxTxSizeUTxO
!(Mismatch 'RelLTEQ Integer)
(Mismatch 'RelLTEQ Integer)
| InputSetEmptyUTxO
| FeeTooSmallUTxO
!(Mismatch 'RelGTEQ Coin)
(Mismatch 'RelGTEQ Coin)
| ValueNotConservedUTxO
!(Mismatch 'RelEQ (Value era))
(Mismatch 'RelEQ (Value era))
| WrongNetwork
!Network -- the expected network id
!(Set Addr) -- the set of addresses with incorrect network IDs
Network -- the expected network id
(Set Addr) -- the set of addresses with incorrect network IDs
| WrongNetworkWithdrawal
!Network -- the expected network id
!(Set RewardAccount) -- the set of reward addresses with incorrect network IDs
Network -- the expected network id
(Set RewardAccount) -- the set of reward addresses with incorrect network IDs
| OutputTooSmallUTxO
![TxOut era] -- list of supplied transaction outputs that are too small
[TxOut era] -- list of supplied transaction outputs that are too small
| UpdateFailure (EraRuleFailure "PPUP" era) -- Subtransition Failures
| OutputBootAddrAttrsTooBig
![TxOut era] -- list of supplied bad transaction outputs
[TxOut era] -- list of supplied bad transaction outputs
deriving (Generic)

type instance EraRuleFailure "UTXO" ShelleyEra = ShelleyUtxoPredFailure ShelleyEra
16 changes: 8 additions & 8 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs
Original file line number Diff line number Diff line change
@@ -113,26 +113,26 @@ import Validation

data ShelleyUtxowPredFailure era
= InvalidWitnessesUTXOW
![VKey 'Witness]
[VKey 'Witness]
| -- witnesses which failed in verifiedWits function
MissingVKeyWitnessesUTXOW
!(Set (KeyHash 'Witness)) -- witnesses which were needed and not supplied
(Set (KeyHash 'Witness)) -- witnesses which were needed and not supplied
| MissingScriptWitnessesUTXOW
!(Set ScriptHash) -- missing scripts
(Set ScriptHash) -- missing scripts
| ScriptWitnessNotValidatingUTXOW
!(Set ScriptHash) -- failed scripts
(Set ScriptHash) -- failed scripts
| UtxoFailure (PredicateFailure (EraRule "UTXO" era))
| MIRInsufficientGenesisSigsUTXOW (Set (KeyHash 'Witness))
| MissingTxBodyMetadataHash
!TxAuxDataHash -- hash of the full metadata
TxAuxDataHash -- hash of the full metadata
| MissingTxMetadata
!TxAuxDataHash -- hash of the metadata included in the transaction body
TxAuxDataHash -- hash of the metadata included in the transaction body
| ConflictingMetadataHash
!(Mismatch 'RelEQ TxAuxDataHash)
(Mismatch 'RelEQ TxAuxDataHash)
| -- Contains out of range values (strings too long)
InvalidMetadata
| ExtraneousScriptWitnessesUTXOW
!(Set ScriptHash) -- extraneous scripts
(Set ScriptHash) -- extraneous scripts
deriving (Generic)

type instance EraRuleFailure "UTXOW" ShelleyEra = ShelleyUtxowPredFailure ShelleyEra
Original file line number Diff line number Diff line change
@@ -793,7 +793,7 @@ data ImpTestEnv era = ImpTestEnv
LedgerState era ->
Tx era ->
BaseImpM ()
, iteCborRoundTripFailures :: !Bool
, iteCborRoundTripFailures :: Bool
-- ^ Expect failures in CBOR round trip serialization tests for predicate failures
}

Original file line number Diff line number Diff line change
@@ -150,12 +150,12 @@ chainStateNesL :: Lens' (ChainState era) (NewEpochState era)
chainStateNesL = lens chainNes $ \x y -> x {chainNes = y}

data TestChainPredicateFailure era
= RealChainPredicateFailure !ChainPredicateFailure
| BbodyFailure !(PredicateFailure (EraRule "BBODY" era)) -- Subtransition Failures
| TickFailure !(PredicateFailure (EraRule "TICK" era)) -- Subtransition Failures
| TicknFailure !(PredicateFailure (EraRule "TICKN" era)) -- Subtransition Failures
| PrtclFailure !(PredicateFailure (PRTCL MockCrypto)) -- Subtransition Failures
| PrtclSeqFailure !PrtlSeqFailure -- Subtransition Failures
= RealChainPredicateFailure ChainPredicateFailure
| BbodyFailure (PredicateFailure (EraRule "BBODY" era)) -- Subtransition Failures
| TickFailure (PredicateFailure (EraRule "TICK" era)) -- Subtransition Failures
| TicknFailure (PredicateFailure (EraRule "TICKN" era)) -- Subtransition Failures
| PrtclFailure (PredicateFailure (PRTCL MockCrypto)) -- Subtransition Failures
| PrtclSeqFailure PrtlSeqFailure -- Subtransition Failures
deriving (Generic)

data ChainEvent era
Original file line number Diff line number Diff line change
@@ -1180,9 +1180,9 @@ instance SpecTranslate ctx (EpochExecEnv era) where

-- | This type is used as the Env only in the Agda Spec
data ConwayExecEnactEnv era = ConwayExecEnactEnv
{ ceeeGid :: !GovActionId
, ceeeTreasury :: !Coin
, ceeeEpoch :: !EpochNo
{ ceeeGid :: GovActionId
, ceeeTreasury :: Coin
, ceeeEpoch :: EpochNo
}
deriving (Generic, Eq, Show)

Original file line number Diff line number Diff line change
@@ -57,10 +57,10 @@ applyTxMempoolEnv pp =
}

data ApplyTxEnv era = ApplyTxEnv
{ ateGlobals :: !Globals
, ateMempoolEnv :: !(MempoolEnv era)
, ateState :: !(LedgerState era)
, ateTx :: !(Tx era)
{ ateGlobals :: Globals
, ateMempoolEnv :: MempoolEnv era
, ateState :: LedgerState era
, ateTx :: Tx era
}
deriving (Generic)

Original file line number Diff line number Diff line change
@@ -212,8 +212,8 @@ data GenSize = GenSize
deriving (Show)

data GenEnv era = GenEnv
{ gePParams :: !(PParams era)
, geSize :: !GenSize
{ gePParams :: PParams era
, geSize :: GenSize
}

data GenState era = GenState
1 change: 1 addition & 0 deletions libs/cardano-protocol-tpraos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 1.4.0.0

* Made the fields of predicate failures and environments lazy
* Move `Crypto` and `StandardCrypto` definitions from `cardano-ledger-core` into new
`Cardano.Protocol.Crypto` module.
* Remove crypto parametrization from types:
Original file line number Diff line number Diff line change
@@ -61,8 +61,8 @@ import NoThunks.Class (NoThunks (..))
import Quiet

data OCertEnv = OCertEnv
{ ocertEnvStPools :: !(Set (KeyHash 'StakePool))
, ocertEnvGenDelegs :: !(Set (KeyHash 'GenesisDelegate))
{ ocertEnvStPools :: Set (KeyHash 'StakePool)
, ocertEnvGenDelegs :: Set (KeyHash 'GenesisDelegate)
}
deriving (Show, Eq)

Original file line number Diff line number Diff line change
@@ -32,25 +32,25 @@ data OCERT c

data OcertPredicateFailure
= KESBeforeStartOCERT
!KESPeriod -- OCert Start KES Period
!KESPeriod -- Current KES Period
KESPeriod -- OCert Start KES Period
KESPeriod -- Current KES Period
| KESAfterEndOCERT
!KESPeriod -- Current KES Period
!KESPeriod -- OCert Start KES Period
!Word64 -- Max KES Key Evolutions
KESPeriod -- Current KES Period
KESPeriod -- OCert Start KES Period
Word64 -- Max KES Key Evolutions
| CounterTooSmallOCERT
!Word64 -- last KES counter used
!Word64 -- current KES counter
Word64 -- last KES counter used
Word64 -- current KES counter
| InvalidSignatureOCERT
!Word64 -- OCert counter
!KESPeriod -- OCert KES period
Word64 -- OCert counter
KESPeriod -- OCert KES period
| InvalidKesSignatureOCERT
!Word -- current KES Period
!Word -- KES start period
!Word -- expected KES evolutions
!String -- error message given by Consensus Layer
Word -- current KES Period
Word -- KES start period
Word -- expected KES evolutions
String -- error message given by Consensus Layer
| NoCounterForKeyHashOCERT
!(KeyHash 'BlockIssuer) -- stake pool key hash
(KeyHash 'BlockIssuer) -- stake pool key hash
deriving (Show, Eq, Generic)

instance NoThunks OcertPredicateFailure
Original file line number Diff line number Diff line change
@@ -98,36 +98,36 @@ instance NoThunks OverlayEnv

data OverlayPredicateFailure c
= VRFKeyUnknown
!(KeyHash 'StakePool) -- unknown VRF keyhash (not registered)
(KeyHash 'StakePool) -- unknown VRF keyhash (not registered)
| VRFKeyWrongVRFKey
!(KeyHash 'StakePool) -- KeyHash of block issuer
!(VRFVerKeyHash 'StakePoolVRF) -- VRF KeyHash registered with stake pool
!(VRFVerKeyHash 'BlockIssuerVRF) -- VRF KeyHash from Header
(KeyHash 'StakePool) -- KeyHash of block issuer
(VRFVerKeyHash 'StakePoolVRF) -- VRF KeyHash registered with stake pool
(VRFVerKeyHash 'BlockIssuerVRF) -- VRF KeyHash from Header
| VRFKeyBadNonce
!Nonce -- Nonce constant to distinguish VRF nonce values
!SlotNo -- Slot used for VRF calculation
!Nonce -- Epoch nonce used for VRF calculation
!(VRF.CertifiedVRF (VRF c) Nonce) -- VRF calculated nonce value
Nonce -- Nonce constant to distinguish VRF nonce values
SlotNo -- Slot used for VRF calculation
Nonce -- Epoch nonce used for VRF calculation
(VRF.CertifiedVRF (VRF c) Nonce) -- VRF calculated nonce value
| VRFKeyBadLeaderValue
!Nonce -- Leader constant to distinguish VRF leader values
!SlotNo -- Slot used for VRF calculation
!Nonce -- Epoch nonce used for VRF calculation
!(VRF.CertifiedVRF (VRF c) Nonce) -- VRF calculated leader value
Nonce -- Leader constant to distinguish VRF leader values
SlotNo -- Slot used for VRF calculation
Nonce -- Epoch nonce used for VRF calculation
(VRF.CertifiedVRF (VRF c) Nonce) -- VRF calculated leader value
| VRFLeaderValueTooBig
!(VRF.OutputVRF (VRF c)) -- VRF Leader value
!Rational -- stake pool's relative stake
!ActiveSlotCoeff -- Praos active slot coefficient value
(VRF.OutputVRF (VRF c)) -- VRF Leader value
Rational -- stake pool's relative stake
ActiveSlotCoeff -- Praos active slot coefficient value
| NotActiveSlotOVERLAY
!SlotNo -- Slot which is supposed to be silent
SlotNo -- Slot which is supposed to be silent
| WrongGenesisColdKeyOVERLAY
!(KeyHash 'BlockIssuer) -- KeyHash of block issuer
!(KeyHash 'GenesisDelegate) -- KeyHash genesis delegate keyhash assigned to this slot
(KeyHash 'BlockIssuer) -- KeyHash of block issuer
(KeyHash 'GenesisDelegate) -- KeyHash genesis delegate keyhash assigned to this slot
| WrongGenesisVRFKeyOVERLAY
!(KeyHash 'BlockIssuer) -- KeyHash of block issuer
!(VRFVerKeyHash 'GenDelegVRF) -- VRF KeyHash registered with genesis delegation
!(VRFVerKeyHash 'BlockIssuerVRF) -- VRF KeyHash from Header
(KeyHash 'BlockIssuer) -- KeyHash of block issuer
(VRFVerKeyHash 'GenDelegVRF) -- VRF KeyHash registered with genesis delegation
(VRFVerKeyHash 'BlockIssuerVRF) -- VRF KeyHash from Header
| UnknownGenesisKeyOVERLAY
!(KeyHash 'Genesis) -- KeyHash which does not correspond to o genesis node
(KeyHash 'Genesis) -- KeyHash which does not correspond to o genesis node
| OcertFailure (PredicateFailure (OCERT c)) -- Subtransition Failures
deriving (Generic)

0 comments on commit 95907f5

Please sign in to comment.