Skip to content

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Oct 14, 2025

Description

This addresses the initial part of #5194 .

  1. Switch from exporting everything and hiding in the new era to exporting just the reusable parts and import the whole module in the new era.
  2. Move some more field definitions into core and reuse them.
  3. Name every field that is new in an era prefixed by that era-name.

Follow-up PRs would be to actually address the heart of #5194 to reduce duplication to a minimum.

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.

@aniketd aniketd changed the title Rename CDDL fields to better reflect their origin and more reuse Rename CDDL fields to better reflect their origin and be more reusable Oct 14, 2025
@aniketd aniketd force-pushed the aniketd/deduplicate-cddl branch from 9594784 to e2e3e15 Compare October 15, 2025 14:58
@aniketd aniketd marked this pull request as ready for review October 15, 2025 15:25
@aniketd aniketd requested a review from a team as a code owner October 15, 2025 15:25
Copy link
Contributor

@neilmayhew neilmayhew left a comment

Choose a reason for hiding this comment

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

Apart from the potential irregularity I commented on, this refactoring seems like it should make no difference to the CDDL.

Perhaps the test failures are due to the issue I pointed out?

Comment on lines -47 to +51
protocol_version = (major_protocol_version, uint)
protocol_version = [major_protocol_version, uint]
Copy link
Contributor

Choose a reason for hiding this comment

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

This change from group to array seems significant. However, I don't see any change in the .hs that matches this. I wonder where it's coming from?

I saw the same difference in some of the other eras.

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