[BUG] - cardano-submit-api cannot decode Dijkstra era transactions
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in cardano-submit-api/src/Cardano/TxSubmit/Web.hs at readByteStringTx, where the issue shows the era decoder list ending at Conway. Read the cardano-cli fix linked in the issue for context, then check the submit API tests named in the report, especially the Dijkstra cases. Done means Dijkstra transactions with changed body-field encodings decode and submit rather than failing with TxCmdTxReadError.
Written by the indexing model from the issue text.
Description
Internal/External
Internal
Area
Other (cardano-submit-api)
Summary
cardano-submit-api has no Dijkstra decoder. readByteStringTx in cardano-submit-api/src/Cardano/TxSubmit/Web.hs lists the eras by hand, and the list ends at Conway:
readByteStringTx = firstExceptT TxCmdTxReadError . hoistEither . deserialiseAnyOf
[ FromSomeType (AsTx AsShelleyEra) (InAnyShelleyBasedEra ShelleyBasedEraShelley)
, FromSomeType (AsTx AsAllegraEra) (InAnyShelleyBasedEra ShelleyBasedEraAllegra)
, FromSomeType (AsTx AsMaryEra) (InAnyShelleyBasedEra ShelleyBasedEraMary)
, FromSomeType (AsTx AsAlonzoEra) (InAnyShelleyBasedEra ShelleyBasedEraAlonzo)
, FromSomeType (AsTx AsBabbageEra) (InAnyShelleyBasedEra ShelleyBasedEraBabbage)
, FromSomeType (AsTx AsConwayEra) (InAnyShelleyBasedEra ShelleyBasedEraConway)
]
Simple Dijkstra transactions still go through, because the Conway decoder happens to accept them. That hides the bug. It shows up as soon as a transaction uses a body field whose encoding changed in Dijkstra. For example, required signers (body field 14) are now encoded as credentials ([0, keyhash]) where Conway expects plain key-hash bytes. Such a transaction is rejected with HTTP 400:
{"contents":{"contents":[
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 3 \"expected list len or indef\")",
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 3 \"expected list len or indef\")",
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 3 \"expected list len or indef\")",
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 3 \"expected list len or indef\")",
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 3 \"expected list len or indef\")",
"DecoderErrorDeserialiseFailure \"Shelley Tx\" (DeserialiseFailure 260 \"expected bytes\")"
],"tag":"TxCmdTxReadError"},"tag":"TxSubmitFail"}
The same transactions submitted with cardano-cli transaction submit work: valid ones are accepted, and the negative test gets the expected ledger error instead of a decoding failure.
The code is unchanged on master (b05d8ef62), on leios-prototype, and on the 11.2 release prep branch koslambrou/prepare-11.2 (8ff994d2f). The pinned cardano-api (^>= 11.7) already provides AsDijkstraEra / ShelleyBasedEraDijkstra, so only cardano-submit-api needs to change.
Steps to reproduce
- Start a local testnet in the Dijkstra era (protocol version 12).
- Build and sign a transaction with a required signer, e.g.
cardano-cli dijkstra transaction build ... --required-signer-hash <keyhash>. - POST the raw CBOR to
/api/submit/txwithContent-Type: application/cbor. - The request fails with the
TxCmdTxReadErrorshown above.
Found by the cardano-node-tests tests test_mint_build.py::test_witness_redeemer[*-submit_api] and test_mint_negative_build.py::test_witness_redeemer_missing_signer[submit_api-*]. All other submit_api tests pass on Dijkstra.
Expected behavior
Dijkstra transactions are decoded and submitted.
System info
- OS Name: Fedora Linux 44
- Node version: cardano-node 11.1.0.164 - linux-x86_64 - ghc-9.6, git rev 8bb6b68d80a8a4fb1904c48805be4f3a516593ef
- CLI version: cardano-cli 11.2.2.0 - linux-x86_64 - ghc-9.6, git rev 8bb6b68d80a8a4fb1904c48805be4f3a516593ef
- cardano-submit-api 11.0.0 (same build)
Additional context
cardano-cli had the same kind of hardcoded era list when reading transaction witnesses. It was fixed in IntersectMBO/cardano-cli@6605fa151 ("Derive the accepted era list when reading transaction witnesses"), which builds the list from [minBound .. maxBound]. The same approach would work here.
- Dominant language
- Haskell
- Stars
- 3.2k
- Forks
- 757
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 17
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/cardano-node
-
Stale
Difficulty 1/5 1-3 hours Newbie friendliness 75/100
IntersectMBO/cardano-node#6597 · 1 comment ·
Maintainers usually reply within 2 days
-
Stale
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
IntersectMBO/cardano-node#6578 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
IntersectMBO/cardano-node#6522 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
IntersectMBO/cardano-node#6718 ·
Maintainers usually reply within 2 days
-
needs triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IntersectMBO/cardano-node#6714 ·
Maintainers usually reply within 2 days
All issues in IntersectMBO/cardano-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Should a synchronous Gauge point carry the collection time or the time of its last `gaugeRecord`?Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
iand675/hs-opentelemetry#318 ·
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
simplex-chat/simplex-chat#7649 ·
Maintainers usually reply within 1 day
-
LaTeX --label and --expression values can break the generated documentPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/phino#1725 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
tomjaguarpaw/bluefin#108 ·