Remove the unused ByronToAlonzoEra eon and the closed-range Shelley eons - #1260
Open
Jimbo4350 wants to merge 2 commits into
Open
Remove the unused ByronToAlonzoEra eon and the closed-range Shelley eons#1260Jimbo4350 wants to merge 2 commits into
Jimbo4350 wants to merge 2 commits into
Conversation
Jimbo4350
force-pushed
the
jordan/remove-byrontoalonzoera-eon
branch
from
July 20, 2026 20:16
247c755 to
226cd76
Compare
Jimbo4350
marked this pull request as ready for review
July 20, 2026 20:16
Jimbo4350
requested review from
CarlosLopezDeLara,
carbolymer,
disassembler,
erikd and
palas
as code owners
July 20, 2026 20:16
Jimbo4350
marked this pull request as draft
July 20, 2026 20:18
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is intended to remove the unused ByronToAlonzoEra closed-range eon from the cardano-api public surface (via Cardano.Api.Era) and from the library build plan.
Changes:
- Deletes the
Cardano.Api.Era.Internal.Eon.ByronToAlonzoEramodule and removes itsCardano.Api.Erare-export/import. - Updates
cardano-api.cabalto stop listingByronToAlonzoErainother-modules. - Adds a breaking-change changelog fragment in
.changes/.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToMaryEra.hs | Deleted module (note: currently conflicts with PR description and leaves dangling references elsewhere). |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToAlonzoEra.hs | Deleted module (note: currently conflicts with PR description and leaves dangling references elsewhere). |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToAllegraEra.hs | Deleted module (note: currently conflicts with PR description and leaves dangling references elsewhere). |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ByronToAlonzoEra.hs | Deletes the intended unused eon module. |
| cardano-api/src/Cardano/Api/Era.hs | Removes the ByronToAlonzoEra re-export/import, but still references deleted ShelleyTo* eons. |
| cardano-api/cardano-api.cabal | Removes ByronToAlonzoEra from other-modules, but still lists deleted ShelleyTo* eons. |
| .changes/20260720_remove_byrontoalonzoera_eon.yml | Marks the change as breaking, but description no longer matches the effective diff scope. |
Comments suppressed due to low confidence (1)
cardano-api/src/Cardano/Api/Era.hs:22
- This module still re-exports
ShelleyToAllegraEra,ShelleyToAlonzoEra, andShelleyToMaryEra, but those modules do not exist undercardano-api/src/Cardano/Api/Era/Internal/Eon/in this PR (onlyShelleyToBabbageErais present). This will fail to compile with “Could not find module …”. Either restore the removed eon modules, or remove these re-exports and update any dependent API (e.g. thecaseShelleyTo*helpers) accordingly.
, module Cardano.Api.Era.Internal.Eon.ShelleyToAllegraEra
, module Cardano.Api.Era.Internal.Eon.ShelleyToAlonzoEra
, module Cardano.Api.Era.Internal.Eon.ShelleyToBabbageEra
, module Cardano.Api.Era.Internal.Eon.ShelleyToMaryEra
Comment on lines
80
to
85
| import Cardano.Api.Era.Internal.Eon.AllegraEraOnwards | ||
| import Cardano.Api.Era.Internal.Eon.AlonzoEraOnwards | ||
| import Cardano.Api.Era.Internal.Eon.BabbageEraOnwards | ||
| import Cardano.Api.Era.Internal.Eon.ByronToAlonzoEra | ||
| import Cardano.Api.Era.Internal.Eon.Convert | ||
| import Cardano.Api.Era.Internal.Eon.ConwayEraOnwards | ||
| import Cardano.Api.Era.Internal.Eon.MaryEraOnwards |
Comment on lines
217
to
222
| Cardano.Api.Era.Internal.Eon.AllegraEraOnwards | ||
| Cardano.Api.Era.Internal.Eon.AlonzoEraOnwards | ||
| Cardano.Api.Era.Internal.Eon.BabbageEraOnwards | ||
| Cardano.Api.Era.Internal.Eon.ByronToAlonzoEra | ||
| Cardano.Api.Era.Internal.Eon.Convert | ||
| Cardano.Api.Era.Internal.Eon.ConwayEraOnwards | ||
| Cardano.Api.Era.Internal.Eon.MaryEraOnwards |
| pr: 1260 | ||
| kind: | ||
| - breaking | ||
| description: Remove the unused `ByronToAlonzoEra` eon (the `Cardano.Api.Era.Internal.Eon.ByronToAlonzoEra` module and its `Cardano.Api.Era` re-export); it had no consumers. |
Jimbo4350
force-pushed
the
jordan/remove-byrontoalonzoera-eon
branch
from
July 23, 2026 17:58
226cd76 to
846c74c
Compare
Deletes the Cardano.Api.Era.Internal.Eon.ByronToAlonzoEra module together with its cardano-api.cabal entry and Cardano.Api.Era re-export. The ByronToAlonzoEra eon has no consumers anywhere (cardano-api, cardano-cli or cardano-node), so this is a pure removal of dead public API.
…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.
Jimbo4350
force-pushed
the
jordan/remove-byrontoalonzoera-eon
branch
from
July 30, 2026 17:00
846c74c to
1dc1616
Compare
Jimbo4350
marked this pull request as ready for review
July 30, 2026 17:00
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.
Changelog
Context
Sunsets the dead closed-range eons in
cardano-api. Sister cleanup to the cardano-cli eon removal in IntersectMBO/cardano-cli#1397, which removed the last cardano-cli uses of these eons.Two commits:
1.
Remove the unused ByronToAlonzoEra eonByronToAlonzoEra(theCardano.Api.Era.Internal.Eon.ByronToAlonzoEramodule) had zero consumers anywhere — cardano-api, cardano-cli and cardano-node all referenced it only via the re-export. It had nocase…eliminator either. Deletes the module, itscardano-api.cabalentry, and theCardano.Api.Eraimport/re-export.2.
Replace closed-range eon eliminators with forEraInEon and remove the eonsRewrites the cardano-api call sites of
caseShelleyToAllegraOrMaryEraOnwards,caseShelleyToMaryOrAlonzoEraOnwardsandcaseShelleyToAlonzoOrBabbageEraOnwardstoforEraInEonon theCardanoEra, keyed on the survivingMaryEraOnwards,AlonzoEraOnwardsandBabbageEraOnwardseons, then deletes the three eliminators and the now-consumerlessShelleyToAllegraEra,ShelleyToAlonzoEraandShelleyToMaryEraeons (modules,Cardano.Api.Erare-exports,cardano-api.cabalentries).ShelleyToBabbageEraandcaseShelleyToBabbageOrConwayEraOnwardsare retained — they still have consumers.Behaviour is unchanged. Two sites needed more than a mechanical swap:
fromLedgerValue(Value/Internal) —forEraInEon's negative branch cannot supply theL.Value ~ Coinevidence that theShelleyToAllegraEralower branch provided, so the pre-Mary branch useslovelaceToValue (L.coin v)(identity onCoin).LedgerState.extraEntropy—ppExtraEntropyLneedsProtVerAtMost 6, whichforEraInEoncannot supply, so the pre-Babbage eras are matched onShelleyBasedEradirectly.How to trust this PR
git grep -E 'ByronToAlonzoEra|ShelleyToAllegraEra|ShelleyToMaryEra|ShelleyToAlonzoEra|caseShelleyToAllegraOrMaryEraOnwards|caseShelleyToMaryOrAlonzoEraOnwards|caseShelleyToAlonzoOrBabbageEraOnwards'returns nothing after this change.case<Lower>Or<Upper>EraOnwards l r sbebecomesforEraInEon (toCardanoEra sbe) <l applied to the lower branch> <r>, with the two exceptions called out above.cabal build cardano-api -j4(library, gen,cardano-api-testandcardano-api-goldenall compile).Downstream consumers must switch to
forEraInEon/inEonForEraontoCardanoEra era, hencetype: breaking.Checklist
.changes/