Migrate tx-generator to the experimental Cardano API (Conway and later)
Los mantenedores suelen responder en 2 días
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Background
Raised by @Jimbo4350 in review of PR #6575.
The experimental Cardano API (Cardano.Api.Experimental) provides makeUnsignedTx and signTx as the supported transaction construction path, replacing direct ledger-level construction.
It only supports Conway and Dijkstra eras.
Mainnet is on Conway (protocol version 9+) and all production benchmark profiles already target Conway exclusively.
No active profile sets an era below Conway.
The pre-Conway code paths are dead in production.
This targets the master branch version of the code.
Scope
Paths are relative to bench/tx-generator/.
Core transaction building
-
src/Cardano/TxGenerator/Tx.hs- rewritegenTxfrom manualLedger.mkBasicTx/WitVKey/ShelleyTxconstruction toExp.makeUnsignedTx+Exp.makeKeyWitness+Exp.signTx.
Era dispatch - narrow to Conway + Dijkstra
-
src/Cardano/Benchmarking/Script/Core.hs:71-81-withEradispatches on every era from Shelley to Dijkstra. Remove pre-Conway branches. -
src/Cardano/TxGenerator/Fund.hs:80-88-getFundWitnesspattern-matches on every era inInAnyCardanoEra. Narrow to Conway and Dijkstra. -
src/Cardano/TxGenerator/Utils.hs:27-35-liftAnyErapattern-matches on every era inInAnyCardanoEra. Narrow to Conway and Dijkstra. -
nix/nixos/tx-generator-service.nix:120-128- theeraoption enum lists shelley through conway. Narrow to conway and dijkstra.
Selftest era migration
-
src/Cardano/Benchmarking/Script/Selftest.hs:103- changeAnyCardanoEra AllegraEratoAnyCardanoEra ConwayEra.
The era binding propagates consistently to all AddFund, Submit, and createChange actions - no witness mismatch.
The change is structurally safe: no golden files, no asserted transaction sizes, no hardcoded expected values exist.
However, the protocol parameter conversion takes a different code path for Conway (via toConwayPParams → toBabbagePParams → toAlonzoCommonPParams) and requires fields not needed for Allegra (executionUnitPrices, maxTxExecutionUnits, utxoCostPerByte, costModels, etc.).
The current data/protocol-parameters.json has protocolVersion: {major: 6} (Shelley/Allegra vintage) - semantically wrong for Conway.
-
Update selftest protocol parameters file to
data/protocol-parameters-v9.json(or v10), which already exists in the data directory with Conway-appropriate values (PlutusV1/V2/V3 cost models,utxoCostPerByte: 538, version 9). -
test/Bench.hs:21- usesrunSelftestfor criterion benchmarks. Only checksRight/Left, no size assertions. Verify it passes after the era + parameter file change.
Unaffected areas:
- SizedMetadata costs differ between eras (Allegra: 39 bytes first entry, Conway: 42 bytes) but are not exercised by the selftest (
TxMetadataNonethroughout). - Plutus script handling is not exercised (selftest uses
PayToAddrexclusively). - Genesis configuration is not used (selftest loads protocol parameters directly from JSON).
- Transaction CBOR size will change (Conway body has additional fields) but is unasserted.
Other files
-
src/Cardano/TxGenerator/PureExample.hs- hardcodesBabbageErathroughout. Rewrite to Conway using the experimental API. -
src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs:48-95- per-era cost properties from Shelley to Dijkstra. Keep for completeness.
Definition of done
- tx-generator builds with no warnings on the experimental API.
-
selftestCLI passes on Conway with the v9/v10 protocol parameters. -
test/Bench.hscriterion benchmark passes. - No remaining sub-Conway transaction construction paths in
bench/tx-generator/. - Per-era dispatchers (
withEra,getFundWitness,liftAnyEra) narrowed to Conway + Dijkstra. - Nix era enum updated.
- Lenguaje dominante
- Haskell
- Estrellas
- 3.2k
- Forks
- 763
- Merge medio
- 3 d 11 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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/cardano-node
-
Stale
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
IntersectMBO/cardano-node#6597 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
IntersectMBO/cardano-node#6522 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Enhancements for status commandPosiblemente ocupada @palas la tomó hoy. Abierto
IntersectMBO/cardano-node#6747 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Modify `renderStatusReportHumanReadable` to return `Doc Ann` instead.Posiblemente ocupada @palas la tomó hace 1 día. Abierto
IntersectMBO/cardano-node#6746 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Remove carriage returns in testnet README.md for better diffsPosiblemente ocupada @palas la tomó hace 5 días. Abierto
IntersectMBO/cardano-node#6744 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de IntersectMBO/cardano-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Vim-mode indent crashes: monaco-vim's browser build inlines monaco-editor 0.33Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
compiler-explorer/compiler-explorer#9402 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
objectionary/phino#2137 ·
Los mantenedores suelen responder en 1 día