Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

create-script-context fails with DeserialiseFailure #448

Closed
mkoura opened this issue May 4, 2022 · 7 comments
Closed

create-script-context fails with DeserialiseFailure #448

mkoura opened this issue May 4, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@mkoura
Copy link

mkoura commented May 4, 2022

Summary

create-script-context fails with DeserialiseFailure:

create-script-context --generate-tx test_minting_context_equivalance_ci0_tph_dummy_tx.signed --out-file test_minting_context_equivalance_ci0_tph_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'

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

Actual Result

create-script-context fails with DeserialiseFailure

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: fdb0eec477fc0f99f5edfdbc11c041dbd35ca6bb

@catch-21
Copy link
Contributor

catch-21 commented May 4, 2022

Works for me on testnet. Had success with dummy redeemer or simple int, with both spending script and minting policy transactions. E.g.

create-script-context --generate-tx signed-tx --testnet-magic 1097911063 --out-file tmp
cat tmp
{"fields":[{"list":[{"fields":[{"fields":[{"fields":[{"bytes":"cf3fd78fe693b5a67d7194332445a349edd74bd36e26a561572fd3fa"}],"constructor":0},{"fields":[],"constructor":1}],"constructor":0},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":244932836}}]}}]},{"fields":[],"constructor":1}],"constructor":0},{"fields":[{"fields":[{"fields":[{"bytes":"f778997b5e0fcaec19b7580bc23d010d24de9eea16f0275b5e766046"}],"constructor":0},{"fields":[],"constructor":1}],"constructor":0},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":1500000}}]}}]},{"fields":[],"constructor":1}],"constructor":0}]},{"list":[{"fields":[{"fields":[{"fields":[{"bytes":"b204b4554a827178b48275629e5eac9bde4f5350badecfcd108d87446f00bf26"}],"constructor":0},{"int":0}],"constructor":0},{"fields":[{"fields":[{"fields":[{"bytes":"f778997b5e0fcaec19b7580bc23d010d24de9eea16f0275b5e766046"}],"constructor":0},{"fields":[],"constructor":1}],"constructor":0},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":243999514}}]}}]},{"fields":[],"constructor":1}],"constructor":0}],"constructor":0},{"fields":[{"fields":[{"fields":[{"bytes":"ffcb1a4c23538cbf3c1a2b4fe7fa795153d83ea8c16ec0b5b65497d492e17411"}],"constructor":0},{"int":0}],"constructor":0},{"fields":[{"fields":[{"fields":[{"bytes":"67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"}],"constructor":1},{"fields":[],"constructor":1}],"constructor":0},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":2610000}}]}}]},{"fields":[{"bytes":"9e1199a988ba72ffd6e9c269cadb3b53b5f360ff99f112d9b2ee30c4d74ad88b"}],"constructor":0}],"constructor":0}],"constructor":0}]},{"map":[{"k":{"bytes":""},"v":{"map":[{"k":{"bytes":""},"v":{"int":0}}]}}]},{"fields":[{"fields":[{"fields":[],"constructor":0},{"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":176678}}]}}]},{"list":[{"fields":[{"bytes":"9e1199a988ba72ffd6e9c269cadb3b53b5f360ff99f112d9b2ee30c4d74ad88b"},{"int":42}],"constructor":0}]},{"list":[]},{"list":[]},{"fields":[{"fields":[{"fields":[{"fields":[{"bytes":"ffcb1a4c23538cbf3c1a2b4fe7fa795153d83ea8c16ec0b5b65497d492e17411"}],"constructor":0},{"int":0}],"constructor":0}],"constructor":1}],"constructor":0}],"constructor":0}

@mkoura
Copy link
Author

mkoura commented May 4, 2022

I'm using cardano-node master, IntersectMBO/cardano-node@65422ff

I see the error from the issue description for both spending and minting scripts. Tx e.g.

