Skip to content

Update tx-generator to not use deprecated cardano-api API#6602

Open
carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/chore/update-tx-generator-to-use-experimental-api
Open

Update tx-generator to not use deprecated cardano-api API#6602
carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/chore/update-tx-generator-to-use-experimental-api

Conversation

@carbolymer

@carbolymer carbolymer commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate tx-generator to use the experimental cardano-api for transaction building and era dispatch.

  • Use IsEra constraint and Cardano.Api.Experimental transaction building across the tx construction and submission pipeline
  • Narrow era support to Conway and Dijkstra only - pre-Conway eras are no longer exercised by the benchmarking workbench
  • Remove pre-Conway CBOR metadata property tests that were already broken at runtime
  • Dijkstra metadata tests commented out pending makeUnsignedTx support in cardano-api

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes

@carbolymer carbolymer self-assigned this Jun 17, 2026
@carbolymer carbolymer linked an issue Jun 17, 2026 that may be closed by this pull request
16 tasks
@carbolymer carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch from 2064644 to 0e48d61 Compare June 18, 2026 10:40
Base automatically changed from mgalazyn/feature/update-cardano-rpc-11.0 to master June 19, 2026 12:45
@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch 3 times, most recently from adb450f to fd7f5d5 Compare June 29, 2026 13:24
@carbolymer

carbolymer commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Experimental API migration guide: https://gist.github.com/carbolymer/1967d68a8d4ed4b80cbbf50ee8698bf8

@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch 3 times, most recently from b95df49 to 892b6c9 Compare June 30, 2026 11:55
, teRawCBOR = "X \vl1~\182\201v(\152\250A\202\157h0\ETX\248h\153\171\SI/m\186\242D\228\NAK\182(&\162"
}
era = AnyCardanoEra AllegraEra
era = AnyCardanoEra ConwayEra

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selftest is a smoke test for tx-generator so I presume we don't have to use Allegra here, and conway is fine?

@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch 4 times, most recently from 24672d4 to 44e94ac Compare June 30, 2026 14:32
Comment thread bench/tx-generator/app/calibrate-script.hs Outdated
Comment thread bench/tx-generator/app/calibrate-script.hs Outdated
Comment thread bench/tx-generator/app/calibrate-script.hs Outdated
@carbolymer carbolymer requested a review from Jimbo4350 July 1, 2026 13:01
@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch from 44e94ac to 8d46065 Compare July 1, 2026 13:01
@carbolymer carbolymer requested a review from Copilot July 1, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the tx-generator benchmarking/workbench code from deprecated cardano-api APIs to the experimental transaction-building and era-dispatch APIs, while narrowing the exercised era surface to Conway and Dijkstra.

Changes:

  • Switch multiple tx construction/submission paths to Cardano.Api.Experimental primitives (IsEra, useEra, makeUnsignedTx, signTx, etc.).
  • Narrow era dispatch in benchmarking scripts/selftests to Conway/Dijkstra and update protocol-parameters file references to protocol-parameters-v10.json.
  • Remove/comment out pre-Conway (and currently-broken) metadata CBOR property tests, and refactor the remaining metadata sizing implementation to use experimental tx building.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
bench/tx-generator/tx-generator.cabal Updates dependencies/ghc-options to match the experimental API migration and reduced era surface.
bench/tx-generator/test/Main.hs Drops pre-Conway metadata property tests; keeps Conway tests and comments out Dijkstra pending support.
bench/tx-generator/src/Cardano/TxGenerator/UTxO.hs Moves UTxO output/fund construction to IsEra + obtainCommonConstraints.
bench/tx-generator/src/Cardano/TxGenerator/Utils.hs Adds txIdFromTx and updates TxInMode construction to experimental-era constraints.
bench/tx-generator/src/Cardano/TxGenerator/Tx.hs Reimplements genTx using experimental unsigned tx building + signing.
bench/tx-generator/src/Cardano/TxGenerator/PureExample.hs Updates the pure example to a post-Conway era and new protocol-parameters filename.
bench/tx-generator/src/Cardano/TxGenerator/Genesis.hs Ports genesis expenditure transaction building/signing to experimental API.
bench/tx-generator/src/Cardano/TxGenerator/Fund.hs Narrows witness-era matching to Conway/Dijkstra under IsEra.
bench/tx-generator/src/Cardano/Benchmarking/Script/Selftest.hs Updates protocol-parameters filename and switches selftest era to Conway.
bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs Narrows era dispatch and ports generator evaluation/fee estimation to experimental-era constraints.
bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs Ports submission client to IsEra and uses txIdFromTx for TxId extraction.
bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs Reworks metadata sizing measurement to build dummy txs via the experimental API.
bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx.hs Switches the benchmark entrypoint constraints to IsEra and uses obtainCommonConstraints.
bench/tx-generator/app/calibrate-script.hs Ports the calibration script’s tx sizing/fee approximation logic to experimental tx building and Plutus witness construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bench/tx-generator/src/Cardano/TxGenerator/Tx.hs Outdated
Comment thread bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs Outdated
@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch 2 times, most recently from 2615b9d to b6acf4c Compare July 2, 2026 11:06
@carbolymer carbolymer marked this pull request as ready for review July 2, 2026 12:31
@carbolymer carbolymer requested review from a team as code owners July 2, 2026 12:31
@carbolymer carbolymer changed the title Update tx-generator to not use deprecated cardano-api api Update tx-generator to not use deprecated cardano-api API Jul 2, 2026
Comment thread bench/tx-generator/app/calibrate-script.hs Outdated

@Jimbo4350 Jimbo4350 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more leftover types.

Comment thread bench/tx-generator/src/Cardano/TxGenerator/Fund.hs Outdated
Comment thread bench/tx-generator/src/Cardano/TxGenerator/Genesis.hs Outdated
@carbolymer carbolymer force-pushed the mgalazyn/chore/update-tx-generator-to-use-experimental-api branch from b6acf4c to 4dc6a4b Compare July 2, 2026 19:13
@carbolymer carbolymer requested a review from Jimbo4350 July 2, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants