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

Fix CDDL for transaction witnesses #3922

Closed
4 tasks done
lehins opened this issue Dec 9, 2023 · 2 comments
Closed
4 tasks done

Fix CDDL for transaction witnesses #3922

lehins opened this issue Dec 9, 2023 · 2 comments
Assignees
Labels
cddl Issues related to cddl specification conway

Comments

@lehins
Copy link
Collaborator

lehins commented Dec 9, 2023

Current binary format for witnesses has some issues:

  • It allows duplicates, which are just discarded
  • It uses list syntax, where all of them are either sets or maps
  • Fields are optional, but they are also allowed to be empty

We need to solve all of those issues in Conway mostly in a backwards compatible manner.

We should split this task into two separate smaller ones, because deserializer

  1. Backwards incompatible changes:
  1. Future compatibility. Add alternative and more appropriate usage of:

Witnesses CDDL in the end for Conway should read:

transaction_witness_set =
  { ? 0: nonempty_set<vkeywitness>
  , ? 1: nonempty_set<native_script>
  , ? 2: nonempty_set<bootstrap_witness>
  , ? 3: nonempty_set<plutus_v1_script>
  , ? 4: nonempty_set<plutus_data>
  , ? 5: [+ redeemer ] / { + [ tag: redeemer_tag, index: uint ] => [data: plutus_data, ex_units: ex_units ] }
  , ? 6: nonempty_set<plutus_v2_script>
  , ? 7: nonempty_set<plutus_v3_script>
  }
@lehins lehins added the conway label Dec 9, 2023
@lehins lehins changed the title Improve CDDL for transaction witnesses Fix CDDL for transaction witnesses Dec 11, 2023
@lehins lehins assigned teodanciu and unassigned teodanciu Jan 9, 2024
@lehins
Copy link
Collaborator Author

lehins commented Jan 9, 2024

#3933 took care of some parts of this ticket that were possible with the current setup.

  • empty fields are no longer allowed
  • duplicate plutus scripts are not allowed either
  • plutus scripts have an optional set tag.

This is the current CDDL:

transaction_witness_set =
  { ? 0: [+ vkeywitness ]
  , ? 1: [+ native_script ]
  , ? 2: [+ bootstrap_witness ]
  , ? 3: nonempty_set<plutus_v1_script>
  , ? 4: [+ plutus_data ]
  , ? 5: [+ redeemer ]
  , ? 6: nonempty_set<plutus_v2_script>
  , ? 7: nonempty_set<plutus_v3_script>
  }

This means that we still need to fix theses fields: 0, 1, 2, 4, 5.

@lehins lehins mentioned this issue Jan 16, 2024
9 tasks
@lehins lehins self-assigned this Mar 8, 2024
@lehins lehins added this to Conway May 20, 2024
@lehins lehins moved this to To do in Conway May 20, 2024
@lehins lehins added the cddl Issues related to cddl specification label Aug 8, 2024
@lehins
Copy link
Collaborator Author

lehins commented Oct 15, 2024

Closing as Done. One part of it was converted into an issue and postponed till Dijkstra #4698

@lehins lehins closed this as completed Oct 15, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Conway Oct 15, 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 conway
Projects
Status: Done
Development

No branches or pull requests

2 participants