Skip to content

Fix failing cuddle test for Plutus data Constr.#5801

Open
koslambrou wants to merge 1 commit intomasterfrom
koslambrou/fix-cuddle-plutus-data
Open

Fix failing cuddle test for Plutus data Constr.#5801
koslambrou wants to merge 1 commit intomasterfrom
koslambrou/fix-cuddle-plutus-data

Conversation

@koslambrou
Copy link
Copy Markdown
Contributor

@koslambrou koslambrou commented May 5, 2026

Description

Triggered by:

cabal run cardano-ledger-conway:test:tests -- --match "/Conway era-specific/CDDL/Huddle/Decoding fails when term is zapped/plutus_data: MemoBytes (PlutusData ConwayEra)/" --seed 1615161393

The issue is that our list of allowed tags for the Constr data constructor of Plutus Data is not exhaustive enough. As per PlutusCore.Data, the allowed tags are 121-127, 1280-1400, and 102.

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@koslambrou koslambrou requested a review from a team as a code owner May 5, 2026 20:07
Copy link
Copy Markdown
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Good job at finding and fixing this. We've discussed this exact problem with @Soupstraw last week.
I am not sure if there is an actual ticket about this, but the solution we discussed was exactly what you implemented.

@koslambrou Could I please ask you for each PR to check all the relevant boxes in the PR description. I've explicitly unchecked the two that you missed in this one.

@koslambrou koslambrou force-pushed the koslambrou/fix-cuddle-plutus-data branch 4 times, most recently from 5e5ccc5 to 4f0ac4c Compare May 6, 2026 11:26
@koslambrou
Copy link
Copy Markdown
Contributor Author

koslambrou commented May 6, 2026

Could I please ask you for each PR to check all the relevant boxes in the PR description. I've explicitly unchecked the two that you missed in this one.

Yes of course. I should have put it in Draft mode.

I am not sure if there is an actual ticket about this

I looked for one, but didn't find one.

Copy link
Copy Markdown
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

I should have put it in Draft mode.

No worries. It didn't take much time to review it.

I looked for one, but didn't find one.

Yeah, we should have created one, considering that this issue was known.

@Soupstraw Could I please ask you to review this PR, since you are the one who independently discovered it as well and investigated it quite a bit.

-- @
-- (toChoice $ tag 102 (arr [a VUInt, a $ arr [0 <+ a x]]))
-- @
-- but 'toChoice' is not exported.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Soupstraw Let me know if it makes sense to expose toChoice.

@koslambrou koslambrou requested a review from Soupstraw May 6, 2026 16:35
@koslambrou koslambrou force-pushed the koslambrou/fix-cuddle-plutus-data branch 2 times, most recently from 2871db2 to 31c0294 Compare May 6, 2026 16:52
Triggered by:

```
cabal run cardano-ledger-conway:test:tests -- --match "/Conway era-specific/CDDL/Huddle/Decoding fails when term is zapped/plutus_data: MemoBytes (PlutusData ConwayEra)/" --seed 1615161393
```

The issue is that our list of allowed tags for the `Constr` data
constructor of Plutus `Data` is not exhaustive enough. As per
`PlutusCore.Data`, the allowed tags are 121-127, 1280-1400, and 102.
@koslambrou koslambrou force-pushed the koslambrou/fix-cuddle-plutus-data branch from 31c0294 to be2c9ef Compare May 6, 2026 16:52
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