Skip to content

Remove era prefix from rule names#5859

Open
Lucsanszky wants to merge 13 commits into
ldan/remove-rules-reexportsfrom
ldan/era-prefix-removal
Open

Remove era prefix from rule names#5859
Lucsanszky wants to merge 13 commits into
ldan/remove-rules-reexportsfrom
ldan/era-prefix-removal

Conversation

@Lucsanszky
Copy link
Copy Markdown
Contributor

@Lucsanszky Lucsanszky commented May 24, 2026

Description

Resolves #5831

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.

Lucsanszky added 13 commits May 23, 2026 14:32
- `ShelleyBBODY` -> `BBODY`
- `ShelleyDELEG` -> `DELEG`
- `ShelleyDELEGS` -> `DELEGS`
- `ShelleyDELPL` -> `DELPL`
- `ShelleyEPOCH` -> `EPOCH`
- `ShelleyLEDGER` -> `LEDGER`
- `ShelleyLEDGERS` -> `LEDGERS`
- `ShelleyMIR` -> `MIR`
- `ShelleyNEWEPOCH` -> `NEWEPOCH`
- `ShelleyNEWPP` -> `NEWPP`
- `ShelleyPOOL` -> `POOL`
- `ShelleyPOOLREAP` -> `POOLREAP`
- `ShelleyPPUP` -> `PPUP`
- `ShelleyRUPD` -> `RUPD`
- `ShelleySNAP` -> `SNAP`
- `ShelleyTICK` -> `TICK`
- `ShelleyTICKF` -> `TICKF`
- `ShelleyUPEC` -> `UPEC`
- `ShelleyUTXO` -> `UTXO`
- `ShelleyUTXOW` -> `UTXOW`
- `AllegraUTXO` -> `UTXO`
- `AllegraUTXOW` -> `UTXOW`
- `AlonzoBBODY` -> `BBODY`
- `AlonzoLEDGER` -> `LEDGER`
- `AlonzoUTXO` -> `UTXO`
- `AlonzoUTXOS` -> `UTXOS`
- `AlonzoUTXOW` -> `UTXOW`
- `BabbageLEDGER` -> `LEDGER`
- `BabbageUTXO` -> `UTXO`
- `BabbageUTXOS` -> `UTXOS`
- `BabbageUTXOW` -> `UTXOW`
- `ConwayBBODY` -> `BBODY`
- `ConwayCERT` -> `CERT`
- `ConwayCERTS` -> `CERTS`
- `ConwayDELEG` -> `DELEG`
- `ConwayENACT` -> `ENACT`
- `ConwayEPOCH` -> `EPOCH`
- `ConwayGOV` -> `GOV`
- `ConwayGOVCERT` -> `GOVCERT`
- `ConwayHARDFORK` -> `HARDFORK`
- `ConwayLEDGER` -> `LEDGER`
- `ConwayMEMPOOL` -> `MEMPOOL`
- `ConwayNEWEPOCH` -> `NEWEPOCH`
- `ConwayRATIFY` -> `RATIFY`
- `ConwayTICKF` -> `TICKF`
- `ConwayUTXO` -> `UTXO`
- `ConwayUTXOS` -> `UTXOS`
- `ConwayUTXOW` -> `UTXOW`
- `DijkstraBBODY` -> `BBODY`
- `DijkstraCERT` -> `CERT`
- `DijkstraGOV` -> `GOV`
- `DijkstraGOVCERT` -> `GOVCERT`
- `DijkstraLEDGER` -> `LEDGER`
- `DijkstraMEMPOOL` -> `MEMPOOL`
- `DijkstraSUBCERT` -> `SUBCERT`
- `DijkstraSUBCERTS` -> `SUBCERTS`
- `DijkstraSUBDELEG` -> `SUBDELEG`
- `DijkstraSUBGOV` -> `SUBGOV`
- `DijkstraSUBGOVCERT` -> `SUBGOVCERT`
- `DijkstraSUBLEDGER` -> `SUBLEDGER`
- `DijkstraSUBLEDGERS` -> `SUBLEDGERS`
- `DijkstraSUBPOOL` -> `SUBPOOL`
- `DijkstraSUBUTXO` -> `SUBUTXO`
- `DijkstraSUBUTXOW` -> `SUBUTXOW`
- `DijkstraUTXO` -> `UTXO`
- `DijkstraUTXOW` -> `UTXOW`
@Lucsanszky Lucsanszky force-pushed the ldan/era-prefix-removal branch from 08e8177 to 53e0586 Compare May 27, 2026 20:06
tellEvent $ TotalAdaPotsEvent adaPots
let pd' = ssStakeMarkPoolDistr (esSnapshots es0)
-- See `ShelleyNEWEPOCH` for details on the implementation
-- See `NEWEPOCH` for details on the implementation
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"See Shelley NEWEPOCH..."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
-- See `NEWEPOCH` for details on the implementation
-- See `Shelley.NEWEPOCH` for details on the implementation

