Data: constructors with an index above 127 write the tag 102 pair with the wrong header
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #616 di @solidsnakedev — integrata
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- blockchain, typescript
- Ambito
- backend
Direzione di ricerca
Individua l'encoder dei dati Plutus (Constr) nello SDK TypeScript e le opzioni di data preset introdotte in #598, poi trova dove viene codificata la coppia tag-102 [index, fields]. Secondo encodeData in PlutusCore/Data.hs, la coppia deve essere un array definito di 2 elementi, mentre solo i campi usano le opzioni di lista. Aggiungi test di regressione che verifichino i byte del nodo d866 82 1880 9f01ff / d866 82 1903e8 9f01ff e i loro hash blake2b-256 per Constr 128 [1] e Constr 1000 [1], oltre a un controllo che i costruttori 0-127 siano invariati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
For a constructor index above 127, Plutus data is written as tag 102 wrapping a pair [index, fields]. The node writes that pair as a definite 2-element array and the fields as a list. The SDK writes the pair with the list options, so every data preset that uses indefinite lists gets the wrong header, and no preset produces the node's bytes. The datum hash differs from cardano-cli and from what a validator computes with serialise_data.
| Value | Node (cardano-cli 10.5.1, Aiken v1.1.24) | SDK default and CML_DATA_DEFAULT_OPTIONS |
CARDANO_NODE_DATA_OPTIONS |
|---|---|---|---|
Constr 128 [1] |
d866 82 1880 9f01ff, hash fd05a09e… |
d866 9f 1880 9f01ff ff, hash e964637c… |
d866 82 1880 8101, hash 1bd42101… |
Constr 1000 [1] |
d866 82 1903e8 9f01ff, hash ba07c752… |
d866 9f 1903e8 9f01ff ff, hash 1f014ffb… |
d866 82 1903e8 8101, hash c8b3c9a8… |
The node hashes come from cardano-cli conway transaction hash-script-data; Aiken's serialiseData returns the same bytes, and their blake2b-256 equals those hashes.
Haskell source: PlutusCore/Data.hs encodeData writes CBOR.encodeTag 102 <> CBOR.encodeListLen 2 <> tagEncoding <> encode ds. The pair is always definite; only the fields follow the list encoding.
Affected
The Plutus data encoder for constructors with an index above 127 (tag 102), under every data preset.
Fix
Always write the tag 102 pair as a definite 2-element array, and write the fields with the list options. Decoding already accepts both forms; keep that.
Regression test
Constr 128 [1]andConstr 1000 [1]with the node-layout preset from #598 give the node bytes above, and their blake2b-256 equals the cardano-cli hashes.- An Aiken validator that compares
blake2b_256(serialise_data(datum))with its redeemer accepts the SDK hash. - Constructors 0 to 127 are unchanged.
Must FAIL on main today and PASS after the fix.
- Lingua principale
- TypeScript
- Stelle
- 22
- Fork
- 33
- Merge medio
- 2g 1h
- PR unite (30g)
- 44
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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/evolution-sdk
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
IntersectMBO/evolution-sdk#559 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
IntersectMBO/evolution-sdk#557 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 93/100
IntersectMBO/evolution-sdk#541 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
IntersectMBO/evolution-sdk#518 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement external-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
IntersectMBO/evolution-sdk#456 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di IntersectMBO/evolution-sdk
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
yjh051108/dsh-routing-suite#216 ·
-
kind/bug priority/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 66/100
apache/fineract-consumer-facing#175 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
awslabs/visual-asset-management-system#413 ·
I maintainer di solito rispondono entro 1 giorno