Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define CDDL via Huddle in shelley-ma #4557

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Define CDDL via Huddle in shelley-ma #4557

wants to merge 13 commits into from

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented Aug 21, 2024

Description

Adds CDDL generation via Huddle in both Allegra and Mary eras.

Continues to address #4462

Note that this builds upon #4552 and #4553, which should be reviewed and merged first.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

nc6 and others added 13 commits August 19, 2024 10:11
Now that the CDDL is defined with Cuddle, we can
begin to properly modularise it. As a first step,
we move the common crypto and utility types into
the core package.
- Switch existing tests to using the generated CDDL
- Add additional Huddle based tests for Shelley types
- Add a tool to regenerate the Shelley CDDL from Huddle
- Move additional core types to the core CDDL
- Make a few fixes in the Shelley Huddle spec

There is one unusual thing here: the size bound on
the max block header size in the protocol param
update. This does not reflect the original CDDL,
but it is consistent with the FromCBOR instance
and the underlying data type in PParams. I can
only assume that the CDDL generator wasn't
exploring the whole range and thus never found
this error.
Now that Shelley is defined using Huddle, we can
rely on the relevant parts from Conway.
We use 'here' QuasiQuotes to make handling
multiline comments somewhat less painful.
This addresses issue #4535. The first rule in a
CDDL file is taken to be the root element.
Includes tests and generation utility.
Also includes testing and cddl generation tool.
@nc6 nc6 requested a review from lehins August 21, 2024 13:56
@nc6 nc6 changed the title Nc/4462 ma Define CDDL via Huddle in shelley-ma Aug 21, 2024
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