Comment on lines 45 to 50
import Cardano.Ledger.Babbage.Rules (
BabbageUTXO,
BabbageUtxoPredFailure (..),
UTXO,
babbageEvalScriptsTxInvalid,
expectScriptsToPass,
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess we should qualify this import as Babbage, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, somehow this snuck in without qualification.

Comment thread eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Rules/Utxo.hs
@Lucsanszky
Copy link
Copy Markdown
Contributor Author

Although the ticket suggests that the changes should be carried out in 3 commits, I decided to do 2 commits per era (1 for the renames and 1 for the deprecation helper additions) and one separate commit for the CHANGELOG update. If this is undesirable, I can just squash them (which is easier than taking bigger commits apart, hence this initial fragmentation).

@Lucsanszky Lucsanszky marked this pull request as ready for review May 27, 2026 20:13
@Lucsanszky Lucsanszky requested a review from a team as a code owner May 27, 2026 20:13
Copy link
Copy Markdown
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Looks good. Couple of minor suggestions

Comment on lines 45 to 50
import Cardano.Ledger.Babbage.Rules (
BabbageUTXO,
BabbageUtxoPredFailure (..),
UTXO,
babbageEvalScriptsTxInvalid,
expectScriptsToPass,
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, somehow this snuck in without qualification.

tellEvent $ TotalAdaPotsEvent adaPots
let pd' = ssStakeMarkPoolDistr (esSnapshots es0)
-- See `ShelleyNEWEPOCH` for details on the implementation
-- See `NEWEPOCH` for details on the implementation
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
-- See `NEWEPOCH` for details on the implementation
-- See `Shelley.NEWEPOCH` for details on the implementation

data UTXO era

type AlonzoUTXO = UTXO

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There should be no newline between deprecation pragma and the type

Suggested change

Comment on lines +81 to +89
import Cardano.Ledger.Shelley.Rules.Deleg as X (DELEG, DelegEnv (..))
import Cardano.Ledger.Shelley.Rules.Delegs as X (DELEGS, DelegsEnv (..))
import Cardano.Ledger.Shelley.Rules.Delpl as X (DELPL, DelplEnv (..))
import Cardano.Ledger.Shelley.Rules.Ledger as X (LEDGER, LedgerEnv (..))
import Cardano.Ledger.Shelley.Rules.Ledgers as X (LEDGERS, ShelleyLedgersEnv (..))
import Cardano.Ledger.Shelley.Rules.NewEpoch as X (NEWEPOCH)
import Cardano.Ledger.Shelley.Rules.Pool as X (POOL, PoolEnv (..))
import Cardano.Ledger.Shelley.Rules.PoolReap as X (POOLREAP)
import Cardano.Ledger.Shelley.Rules.Ppup as X (PPUP, PpupEnv (..))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do not rename re-exports in this module. We want to re-export old deprecated names from here, not the new ones. That's because Cardano.Ledger.Shelley.API will eventually be removed.

This will force you change imports in some other places, which is exactly what we want.

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