Skip to content

Make Conway CERTS test era-generic - #6009

Draft
neilmayhew wants to merge 1 commit into
nm/failing-tx-subsetfrom
nm/conway-certs-test
Draft

Make Conway CERTS test era-generic#6009
neilmayhew wants to merge 1 commit into
nm/failing-tx-subsetfrom
nm/conway-certs-test

Conversation

@neilmayhew

@neilmayhew neilmayhew commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

The Conway CERTS test produces additional predicate failures in Dijkstra, so previously it was necessary to duplicate the code in a separate test for Dijkstra. By using the new test helper, submitFailingSubsetTx, it's possible for the Conway test to check that the given predicate failures are a subset of those actually produced, ie that all of the given failures are present. This enables the test to run in post-Conway eras.

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

Copilot AI lite review requested due to automatic review settings August 19, 2026 03:37
@neilmayhew
neilmayhew requested a review from a team as a code owner August 19, 2026 03:37
@neilmayhew
neilmayhew marked this pull request as draft August 19, 2026 03:41
@neilmayhew
neilmayhew changed the base branch from master to nm/failing-tx-subset August 19, 2026 03:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make the Conway CERTS imp-spec test run era-generically in all post-Conway eras by allowing tests to assert that expected predicate failures are a subset of the actual failures (to accommodate eras that emit additional failures).

Changes:

  • Add submitFailingSubsetTx / submitFailingSubsetTxM and switch Conway CERTS tests to assert subset-of predicate failures.
  • Strengthen constraints from Eq to Ord across STS and multiple ledger/core typeclasses and add many Ord instances to support set-based comparisons and derived ordering.
  • Add a GHC dictionary-evaluation workaround (-fno-spec-eval for GHC >= 9.10) and disable building/testing with GHC 9.8 in several components + CI.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libs/small-steps/testlib/Test/Control/State/Transition/Trace.hs Update doctest examples to include Ord for predicate failures.
