Skip to content

Correct the specification of the flat encoding of constr tags #7154

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kwxm
Copy link
Contributor

@kwxm kwxm commented Jun 18, 2025

Fixes cardano-scaling/cardano-blueprint#32
Fixes https://github.com/IntersectMBO/plutus-private/issues/1620

The specification said that tags in constr terms should be encoded using a bitstring of length 64. This is
incorrect: they should be encoded using the standard variable-length encoder for natural numbers.

See also #7149, which made the textual parser check tag values more carefully.

@kwxm kwxm requested a review from Unisay June 18, 2025 11:25
@kwxm kwxm added Specification Documentation No Changelog Required Add this to skip the Changelog Check labels Jun 18, 2025
@kwxm kwxm temporarily deployed to github-pages June 18, 2025 11:25 — with GitHub Actions Inactive
@kwxm kwxm changed the title Correct the flat encoding of constr tags Correct the specification of the flat encoding of constr tags Jun 18, 2025
$$ As in Appendix~\ref{appendix:data-cbor-encoding}, $\Nab{a}{b}$
denotes the closed interval of integers $\{n \in \Z : a \leq n \leq b\}$. Note
that $n$ here is a variable (not a fixed label) so we are defining whole
families of encoders $\E_1, \E_2, \E_3, \ldots$ and and decoders $\D_1, \D_2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"and and"

Copy link
Contributor

github-actions bot commented Jun 18, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/pr-7154/

Built to branch gh-pages at 2025-06-18 12:22 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@kwxm kwxm temporarily deployed to github-pages June 18, 2025 12:20 — with GitHub Actions Inactive
Copy link
Collaborator

@SeungheonOh SeungheonOh left a comment

Choose a reason for hiding this comment

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

Looks good

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

Successfully merging this pull request may close these issues.

Small discrepancy in the official UPLC spec w.r.t. constr term encoding
2 participants