{
    "type": "Tx AlonzoEra",
    "description": "",
    "cborHex": "84a900818258209a9c683025578fddd329bc20de64c80d24b2a8077df72a20d2bc2df69fd7fcec000d818258209a9c683025578fddd329bc20de64c80d24b2a8077df72a20d2bc2df69fd7fcec01018182581d60eba8ec7ffdbe591df186528ba5e446d2f9ac6b6faab0962575a75e5b821a001e8480a1581c8f1668555e81a47cc873dabb2016cca1c0603cb4f7bc9afb785bb03fa14a7161636f696e766a626f05021a00054252031a000eaa6a08010e81581c520719ebd328d3bd3a403a29dadaf6981bbddb5e8ff4e47d3f767f2609a1581c8f1668555e81a47cc873dabb2016cca1c0603cb4f7bc9afb785bb03fa14a7161636f696e766a626f050b5820a3160b4c9b09fd23cd1c18e6155ebcd7b39dcd927129b97da5fd6f4ad489cc6ca300828258208dc60533b5dfa60a530955a696323a2ef4f14e8bc95a8f84cf6c441fea4234275840e09901ba6990ef86186187b4eb43f3d570da6ead8b54a3c4648e53d632fa5919c97262e02b6f244c41008e16cfb941e6803d4b26de5d0eecdf62b0abe5c1c40b82582078d66616cd6c9e9276b0e0dd976f19fd34236bc2a29bf66f4cb34b317cd5097b584035cb89a1979dbe8e6a7dc9acd505a706ec39a61ceeea8a2ffad0075e48d7d49dc9f80e31b6c087db89bdfb7178107253bed19e72129d0b0f1f6b3c9c146d440f0381591109591106010000323232332233322233223233322233322233333333222222223322333332222233332222333222332233223322333222332233223322332232323232323232323232323232323232323232323232323232332233223232323232323232332232323322323232333322223322323232323232323232323232323232323232323232323232323350015037005122223005330033004002300600125335305e001107c13504c35307b3357389210250640007c4988c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c26606aa002a0042600c6ae8540084c120d5d09aba25001135573ca00226ea80084d412d262323232323232323232323232323232323232323232323333573466e1cd55cea80aa40004a0044a02e93099999999998232800a8012801a8022802a8032803a8042804a805099a82b0249aba15012133505504935742a0202666aa0a0eb9413cd5d0a8070999aa827bae504e35742a018266a0a40aa6ae8540284cd4144cd54140155d69aba15008133504675a6ae8540184cd413dd71aba15004133504e335504d75c0986ae8540084c150d5d09aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135573ca00226ea80084d4129262235304b002222222222325335306633301003400835303a50012222222222007153353066333503603435303a500122222222220040071323232533530693001335530101200135303d5004222222222200335012122330024800800454cd4d418001484cc0d0004d4c0f003c880044d415d26106a35001200112300135508c012253353508901001106b2213535508e01002225335306e33044002500810701300600313503d00310671067135303700a2200235001200112300135507d22112253353507c0021507e22153353507e00315080012213350810133550840100400233553008120010030011233500150785079222333004233353550170012330054800000488cc0180080048cc01400520000020012223233355300e120013501c501a23535507c0012233355301112001500423535507f00122300a0010013300500300213501b501922335530091200123535507900122335507c002333535501600123355300d1200123535507d0012233550800100235501d0010012233355500803100200123355300d1200123535507d0012233550800100235501b00100133355500302c002001111222333553004120015076335530091200123535507900122335507c00235501900133355300412001223535507a002225335305a33355300f120013500a501323535507d001223300a0020050061003133507a00400350770013355300912001235355079001223232335507e004300100635001200112300135507e2253353507b001135501a004221353550800100222533530603300d0020091335501f00800113006003002350012001123001355076221122253353507600110022213300500233355300712001005004001123350162233350050030020013500200112353500b0012200112353500a00122002350012001123001355071221122533535070001150722213350733004002335530061200100400135001200112300135506f22112322253353507000113500800422133500530040023335530081200100600400113500600112353500e0012200112353500d0012200213350030010482253353048002104a1001122123300100300212001112122230030041122122233002005004112122230010041120011335008001041225335304000210011041123350032233350070030020013500400112212330010030021200112353500300122001123535002001220021221233001003002120012233335303f0022533335304000221330060020012103b2103b2103b253333530400022103b21330100020012103b2103b253333530400022103b2103b21330070020012103b253333530400022103b2103b2103b21330050020012253353037333573466e3cd4c10c00888008d4c10c004880080e40e04ccd5cd19b8735304300222001353043001220010390381038225333333353044002215333333353045002213300500200122103a210391038103822103a22103a22153333333530460032103a2215335303a33007004002133010003001103b2103a1039103922103b22103b2153333333530450022103922103a21330050020011038103822103a22103a153333333530440012103822103921038103810372210392210391533333335304400121038221039210381037103822103922103922153333333530460032103a22103b2103a103910392215335303a333573466e3c0100080f00ec4cc04000c00440ec8840ec8854ccccccd4c11800c840e88840ec840e840e440e48840ec8854cd4c0e8ccd5cd19b8f00400203c03b133008003001103b22335304b0022335304c00223300600200122203a222335304e004203a2225335303b333573466e1c01800c0f40f054cd4c0ecccd5cd19b8700500203d03c133009004001103c103c22333573466e1c0080040d80d488cd4c1300088cd4c1340088cc02c00800480d88cd4c13400880d88cc02c0080044888d4d40b400888d4d40cc00888d4d40c401488d4d40dc00888c8c94ccd4d4100020854ccd4d4104014854cd4c0fccc03c0080045400c410040fc40fc54ccd4d4100010840fc5400440f854ccd4d4100010840fc40f85400454cd4c0f001854cd4c0f00085400440f454cd4c0f000840f4540044d4d40dc01c88d4d40e4014894ccd4d4108010854ccd4d410c00c854cd4c104cc0440080044cc04801400c41084104410454ccd4d4108008841044cc04000c004410054ccd4d41080088410441004cc04000c004894cd4c0c4008400454cd4c0c400440c840cc8848cc00400c0088004888888888848cccccccccc00402c02802402001c01801401000c008800488ccd5cd19b8f00200102e02d125335350490011350183530473357389210250620004849888400848c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8cccd5cd19b8735573aa0269000128011280aa4c2666666666058a002a004a006a008a00aa00ca00ea010a012266a04202a6ae8540404cd408004cd5d0a8070999aa80dbae501a35742a018266a028eb4d5d0a8050999aa80cbae501835742a010266a038a0326ae8540184cd406c078d5d0a802099a80d3ae35742a004266a0340366ae84d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa0021350174988c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c26603ea002a004260306ae8540084c014d5d09aba25001135573ca00226ea80084d405926232323232323232323333573466e1cd55cea803a40004a0044a0129309998112800a8012801898041aba1500413335500e75ca01a6ae8540084cd4049d71aba135744a00226ae8940044d55cf280089baa0021350154988c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c266042a002a0042602a6ae8540084cd404004cd5d09aba25001135573ca00226ea80084d4051261223232323232323333573466e1cd55cea802a40004a0044a00e93099a8132800a801099a8038031aba150021335007005357426ae8940044d55cf280089baa002135014498488c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c266a052a002a004266a01000c6ae8540084c020d5d09aba25001135573ca00226ea80084d404d261223232323232323333573466e1cd55cea802a40004a0044a00e93099a8132800a801099a8038031aba1500213007357426ae8940044d55cf280089baa002135012498488c8c8c8c8c8c8c8cccd5cd19b87500548010940bc940092613333573466e1d4011200225002250044984d40b940044c018d5d09aab9e500313333573466e1d400520002502c250044984d55cea80089baa0021350114988c8c8c8cccd5cd19b87500248008809c940092613333573466e1d400520002025250034984d55ce9baa00213500f4984cd54005d73ad112223232300137560066a00240022460026aa08c44646464646464646666aae7c0215411c94c00848004124d400888004d400488008d55541344888cc00c84c028d5d10049099a8262802a980189000899aa8252800a801098041aab9d50021300635573ca00226ae840044cd54009d70009000889111919191919191999ab9a3370e6aae754015200025002250074984cd54119400540084c01cd5d0a801098029aba135744a00226aae7940044dd500109a80624c244646460026eb000cd4004800448c004d5410488cccd55cf80092820919a82018031aba100230033574400407a2446464646464646666ae68cdc3a802240004a0044a0089309a80ca800898031aba135573ca00626666ae68cdc3a800a40044a02e4a0089309aab9d50011375400426a01293119191919191919191919191919191999ab9a3370ea0149003128011280224c26062a0022601c6ae84d55cf280589999ab9a3370ea00e9002128011280224c26058a002260186ae84d55cf280409999ab9a3370ea0089001128011280224c26050a002260166ae84d55cf280289999ab9a3370ea0029000128019280324c26aae75400c4c09940044dd71aba135573ca00226ea80084d401d262323232323232323232323232323232323232323232323232323333573466e1d4055200c2043250024984cccd5cd19b87501448028810c940092613333573466e1d404d200825002250064984cc0f5400540084dd71aba150021375a6ae84d5d1280089aab9e501213333573466e1d4039200625002250064984cc0e5400540084dd71aba150021375c6ae84d5d1280089aab9e500d13333573466e1d4025200425002250064984cc0e1400540084c034d5d0a80109bae357426ae8940044d55cf280409999ab9a3370ea0089001128011280224c26068a002260106ae84d55cf280289999ab9a3370ea0029000128019280324c26aae75400c4c0b940044c010d5d09aab9e50011375400426a00c9311919191919191919191919191999ab9a3370ea0109001128011280424c2666072a002a004a00626eb4d5d0a80209bad35742a00426eb4d5d09aba25001135744a00226aae7940144cccd5cd19b875001480009400c9401926135573aa00626064a002260086ae84d55cf280089baa0021350054988c8c8c8c8c8c8c8c8cccd5cd19b875004480089400894011261303750011375c6ae84d55cf280289999ab9a3370ea0029000128019280324c26aae75400c4c0d140044dd71aba135573ca00226ea80084d40112623232323232323333573466e1cd55cea802a40004a0044a00e93099813a800a801098031aba150021375a6ae84d5d1280089aab9e50011375400426a0069311919191999ab9a3370e6aae754009200025002250044984dd71aba135573ca00226ea80084d4009261262222222221233333333300100a009008007006005004003002200122123300100300220012221233300100400300220012212330010030022001121223002003112200112001122123300100300212001122123300100300212001122123300100300212001122002122001200112122230030041122200211222001120012122223004005212222300300521222230020052122223001005200122123300100300220012122222223007008221222222233006009008212222222300500812222222004122222220032212222222330020090082212222222330010090082001212230020032221223330010050040032001212230020032122300100320011125006120012001112200212212233001004003120011122123300100300211200111232300100122330033002002001111123350022123300123500322300200323500322300100300112323230010012233003300200200122123530041235300400335003001001010581840100d8799f8080a140a14000d8799fd8799fd87a9f182affd87a80ffd8799fd87b80d87a80ffffa140a14000808080d87a80ff821a000eee021a15639cc5f4f6"
}

Maybe you are using old enough version of cardano-node (cardano-cli) to create the Tx, @james-iohk?

@catch-21
Copy link
Contributor

catch-21 commented May 4, 2022

I am using IntersectMBO/cardano-node@73f9a74, which is a bit older.
IntersectMBO/cardano-node@65422ff doesn't sync on testnet for me.

@ghost
Copy link

ghost commented Jun 13, 2022

@mkoura does it work with 2b1d18c6c7b7142d9eebfec34da48840ed4409b6? That's the cardano-node's version stated in plutus-apps/cabal.project that you mentioned in the issue (fdb0eec477fc0f99f5edfdbc11c041dbd35ca6bb).

@mkoura
Copy link
Author

mkoura commented Jun 24, 2022

It still doesn't work with node master or 1.35.0-rc4, which are the node versions that need to be tested.

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

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")

@catch-21
Copy link
Contributor

Works for me with node 1.35.0

@mkoura
Copy link
Author

mkoura commented Jul 11, 2022

The command seems to work in Alonzo era, but not in Babbage. I just created another issue since this one is already closed - #583

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants