Skip to content

Conversation

@aniketd
Copy link
Contributor

@aniketd aniketd commented Oct 14, 2025

NOTE

This is deprecated in favour of potentially several new ones.

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?

Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

I had a first pass and left some comments.
In addition, I'm also wondering if it's beneficial to remove the distinction between the types in cddl that represent hashes vs just bytes (so the replacement of hash32 with bytes32).
Even though they boil down to the same thing, it might bring some value to distinguish them? What do you think?

Copy link
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.

I only took a quick look at this PR. I'll do a more thorough review tomorrow.

@aniketd aniketd changed the title Rename CDDL fields to better reflect their origin and be more reusable [DO NOT MERGE] Rename CDDL fields to better reflect their origin and be more reusable Oct 27, 2025
@lehins lehins marked this pull request as draft October 29, 2025 20:13
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.

5 participants