Address issues in auto-generated CDDL specification
Description
This addresses issue https://github.com/IntersectMBO/cardano-ledger/issues/4462
- Moves some core type CDDL definitions to cardano-ledger-core
- Defines Shelley CDDL types through Huddle
- Adds huddle-based testing in Shelley
- Moves the Shelley CDDL to being auto-generated via the Huddle def
- Updates Conway to use some definitions from Shelley where they were unchanged
- Updates the gen-cddl.sh script to check Shelley definitions
One unexpected change: the huddle definition for protocol_param_updates has a size limit on the max block header size. This is consistent with the Haskell serialisers and data structure.
In addition, we add a couple of extra commits solving two issues:
- #4522 - we reintroduce the long explanations of various types which were subsequently not included in the generated CDDL.
- #4535 - we add a root element as the first element in the generated CDDL
Note that this PR now incorporates the contents of #4552
Checklist
- [x] 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.mdfor the affected packages. New section is never added with the code changes. (See RELEASING.md) - [ ] When applicable, versions are updated in
.cabalandCHANGELOG.mdfiles according to the versioning process. - [x] The version bounds in
.cabalfiles 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) - [x] Code is formatted with
fourmolu(usescripts/fourmolize.sh) - [x] Cabal files are formatted (use
scripts/cabal-format.sh) - [x]
hie.yamlhas been updated (usescripts/gen-hie.sh) - [x] Self-reviewed the diff
Note that this is now out-of-date with #4552 - I'll update after that one is merged.
In addition to documentation comments, is it possible to regroup definitions please. For example, currently the conway certificates definitions are all over the place. It seems they are sorted alphabetically, which isn’t useful.
Rebased on master, to remove the master-merge commit