Replace closed-range eon eliminators with forEraInEon in cardano-cli#1397
Open
Jimbo4350 wants to merge 1 commit into
Open
Replace closed-range eon eliminators with forEraInEon in cardano-cli#1397Jimbo4350 wants to merge 1 commit into
Jimbo4350 wants to merge 1 commit into
Conversation
Jimbo4350
force-pushed
the
jordan/remove-eon-query-printabledatum
branch
from
July 20, 2026 19:51
7b8d3e5 to
c40539c
Compare
5 tasks
Jimbo4350
marked this pull request as ready for review
July 23, 2026 16:58
Jimbo4350
requested review from
carbolymer,
disassembler,
kevinhammond and
palas
as code owners
July 23, 2026 16:58
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors cardano-cli to stop using the deprecated/consumerless closed-range eon eliminators and instead dispatch via forEraInEon on CardanoEra, keyed off the remaining *EraOnwards witnesses. This aligns with the broader effort to remove eon witnesses in favor of ShelleyBasedEra era / experimental Era era, and unblocks deletion of the now-unused ShelleyTo* eons from cardano-api.
Changes:
- Replaced
caseShelleyTo*Or*EraOnwardseliminator usage withforEraInEonacross the four remaining call sites. - Updated the Shelley/Allegra “coin-only” branch in
toTxOutValueInShelleyBasedErato uselovelaceToTxOutValue(sinceforEraInEon’s negative branch doesn’t refine the ledger value type via the removed eon witness). - Added explicit constraint bring-into-scope where the old eliminators implicitly provided it (e.g.,
maryEraOnwardsConstraints).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs |
Switches datum rendering era-dispatch to forEraInEon with BabbageEraOnwards constraints. |
cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs |
Updates cost-models parser gating to use forEraInEon keyed by AlonzoEraOnwards. |
cardano-cli/src/Cardano/CLI/Compatible/Transaction/TxOut.hs |
Refactors TxOut value era gating to forEraInEon, using lovelaceToTxOutValue in the pre-Mary branch and explicit maryEraOnwardsConstraints in the Mary+ branch. |
cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs |
Refactors tx-out datum parsing era gating to forEraInEon keyed by AlonzoEraOnwards. |
.changes/remove-closed-range-eon-eliminators.yml |
Adds changelog fragment documenting the refactor and motivation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jimbo4350
added a commit
to IntersectMBO/cardano-api
that referenced
this pull request
Jul 23, 2026
…eons Rewrites the cardano-api call sites of caseShelleyToAllegraOrMaryEraOnwards, caseShelleyToMaryOrAlonzoEraOnwards and caseShelleyToAlonzoOrBabbageEraOnwards to forEraInEon on the CardanoEra, keyed on the surviving MaryEraOnwards, AlonzoEraOnwards and BabbageEraOnwards eons, then deletes the three eliminators and the now-consumerless ShelleyToAllegraEra, ShelleyToAlonzoEra and ShelleyToMaryEra eons (their modules, Cardano.Api.Era re-exports and cardano-api.cabal entries). Behaviour is unchanged. Mirrors IntersectMBO/cardano-cli#1397, which removed the last cardano-cli uses of these eons. ShelleyToBabbageEra and caseShelleyToBabbageOrConwayEraOnwards are retained. Two sites needed more than a mechanical swap: - fromLedgerValue (Value/Internal): forEraInEon's negative branch cannot supply the L.Value ~ Coin evidence the ShelleyToAllegraEra lower branch provided, so the pre-Mary branch uses lovelaceToValue (L.coin v) (identity on Coin). - LedgerState.extraEntropy: ppExtraEntropyL needs ProtVerAtMost 6, which forEraInEon cannot supply, so the pre-Babbage eras are matched on ShelleyBasedEra directly.
Replace the caseShelleyToAllegraOrMaryEraOnwards, caseShelleyToAlonzoOrBabbageEraOnwards and caseShelleyToMaryOrAlonzoEraOnwards eon eliminators with forEraInEon in transaction, query and governance option parsing. No behavioural change. This removes the last cardano-cli uses of the ShelleyToAllegraEra, ShelleyToAlonzoEra and ShelleyToMaryEra eons.
Jimbo4350
force-pushed
the
jordan/remove-eon-query-printabledatum
branch
from
July 23, 2026 20:07
c40539c to
d376ca1
Compare
carbolymer
approved these changes
Jul 23, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Part of removing eon witnesses from
cardano-cliin favour ofShelleyBasedEra era/ the experimentalEra era.This PR rewrites the four
cardano-clicall sites of the closed-range eon eliminators to useforEraInEonon theCardanoEra, keyed on the surviving*EraOnwardseon:Compatible/Transaction/TxOut.hstoTxOutValueInShelleyBasedEracaseShelleyToAllegraOrMaryEraOnwardsforEraInEon(MaryEraOnwards)EraBased/Query/Run.hsprintableDatumcaseShelleyToAlonzoOrBabbageEraOnwardsforEraInEon(BabbageEraOnwards)Compatible/Transaction/Option.hspTxOutDatumcaseShelleyToMaryOrAlonzoEraOnwardsforEraInEon(AlonzoEraOnwards)EraBased/Governance/Actions/Option.hspCostModelsFilecaseShelleyToMaryOrAlonzoEraOnwardsforEraInEon(AlonzoEraOnwards)This removes the last
cardano-cliuses ofShelleyToAllegraEra,ShelleyToAlonzoEraandShelleyToMaryEra, which unblocks deleting those (consumerless) eons fromcardano-api.How to trust this PR
Behaviour is unchanged at every site —
forEraInEon's negative branch fires for exactly the same sub-cutoff eras thecaseShelleyToXOr…lower branch did.Verified with
cabal build cardano-cli -j4(lib, exe, and golden tests compile and link).Checklist
.changes/