libs/small-steps/test/Test/Control/State/Transition/Examples/Sum.hs Add Ord to example predicate failure.
libs/small-steps/test/Test/Control/State/Transition/Examples/GlobalSum.hs Add Ord to example predicate failure.
libs/small-steps/test/Test/Control/State/Transition/Examples/CommitReveal.hs Add Ord to example predicate failure type.
libs/small-steps/src/Control/State/Transition/Extended.hs Change STS superclass constraint from Eq to Ord for PredicateFailure; adjust STUB accordingly.
libs/small-steps/small-steps.cabal Bump small-steps version and adjust internal testlib dependency.
libs/small-steps/CHANGELOG.md Document STS constraint change; update version entry.
libs/cardano-protocol/src/Cardano/Protocol/TPraos/BlockHeader.hs Derive Ord for LastAppliedBlock.
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/Rules/Updn.hs Add Ord for UpdnPredicateFailure.
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/Rules/Prtcl.hs Add Ord instances and derive Ord for PrtlSeqFailure.
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/Rules/Overlay.hs Add Ord instance for OverlayPredicateFailure.
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/Rules/OCert.hs Derive Ord for OcertPredicateFailure.
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs Add GHC CPP guard for -fno-spec-eval and derive Ord for FutureLedgerViewError.
libs/cardano-protocol-tpraos/CHANGELOG.md Document added Ord instances.
libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal Bump small-steps bound and mark GHC 9.8 component buildability.
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Properties.hs Add CPP guard and require Ord for LEDGER predicate failures.
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/MockChain.hs Add CPP guard and add Ord constraints/instances for mock chain failures.
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/Basic.hs Remove an unused import.
libs/cardano-ledger-test/cardano-ledger-test.cabal Raise small-steps bound and mark GHC 9.8 buildability.
libs/cardano-ledger-core/src/Cardano/Ledger/Val.hs Strengthen Val constraint from Eq to Ord.
libs/cardano-ledger-core/src/Cardano/Ledger/State/Stake.hs Strengthen EraStake constraint to Ord (InstantStake era).
libs/cardano-ledger-core/src/Cardano/Ledger/State/Governance.hs Add Ord for FuturePParams.
libs/cardano-ledger-core/src/Cardano/Ledger/Plutus/TxInfo.hs Add Ord for TxOutSource.
libs/cardano-ledger-core/src/Cardano/Ledger/Plutus/ExUnits.hs Introduce OrdExUnits wrapper and related documentation.
libs/cardano-ledger-core/src/Cardano/Ledger/Plutus/Data.hs Add Ord for PlutusData and Data.
libs/cardano-ledger-core/src/Cardano/Ledger/MemoBytes/Internal.hs Add Ord instance for MemoBytes.
libs/cardano-ledger-core/src/Cardano/Ledger/Keys/Internal.hs Add Ord for VKey and move KeyHash/hashKey definitions here.
libs/cardano-ledger-core/src/Cardano/Ledger/Keys.hs Adjust imports due to KeyHash/hashKey relocation.
libs/cardano-ledger-core/src/Cardano/Ledger/Hashes.hs Remove local KeyHash definition; import from Keys.Internal.
libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs Add Ord constraints for EraTxOut and EraScript families.
libs/cardano-ledger-core/src/Cardano/Ledger/Compactible.hs Add Ord constraint for CompactForm a.
libs/cardano-ledger-core/src/Cardano/Ledger/Coin.hs Add Ord for CompactForm DeltaCoin.
libs/cardano-ledger-core/src/Cardano/Ledger/Address.hs Add Ord for Withdrawals and DirectDeposits.
libs/cardano-ledger-core/CHANGELOG.md Document new Ord constraints/instances.
libs/cardano-ledger-core/cardano-ledger-core.cabal Raise small-steps bounds.
libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Dijkstra/Base.hs Update OrdExUnits import to new location.
libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Base.hs Update OrdExUnits import to new location.
libs/cardano-ledger-conformance/cardano-ledger-conformance.cabal Raise small-steps bounds.
libs/cardano-data/src/Data/Set/NonEmpty.hs Derive Ord for NonEmptySet.
libs/cardano-data/src/Data/Map/NonEmpty.hs Derive Ord for NonEmptyMap.
libs/cardano-data/src/Data/CanonicalMaps.hs Rename pointWise to pointwise and export updated name.
libs/cardano-data/CHANGELOG.md Bump version and document new Ord instances.
libs/cardano-data/cardano-data.cabal Bump package version.
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/Chain.hs Add CPP guard and derive Ord for test predicate failures.
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/TxCert.hs Add CPP guard and derive Ord for cert predicate failures.
eras/shelley/test-suite/cardano-ledger-shelley-test.cabal Mark GHC 9.8 buildability.
eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs Add subset-failure submission helper and switch LEDGER failure constraint to Ord.
eras/shelley/impl/src/Cardano/Ledger/Shelley/TxOut.hs Add Ord instance for ShelleyTxOut.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Scripts.hs Add Ord for multisig scripts/raw forms.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs Add CPP guard and derive Ord for ShelleyUtxowPredFailure.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs Add Ord for failures and strengthen PPUP failure constraint to Ord.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ppup.hs Derive Ord for voting period and PPUP failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Pool.hs Derive Ord for pool predicate failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledgers.hs Add CPP guard and derive Ord for LEDGERS failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs Add CPP guard and derive Ord for LEDGER failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delpl.hs Add CPP guard and derive Ord for DELPL failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs Add CPP guard and derive Ord for DELEGS failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Deleg.hs Derive Ord for DELEG failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs Add CPP guard and derive Ord for BBODY failures.
eras/shelley/impl/src/Cardano/Ledger/Shelley/PParams.hs Add Ord for ProposedPPUpdates.
eras/shelley/impl/src/Cardano/Ledger/Shelley/Governance.hs Add Ord for governance state.
eras/shelley/impl/CHANGELOG.md Document new Ord instances.
eras/shelley/impl/cardano-ledger-shelley.cabal Update cardano-data and small-steps bounds; mark GHC 9.8 buildability.
eras/mary/impl/src/Cardano/Ledger/Mary/Value.hs Add Ord instances and update canonical map comparisons / representation helpers.
eras/mary/impl/CHANGELOG.md Document new Ord instances.
eras/mary/impl/cardano-ledger-mary.cabal Update cardano-data bounds.
eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/Imp.hs Remove unused language pragma.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/TxInfo.hs Add CPP guard and derive Ord for DijkstraContextError.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Tx.hs Adjust derived constraints to use CollectError and specific Tx labels.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Scripts.hs Derive Ord for native scripts.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Utxow.hs Add CPP guard and derive Ord for UTXOW failures.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Utxo.hs Add CPP guard; switch to OrdExUnits; derive Ord for UTXO failures.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubUtxow.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubUtxo.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubPool.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubLedgers.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubLedger.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubGovCert.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubGov.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubEntities.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubDeleg.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubCerts.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/SubCert.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Mempool.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Ledger.hs Add CPP guard and derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/GovCert.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Gov.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Entities.hs Derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Bbody.hs Add CPP guard; switch to OrdExUnits; derive Ord.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/PParams.hs Import OrdExUnits.
eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/BlockBody/Internal.hs Derive Ord for PerasCert.
eras/dijkstra/impl/CHANGELOG.md Document new Ord instances.
eras/dijkstra/impl/cardano-ledger-dijkstra.cabal Update cardano-data/small-steps bounds; mark GHC 9.8 buildability.
eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/CertsSpec.hs Switch failing-tx checks to subset-based helper.
eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs Run CERTS spec in Conway-and-later harness.
eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs Add Ord for ConwayContextError.
eras/conway/impl/src/Cardano/Ledger/Conway/Scripts.hs Derive Ord for Conway Plutus purpose types.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxow.hs Add CPP guard and derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxos.hs Switch to CollectError and add Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxo.hs Add CPP guard; switch to OrdExUnits; add Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Mempool.hs Add CPP guard and strengthen constraints to Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ledger.hs Add CPP guard and derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/GovCert.hs Derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Deleg.hs Derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Certs.hs Add CPP guard and derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs Add CPP guard and derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Bbody.hs Add CPP guard; switch to OrdExUnits; derive Ord.
eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs Import OrdExUnits.
eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs Derive Ord for voting procedures.
eras/conway/impl/CHANGELOG.md Document new Ord instances.
eras/conway/impl/cardano-ledger-conway.cabal Update small-steps bounds; mark GHC 9.8 buildability.
eras/byron/ledger/impl/cardano-ledger-byron.cabal Bump version and tighten bounds for byron spec deps; update small-steps bound.
eras/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Update/Properties.hs Add Ord for UBlockPredicateFailure.
eras/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Delegation/Properties.hs Add Ord for DBlockPredicateFailure.
eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Update.hs Add Ord to multiple predicate failure types.
eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOWS.hs Add Ord for UtxowsPredicateFailure.
eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOW.hs Add Ord for UtxowPredicateFailure.
eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXO.hs Add Ord for UtxoPredicateFailure.
eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Delegation.hs Add Ord for delegation predicate failure types and helpers.
eras/byron/ledger/executable-spec/CHANGELOG.md Bump version and document new Ord instances.
eras/byron/ledger/executable-spec/byron-spec-ledger.cabal Bump package version.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/SigCnt.hs Add Ord for SigcntPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Pbft.hs Add Ord for PbftPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Epoch.hs Add Ord for EpochPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Chain.hs Add Ord for ChainPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Bupi.hs Add Ord for BupiPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/BBody.hs Add Ord for BbodyPredicateFailure.
eras/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Block.hs Derive Ord for BlockHeader.
eras/byron/chain/executable-spec/CHANGELOG.md Bump version and document new Ord instances.
eras/byron/chain/executable-spec/byron-spec-chain.cabal Bump version and update spec-ledger dependency bounds.
eras/babbage/impl/src/Cardano/Ledger/Babbage/TxOut.hs Add Ord for BabbageTxOut.
eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs Add Ord for BabbageContextError.
eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs Add CPP guard; derive Ord; strengthen constraint to Ord for UTXOS failures.
eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxos.hs Strengthen PPUP failure constraint to Ord.
eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs Add CPP guard and derive Ord.
eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs Import OrdExUnits.
eras/babbage/impl/CHANGELOG.md Document added Ord instances.
eras/babbage/impl/cardano-ledger-babbage.cabal Update small-steps bounds; mark GHC 9.8 buildability.
eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/TreeDiff.hs Minor comment cleanup; keep ToExpr OrdExUnits.
eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxoSpec.hs Wrap ex-units mismatch with OrdExUnits.
eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/BbodySpec.hs Wrap ex-units mismatch with OrdExUnits.
eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Arbitrary.hs Update OrdExUnits import to new module.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxOut.hs Add Ord for compact address/data hashes and AlonzoTxOut.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs Add Ord for phase2 validity; switch constraints to CollectError.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs Add Ord constraints/instances for Plutus purposes and scripts.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs Add CPP guard and derive Ord.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs Switch to CollectError, strengthen constraints to Ord, add Ord instances for failure types.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs Add CPP guard; switch ExUnits mismatches to OrdExUnits; add Ord.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs Add CPP guard; switch ExUnits mismatches to OrdExUnits; add Ord.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PParams.hs Move OrdExUnits to core module and update fields/docs accordingly.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Plutus/TxInfo.hs Derive Ord for AlonzoContextError.
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Plutus/Context.hs Add CPP guard; strengthen EraPlutusContext to Ord; derive Ord for CollectError.
eras/alonzo/impl/CHANGELOG.md Document new Ord constraints/instances.
eras/alonzo/impl/cardano-ledger-alonzo.cabal Update cardano-data and small-steps bounds; mark GHC 9.8 buildability.
eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs Add Ord for timelock script types.
eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs Add Ord for UTXO predicate failures; strengthen PPUP constraint to Ord.
eras/allegra/impl/CHANGELOG.md Document new Ord instances.
eras/allegra/impl/cardano-ledger-allegra.cabal Update small-steps bounds.
.github/workflows/haskell.yml Remove GHC 9.8 from CI matrix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs
@neilmayhew
neilmayhew force-pushed the nm/conway-certs-test branch from a9e65cd to af01bab Compare August 19, 2026 16:43
@neilmayhew
neilmayhew force-pushed the nm/conway-certs-test branch from af01bab to b850fcb Compare August 19, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants