IntersectMBO / IntersectMBO/cardano-ledger

Autogenerated CDDL files are not following the CDDL Specification with regard to the root type.

Open
#4,535 6 comments 0 reactions 1 assignee Claimed by @nc6 View on GitHub
cddl ConwayEra
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

Eg, https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl

Defines the root type as `$hash28`.

The [RFC](https://datatracker.ietf.org/doc/rfc8610/) in section 2.2.4 defines the root type as:

```
There is no special syntax to identify the root of a CDDL data
structure definition: that role is simply taken by the first rule
defined in the file.
```

Disobeying this rule can cause breakage in tooling that consumes the file for code generation or automation purposes. This is because these tools are entitled to take the first rule, and discard anything in the file which is not referenced by it.

If the root rule of `conway.cddl` is the block, then it should always be listed first in the file.

Compare the new file to the old one:
https://github.com/IntersectMBO/cardano-ledger/blob/78b32d585fd4a0340fb2b184959fb0d46f32c8d2/eras/conway/impl/cddl-files/conway.cddl

Which does correctly have the root type as a block.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.