Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Migrate tx-generator to the experimental Cardano API (Conway and later)

Abierto
#6,592 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@carbolymer ya está trabajando en esto.

Desde el 4/6/2026.

  • #6602 de @carbolymer — abierto

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 - rewrite genTx from manual Ledger.mkBasicTx / WitVKey / ShelleyTx construction to Exp.makeUnsignedTx + Exp.makeKeyWitness + Exp.signTx.
Era dispatch - narrow to Conway + Dijkstra
  • src/Cardano/Benchmarking/Script/Core.hs:71-81 - withEra dispatches on every era from Shelley to Dijkstra. Remove pre-Conway branches.
  • src/Cardano/TxGenerator/Fund.hs:80-88 - getFundWitness pattern-matches on every era in InAnyCardanoEra. Narrow to Conway and Dijkstra.
  • src/Cardano/TxGenerator/Utils.hs:27-35 - liftAnyEra pattern-matches on every era in InAnyCardanoEra. Narrow to Conway and Dijkstra.
  • nix/nixos/tx-generator-service.nix:120-128 - the era option enum lists shelley through conway. Narrow to conway and dijkstra.
Selftest era migration
  • src/Cardano/Benchmarking/Script/Selftest.hs:103 - change AnyCardanoEra AllegraEra to AnyCardanoEra 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 - uses runSelftest for criterion benchmarks. Only checks Right/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 (TxMetadataNone throughout).
  • Plutus script handling is not exercised (selftest uses PayToAddr exclusively).
  • 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 - hardcodes BabbageEra throughout. 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.
  • selftest CLI passes on Conway with the v9/v10 protocol parameters.
  • test/Bench.hs criterion 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IntersectMBO/cardano-node

Todos los issues de IntersectMBO/cardano-node

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.