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

create-script-context tool fails both in Babbage and Alonzo eras #583

Open
mkoura opened this issue Jul 11, 2022 · 2 comments
Open

create-script-context tool fails both in Babbage and Alonzo eras #583

mkoura opened this issue Jul 11, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@mkoura
Copy link

mkoura commented Jul 11, 2022

Summary

create-script-context fails with DeserialiseFailure in Babbage era when using with Alonzo-era transactions:

create-script-context --generate-tx test_minting_context_equivalance_ci0_qml_dummy_tx.signed --out-file test_minting_context_equivalance_ci0_qml_script_context.redeemer --cardano-mode --testnet-magic 42

create-script-context: DecoderFailure (LocalStateQuery HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) (': * (ShelleyBlock (AlonzoEra StandardCrypto)) ('[] *)))))) Query (BlockQuery (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) (': * (ShelleyBlock (AlonzoEra StandardCrypto)) ('[] *))))))))) ServerAgency TokQuerying BlockQuery (QueryIfCurrent (QS (QS (QS (QS (QZ GetCurrentPParams))))))) (DeserialiseFailure 14 "decodeNS: invalid index 5")

create-script-context fails with TextEnvelopeTypeError in Babbage era when using with Babbage-era transactions:

create-script-context --generate-tx test_minting_context_equivalance_ci0_xet_dummy_tx.signed --out-file test_minting_context_equivalance_ci0_xet_script_context.redeemer --cardano-mode --testnet-magic 42

create-script-context: Error creating redeemer from: test_minting_context_equivalance_ci0_xet_dummy_tx.signed Error: ReadTxBodyError (FileError "test_minting_context_equivalance_ci0_xet_dummy_tx.signed" (TextEnvelopeTypeError [TextEnvelopeType "Tx AlonzoEra"] (TextEnvelopeType "Tx BabbageEra")))
CallStack (from HasCallStack):
error, called at app/create-script-context.hs:69:21 in main:Main

Steps to reproduce the behavior

  1. generate dummy redeemer file, result looks like

{"fields":[{"list":[]},{"list":[]},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":0}}]}}]},{"fields":[{"fields":[{"fields":[{"int":42}],"constructor":1},{"fields":[],"constructor":1}],"constructor":0},{"fields":[{"fields":[],"constructor":2},{"fields":[],"constructor":1}],"constructor":0}],"constructor":0},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":0}}]}}]},{"list":[]},{"list":[]},{"list":[]},{"fields":[],"constructor":1}],"constructor":0}

  1. use the dummy redeemer to generate a dummy Tx
  2. derive the correct redeemer from the dummy Tx - while running the corresponding create-script-context command, it fails with DeserialiseFailure or TextEnvelopeTypeError

Actual Result

create-script-context fails in Babbage

Expected Result

The correct redeemer is derived from the dummy Tx.

Describe the approach you would take to fix this

No response

System info

OS: Fedora 35
Plutus apps: 07bbefd

@mkoura mkoura added the bug Something isn't working label Jul 11, 2022
@mkoura
Copy link
Author

mkoura commented Jul 11, 2022

Actually it doesn't work in Alonzo-era as well:

create-script-context --generate-tx test_minting_context_equivalance_ci0_iom_dummy_tx.signed --out-file test_minting_context_equivalance_ci0_iom_script_context.redeemer --cardano-mode --testnet-magic 42

create-script-context: DecoderFailure (LocalStateQuery HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) (': * (ShelleyBlock (AlonzoEra StandardCrypto)) ('[] *)))))) Query (BlockQuery (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) (': * (ShelleyBlock (AlonzoEra StandardCrypto)) ('[] *))))))))) ServerAgency TokQuerying BlockQuery (QueryIfCurrent (QS (QS (QS (QS (QZ GetUTxOWhole))))))) (DeserialiseFailure 3 "expected map len")\n

The Tx file used with the command -
test_minting_context_equivalance_ci0_iom_dummy_tx.signed.gz

@mkoura mkoura changed the title create-script-context tool doesn't work in Babbage era create-script-context tool fails both in Babbage and Alonzo eras Jul 11, 2022
@catch-21
Copy link
Contributor

@mkoura I can't reproduce your error. However, now that Testnet is in Babbage era I am getting a different error: DeserialiseFailure 181653839 "Decoding TxIx: too many bytes."

@Jimbo4350 It might be a good idea to ensure this is working before merging your jordan/v2-script-context-test branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants