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
Era dispatch - narrow to Conway + Dijkstra
Selftest era migration
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.
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
Definition of done
Background
Raised by @Jimbo4350 in review of PR #6575.
The experimental Cardano API (
Cardano.Api.Experimental) providesmakeUnsignedTxandsignTxas 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, andcreateChangeactions - 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.jsonhasprotocolVersion: {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:
TxMetadataNonethroughout).PayToAddrexclusively).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
selftestCLI passes on Conway with the v9/v10 protocol parameters.test/Bench.hscriterion benchmark passes.bench/tx-generator/.withEra,getFundWitness,liftAnyEra) narrowed to Conway + Dijkstra.