Skip to content

Replace the Alonzo-based eons with ShelleyBasedEra - #19

Merged
carbolymer merged 3 commits into
masterfrom
mgalazyn/chore/remove-eons
Nov 3, 2026
Merged

carbolymer merged 3 commits into
masterfrom
mgalazyn/chore/remove-eons

Conversation

@carbolymer

@carbolymer carbolymer commented Nov 3, 2026 •

Copy link
Copy Markdown

This answers a remark on PR #17, which asked to remove the eons as much as possible and to use ShelleyBasedEra era where appropriate: #17 (comment)

ShelleyBasedEra is now the only era witness in the server. The JSON output does not change.

What changes

  • Removes AlonzoBasedEra, IsAlonzoBasedEra and ToShelleyBasedEra. Dijkstra gets its IsShelleyBasedEra instance.
  • Wrappers and encoders for values that exist only from Alonzo onwards take ShelleyBasedEra era together with PlutusEraConstraints era. It bundles EraPlutusContext era, EraTxCert era and Script era ~ AlonzoScript era.
  • Matches on those values list only the four Alonzo-onwards eras and have no error arms. The script equality makes GHC treat the pre-Alonzo arms as inaccessible, so writing one is a compile error.
  • PlutusEraConstraints is a plain constraint synonym, so no continuation-passing provider function is needed.
  • Adding an era now means one ShelleyBasedEra constructor, and -Werror flags every match that misses it.
  • Fixes four -Wincomplete-patterns warnings in the unit tests. All four are missing Dijkstra cases that already exist on master.
  • The test generator for redeemer pointers now covers Dijkstra. This regenerates 12 EvaluateTransactionResponse test vectors, with no schema failures.

Notes for reviewers

  • PlutusEraConstraints lives in Ogmios.Prelude, which already disables -Wredundant-constraints.
  • PlutusEraConstraints is left off Alonzo's and Babbage's encodeUtxoFailure, where nothing needs it.

Testing

  • The nix build passes with -Werror.
  • The unit suite passes on the rebased branch: 158 examples, 0 failures.
  • After the first two commits, all 737 test vectors came out byte-identical.

There is no user-facing change, so there is no changelog entry.

This PR is stacked on PR #17, so merge it after #17:

@carbolymer
carbolymer changed the base branch from master to mgalazyn/chore/bump-cardano-deps November 3, 2026 11:38
@carbolymer
carbolymer added this pull request to stack #18 November 3, 2026 11:39
@carbolymer carbolymer changed the title Mgalazyn/chore/remove eons Replace the Alonzo-based eons with ShelleyBasedEra Nov 3, 2026
Base automatically changed from mgalazyn/chore/bump-cardano-deps to master November 3, 2026 11:55
@carbolymer
carbolymer force-pushed the mgalazyn/chore/remove-eons branch 2 times, most recently from 7d3d069 to a30f46a Compare November 3, 2026 11:57
@carbolymer
carbolymer marked this pull request as ready for review November 3, 2026 12:27
@carbolymer carbolymer self-assigned this Nov 3, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/chore/remove-eons branch from a30f46a to 2f859a2 Compare November 3, 2026 13:31

@Jimbo4350 Jimbo4350 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM but consider the change I suggested in the comment.

Comment thread server/src/Ogmios/Prelude.hs Resolved
carbolymer and others added 3 commits November 3, 2026 17:11
Remove the AlonzoBasedEra, IsAlonzoBasedEra and ToShelleyBasedEra
eons. ShelleyBasedEra is now the only era witness, and Dijkstra gets
its IsShelleyBasedEra instance.

Wrappers and encoders for values that exist only from Alonzo onwards
take PlutusEraConstraints era. It bundles EraPlutusContext era,
EraTxCert era and Script era ~ AlonzoScript era. The script equality
makes the pre-Alonzo ShelleyBasedEra arms inaccessible, so matches on
them list only the Alonzo-onwards eras and no arm needs an error call.

The JSON output does not change.

Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
Four matches in the unit tests missed a constructor and raised
-Wincomplete-patterns warnings: the transaction id match in
TxMonitorSpec and three UTxO matches in JsonSpec. The Dijkstra
transaction id is now unwrapped like the other eras. The UTxO matches
fail the test with a clear message when they decode a Dijkstra UTxO.
The ScriptPurposeIndexInAnyEra generator covered only the eras before
Dijkstra. It now also produces Dijkstra purposes, which changes the
seeded test vectors, so they are regenerated.
@carbolymer
carbolymer force-pushed the mgalazyn/chore/remove-eons branch from 2f859a2 to ece6b41 Compare November 3, 2026 16:12
@carbolymer
carbolymer merged commit 7539f1f into master Nov 3, 2026
6 checks passed
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