Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Optimize integer-tagged choice validation #89

@Soupstraw

Description

@Soupstraw

In the ledger CDDL we represent the certificates as groups, where the first element of the group is a fixed integer which acts as a tag. Here's what the CDDL looks like:

certificate = 
  [  stake_registration
  // stake_deregistration
  // stake_delegation
  <...>
  ]

stake_registration = (0, stake_credential)

stake_deregistration = (1, stake_credential)

stake_delegation = (2, stake_credential, pool_keyhash)

<...>

I'm not sure how to solve this in the general case, probably there needs to be some complicated procedure that analyzes each of these choices to find a subterm that uniquely determines which choice is the right one. In our usecase however it should be pretty simple to add a heuristic that can handle cases where the first element of each of these groups is a unique integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions