[BUG] - cardano-submit-api cannot decode Dijkstra era transactions
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia in cardano-submit-api/src/Cardano/TxSubmit/Web.hs da readByteStringTx, dove l’issue mostra che l’elenco dei decoder delle ere termina con Conway. Leggi la correzione di cardano-cli collegata nell’issue per avere il contesto, poi controlla i test della submit API menzionati nel report, soprattutto i casi Dijkstra. Il lavoro è completato quando le transazioni Dijkstra con codifiche dei campi body modificate vengono decodificate e inviate invece di fallire con TxCmdTxReadError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Haskell
- Stelle
- 3.2k
- Fork
- 760
- Merge medio
- 2g 13h
- PR unite (30g)
- 18
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di IntersectMBO/cardano-node
-
Stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
IntersectMBO/cardano-node#6597 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
IntersectMBO/cardano-node#6578 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
IntersectMBO/cardano-node#6522 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
increase in memory usageAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
IntersectMBO/cardano-node#6718 ·
I maintainer di solito rispondono entro 2 giorni
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
IntersectMBO/cardano-node#6714 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di IntersectMBO/cardano-node
Issue simili
-
plutus
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
IntersectMBO/cardano-ledger#6152 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
fmidue/prolog-programming-task#55 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
objectionary/phino#1752 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno