Add a codec preset that follows the ledger encoder
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- blockchain
Línea de trabajo
Start with the CBOR default options named in the issue, CBOR.CML_DEFAULT_OPTIONS and CBOR.TX_DEFAULT_OPTIONS.ledger, and see how they set map and set ordering and length encoding. The ledger rules being matched (encodeMap, encodeSet, the 23-entry threshold) live in cardano-ledger, not this repo. Done means the regression test cases (unsorted inputs, multiple policies, more than 23 inputs or assets) encode byte-identically to cardano-cli build-raw output. The default switch is a separate, later change that needs its own release note.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
No codec preset writes a transaction the way the ledger encoder and cardano-cli do. CBOR.CML_DEFAULT_OPTIONS, the transaction default, keeps map keys and set items in insertion order and always writes definite lengths. The ledger sorts them and switches to indefinite lengths above 23 entries.
Evidence
cardano-ledger libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Encoding/Encoder.hs:
encodeMap(L395-400) folds the map in key order and usesvariableMapLenEncoding: definite up to 23 entries, indefinite above (L426-436,lengthThreshold = 23).encodeSet(L472-483) writes tag 258, the items in order, with the same rule throughvariableListLenEncoding(L457-460).
cardano-cli 10.5.1 conway transaction build-raw, with 25 inputs given in descending order and one output holding two policies given in descending order:
| cardano-cli | CML_DEFAULT_OPTIONS |
|
|---|---|---|
| Inputs | sorted, d90102 9f ... ff |
as given, d90102 9819 ... |
| Policies in the output | sorted | as given |
Proposal
- Add a preset that follows this layout, named after what it follows. The 23-entry rule needs a new encoder setting, since today a preset is either always definite or always indefinite.
- Check that each key type sorts the same way as the ledger's
Ordinstance before relying on byte order. - Move
CBOR.TX_DEFAULT_OPTIONS.ledgerto the new preset in a later release. This changes the bytes of every transaction the builder makes, so it needs devnet proof and its own release note.
Regression test
Build transactions with unsorted inputs, several policies per output, more than 23 inputs and more than 23 assets. Encoded with the new preset, each is byte-identical to cardano-cli build-raw output for the same transaction.
- Lenguaje dominante
- TypeScript
- Estrellas
- 22
- Forks
- 35
- Merge medio
- 19 h 56 min
- PR fusionados (30 d)
- 58
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de IntersectMBO/evolution-sdk
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
IntersectMBO/evolution-sdk#694 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
IntersectMBO/evolution-sdk#559 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
IntersectMBO/evolution-sdk#557 ·
Los mantenedores suelen responder en 1 día
-
dependabot: remove stale @types/bip39 entriesPosiblemente ocupada @Kshot3000 la tomó hace 5 días. Abiertodependencies good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
IntersectMBO/evolution-sdk#541 ·
Los mantenedores suelen responder en 1 día
-
txBuilder: committee cert redeemers are never resolved to a certificate indexPosiblemente ocupada @Kshot3000 la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
IntersectMBO/evolution-sdk#518 ·
Los mantenedores suelen responder en 1 día
Todos los issues de IntersectMBO/evolution-sdk
Issues similares
-
Area/Cloud Needs Triage Type/Bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
wso2/product-integrator#2847 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
bluesky-social/social-app#12118 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
heygen-com/hyperframes#6021 ·
Los mantenedores suelen responder en 1 día
-
Edit: Tele Posadas HDAbiertocheck:passed streams:edit
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día