Skip to content

Add CDDLs #1422

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Add CDDLs #1422

wants to merge 8 commits into from

Conversation

jasagredo
Copy link
Contributor

@jasagredo jasagredo commented Mar 13, 2025

Description

Add CDDL definitions for types that Consensus emits.

@ch1bo
Copy link

ch1bo commented Mar 14, 2025

Very nice! See cardano-scaling/cardano-blueprint#25 for an issue that aims to use these to create an api reference.

Copy link

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

Looks like a lot of work, but it's great that we finally have CDDLs for all these things. Also this module system looks quite good!


getCBOR.query = [9, shelleyQuery]

;# include getSystemStart as getSystemStart
Copy link

Choose a reason for hiding this comment

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

Does this mean that we need to provide ./consensus as an include path to cddlc? Would it be possible to say consensus/getSystemStart here and it would just work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do check the cddlc.sh script in this PR, it shows how one would run cddlc. You can run it to see the results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it be possible to say consensus/getSystemStart here and it would just work?

No, I don't think that works. I seem to recall I tried and was not able to use it.

unsafeIndefiniteSafeZone = [1]
genesisWindow = word64

;# import base
Copy link

Choose a reason for hiding this comment

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

Can we use qualified or explicit imports? Then it would be more clear which rules come from this library. For example we could have eraStart = base.bound

Copy link

Choose a reason for hiding this comment

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

@jasagredo I se you added this tool. How should I try using this? How do you imagine the developer experience overall?

Copy link
Contributor Author

@jasagredo jasagredo May 7, 2025

Choose a reason for hiding this comment

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

For now this tool gets all the contents of the CDDLs but it does nothing with them. I am using it locally to debug the CBOR validator I'm trying to implement in cuddle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

3 participants