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

Bug: CBOR transformation fails with datum hash witness #179

Open
SynthLuvr opened this issue Aug 31, 2024 · 1 comment
Open

Bug: CBOR transformation fails with datum hash witness #179

SynthLuvr opened this issue Aug 31, 2024 · 1 comment

Comments

@SynthLuvr
Copy link

Example input:

{
  "type": "Tx MaryEra",
  "description": "Transaction in Mary era.",
  "cborHex": "84a5008282582085170c754845947bd9d9310dd9c1bd9a24bab0193bdf4f3f2637bd1e42805a341821825820ed03ad8431bd66752bb8cdfe77ad904a2adecec46c9660b6f578dddf38632472000183835839004bdb7fc45853faa68ce06cec6e3b0e61571943aa9558ce70a56d4a8da174c9bd3fb7949a1511b063abb687ca8959b09adc2bc8ffa9a8736e821a0013ed4aa1581c91d4f382273f442f15e9da48cb23349ba275f8818e4c7ac5d1004a16a1454d795553441a3b9aca0058204fc8b84b89c57f22747b798c1302e7d90d3cf4a6163703c39afbd1096522d85e82583900b84c3b9b23ab75ba5ed2ea6f04c53dbda489609fb6947fbb774772f31deed07726fe97b84b6c2d41ef7f313e2bb2f5e3af4e5a057fd03619821a0035610da1581c91d4f382273f442f15e9da48cb23349ba275f8818e4c7ac5d1004a16a1454d795553441a0007f45b825839000908dab66cf044669eff27e101f90641af29542ba5c72a0a313e3b2712b034d75b22c19eb0bbafe1a4abfc24ff180e4ecff78b054f0c65a9821a0011f436a1581c91d4f382273f442f15e9da48cb23349ba275f8818e4c7ac5d1004a16a1454d795553441b00000002186925a5021a0002fce9031a037c2f690b582058a9749c9e047fb4715b7f2a72c22772780e7b7ab7d0b5d56b546a14303ed8a7a10481d879815f5840486152413262516d524853325053647342416e744a513d3d3a42463230465a5564335a624538314a3367376d3772377035634a4a63755a594349436b6f7837555840594e4b2f7174646c6b7143625a564c35545772532b46436f303550566e5a4b616a6530596a4b2b6f4278316641446c733d3a312f72392b624a5a6d502b476537584051434a4276634e524d373341386c7633624e6e6276453036324f6c31343d3a32387a634b62504d7056503249714c6763707a3663724a77693551393876684b664b6e6d76333143787834513dfff5f6"
}
cardano-hw-cli transaction transform --tx-file tx.json --out-file tx.out.json

The resultant CBOR fails deserializaiton, with error such as

Deserialization failed in Transaction.witness_set.TransactionWitnessSet.plutus_data.PlutusList.PlutusDataEnum.PlutusDataEnum because: No variant matched

or

Transaction::from_bytes: Deserialization failed in Transaction.witness_set.TransactionWitnessSet.plutus_datums.NonemptySet.PlutusData.ConstrPlutusData.ConstrPlutusData.fields.PlutusData.Bytes because: Out of range: 203 - must be in range 0 - 64
@davidmisiak
Copy link
Collaborator

This seems to be caused by the limitation on bytestring length in the cardano specs (bounded_bytes) - the only way how to correctly encode a very long bytestring is using an indefinite-length bytestring, which is in conflict with the canonicalization performed by cardano-hw-cli transform.

This issue might get resolved when we tackle #177. We will investigate this further, thanks for the report.

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

No branches or pull requests

2 participants