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

Error decoding redeemer when rendering transaction using cardano-cli #886

Open
ilap opened this issue Sep 6, 2024 · 4 comments
Open

Error decoding redeemer when rendering transaction using cardano-cli #886

ilap opened this issue Sep 6, 2024 · 4 comments

Comments

@ilap
Copy link

ilap commented Sep 6, 2024

Description

When attempting to render the redeemer of a transaction using cardano-cli with the command:
cardano-cli debug transaction view --output-json --tx-file ample.tx

The CLI shows the following error message:
Error decoding redeemer: unexpected CBOR token type for a JSON value: TypeTag

Note: It also fails rendering with --output-yaml too.

Expected result: The redeemer should be rendered as part of the transaction data in JSON format.

Steps to Reproduce

  1. Create a transaction that includes a redeemer.
  2. Run the cardano-cli with the following command: cardano-cli debug transaction view --output-json --tx-file <path-to-tx-file>
  3. Observe the error Error decoding redeemer: unexpected CBOR token type for a JSON value: TypeTag.

Additional Context

The error appears to occur while decoding the CBOR representation of the redeemer, where the redeemer's Plutus data contains tags. The decoding works correctly for redeemers using the Bigint Plutus type, such as [ 0, 0, 0, [123, 234]].

However, it fails when the redeemer contains tag-based Plutus types, such as [0, 0, 121([]), [123, 234]].

Cardano CLI version: 9.x.y.z (probably earlier are affected too).
Operating System: Ubuntu 22.04]

Possible Solution

A potential solution could involve reviewing the CBOR decoding logic to properly handle tags within redeemer data types.

@carbolymer
Copy link
Contributor

Would you mind attaching a failing transaction to the issue?

@ilap
Copy link
Author

ilap commented Sep 6, 2024

Would you mind attaching a failing transaction to the issue?

Here comes, but any tx with a redeemer contains a constructor (e.g. 121([]) ) would do:
tx_with_redeemer.json

@nabinpkl
Copy link

Cardano-cli just outputs null in the case of a redeemer containing a constructor (e.g. 121([]) ).
But we can verify that it indeed has a redeemer from manually decoding transaction cbor using https://cbor.me. The transaction decoding part should be looked into to facilitate tag-based plutus types.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

@github-actions github-actions bot added the Stale label Oct 17, 2024
@smelc smelc removed the Stale label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants