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

Use separate serialization/types for ledger queries #4415

Open
amesgen opened this issue Jun 17, 2024 · 0 comments
Open

Use separate serialization/types for ledger queries #4415

amesgen opened this issue Jun 17, 2024 · 0 comments
Labels
cddl Issues related to cddl specification

Comments

@amesgen
Copy link
Member

amesgen commented Jun 17, 2024

The Local State Query mini-protocol supports a variety of messages involving types from Ledger (see here for the definition).
Currently, serialization of queries uses the {Enc,Dec,To,From}CBOR instances provided by ledger.

These ledger queries have to be backwards-compatible across node releases; only the serialization is allowed to vary (gated behind the NodeToClient version). However, it is currently easy to make mistakes here:

Both cases are currently handled by vendoring old Ledger code in Consensus. While this works, it is not ideal, rather, quoting @lehins:

There are three things that need to be done to solve this properly IMHO:

  • Separate types for queries, so that we don't get into situation like above where we can't roundtrip the result of the query because the type was expanded with new information
  • Separate type class that supports serialization versioning parameterized on NoteToClient protocol version.
  • CDDL specification for all types and versions (CDDL specs for ledger state queries #4396)
@lehins lehins added the cddl Issues related to cddl specification label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cddl Issues related to cddl specification
Projects
None yet
Development

No branches or pull requests

2 participants