Migrate tx-generator to the experimental Cardano API (Conway and later)
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Haskell
- Stelle
- 3.2k
- Fork
- 763
- Merge medio
- 2g 14h
- PR unite (30g)
- 20
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 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
IntersectMBO/cardano-node#6522 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage type: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
IntersectMBO/cardano-node#6737 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
IntersectMBO/cardano-node#6734 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
increase in memory usageAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
IntersectMBO/cardano-node#6718 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di IntersectMBO/cardano-node
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NixOS/nixpkgs-update#586 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
koalaman/shellcheck#3593 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Make node sockets moduleApertaconfiguration
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
tweag/cardano-kosmos#47 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/phino#2021 ·
I maintainer di solito rispondono entro 1 giorno