Skip to content

Draft local state query serialization tests #1501

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 15 commits into
base: js/cddls
Choose a base branch
from
Draft

Conversation

ch1bo
Copy link

@ch1bo ch1bo commented May 9, 2025

Experimented with how we would want to test against CDDLs in https://github.com/cardano-scaling/cardano-blueprint/ from this repository.

This is incomplete, but I'd like to gather some feedback already on:

  • Ran into UTCTime not fully roundtripping because dayOfYear is clamped to [1, 366] - would we want that any CBOR that is valid against a CDDL to roundtrip, i.e. CBOR -> result -> CBOR?
  • I just composed the .cddl files, while @jasagredo started using cddl module extensions. However that requires cddlc and I was not feeling like packaging that for NixOS. Do we really want/need ;# include? If yes, is the cddlc gem the way to go or should we extend https://github.com/input-output-hk/cuddle?
  • Similarly, validating CBOR against CDDL can only be done with the cddl gem, which is not open source (anymore?) and it's error output is just insane (thousands of repeated lines of errors). Do we want Add support for validating CBOR input-output-hk/cuddle#7 instead?
  • How are you feeling about using a git submodule for cardano-blueprint?

@jasagredo
Copy link
Contributor

jasagredo commented May 9, 2025

Ran into UTCTime not fully roundtripping because dayOfYear is clamped to [1, 366] - would we want that any CBOR that is valid against a CDDL to roundtrip, i.e. CBOR -> result -> CBOR?

#1430

I just composed the .cddl files, while @jasagredo started using cddl module extensions. However that requires cddlc and I was not feeling like packaging that for NixOS. Do we really want/need ;# include? If yes, is the cddlc gem the way to go or should we extend https://github.com/input-output-hk/cuddle?

Concatenating is fine with simple examples, however I really doubt one can define the block CDDL keeping their sanity with only concat. I do think cddlc is the way to go. I do not think we should extend cuddle for this. I think it would be a waste of time re-implementing something that already exists just because we want to use our tool.

Similarly, validating CBOR against CDDL can only be done with the cddl gem, which is not open source (anymore?) and it's error output is just insane (thousands of repeated lines of errors). Do we want
input-output-hk/cuddle#7 instead?

I'm preparing a validator here: input-output-hk/cuddle#68. As opposed to cddlc, this feature I think is worth re-implementing because of how slow cddl is, and its very confusing and verbose output (at least for me!).

How are you feeling about using a git submodule for cardano-blueprint?

No objections from my side.


One thing that I would like to note here is that GetSystemStart is presumably one of the easiest specs. I want to warn not to commit to something that works for this simple case and then becomes a horrible nightmare to adapt it to the multi thousand lines CDDLs for blocks and others.

Note this suggestion is both for these ouroboros-consensus stuff as well as the CDDLs in the blueprint itself.

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