Skip to content

Add --tx-in-collateral and derive the era in compatible commands - #1408

Merged
carbolymer merged 1 commit into
masterfrom
mgalazyn/feature/update-compatible-tx
Oct 16, 2026
Merged

carbolymer merged 1 commit into
masterfrom
mgalazyn/feature/update-compatible-tx

Conversation

@carbolymer

@carbolymer carbolymer commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a repeatable --tx-in-collateral option to compatible <era> transaction signed-transaction in the Alonzo era and later.
A transaction that runs Plutus scripts needs collateral inputs, and without them the ledger rejects it with NoCollateralInputs.
Motivated by the tx-generator migration in:

It also stops the compatible commands from hardcoding Conway, so adding a Dijkstra compatible group needs no further changes there.

Changes:

  • CreateCompatibleSignedTransaction takes a list of collateral inputs and passes it to createCompatibleTx as compatibleTxInsCollateral.
  • Shelley, Allegra and Mary do not parse the option, so their help output does not change.
  • The compatible Conway build test passes --tx-in-collateral, and the help goldens are regenerated.
  • The vote, proposal and certificate parsers take their reference-script language options from the transaction's era instead of always using Conway's. For certificates, Shelley to Babbage keep the base language options, as before.
  • Protocol-parameter update proposals use the same code for Conway and Dijkstra, which replaces an error stub in the Dijkstra branch.
  • The Conway-pinned pVoteFile, pProposalFile and pCertificateFile helpers are removed from Cardano.CLI.EraBased.Common.Option, because nothing uses them any more.

There is no compatible dijkstra group yet, so the Dijkstra paths are only type-checked.
Help output for the existing compatible eras is unchanged.

Note

The cardano-api 11.9.0.0 bump, the move to CompatibleTxBodyContent and --protocol-params-file, which this PR used to carry, were merged with #1453.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

@carbolymer carbolymer self-assigned this Aug 8, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from bcacc88 to 4a530f9 Compare August 13, 2026 15:18
@carbolymer
carbolymer marked this pull request as ready for review August 13, 2026 15:31
@carbolymer
carbolymer requested a review from Jimbo4350 as a code owner August 13, 2026 15:31
Copilot AI lite review requested due to automatic review settings August 13, 2026 15:31

Copilot AI 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.

Pull request overview

Updates cardano-cli to align with upstream cardano-api changes, primarily around compatible transaction construction and a few related cleanups in CLI parsing and JSON output.

Changes:

  • Refactors compatible transaction creation to build from defaultCompatibleTxBodyContent and set fields explicitly.
  • Extends Bech32 KES key parsing to handle Bech32InvalidUtf8.
  • Minor naming/import adjustments in JSON output and genesis testnet data code.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cardano-cli/src/Cardano/CLI/Type/Output.hs Renames the ChainTip block number binder for clearer JSON encoding code.
cardano-cli/src/Cardano/CLI/EraBased/Genesis/CreateTestnetData/Run.hs Adjusts ledger import list (currently breaks StandardCrypto usage later in the file).
cardano-cli/src/Cardano/CLI/EraBased/Common/Option.hs Adds handling for Bech32InvalidUtf8 in KES key parsing; exposes an error-message mismatch in the hex fallback.
cardano-cli/src/Cardano/CLI/Compatible/Transaction/Run.hs Updates compatible tx building to the newer defaultCompatibleTxBodyContent-based API shape.
Suppressed comments (1)

cardano-cli/src/Cardano/CLI/EraBased/Common/Option.hs:1962

  • The hex fallback error message says "Invalid stake pool verification key" but this parser is for a KES verification key, so the message is misleading for users.
      Left err@(Bech32InvalidUtf8 _) -> Left $ displayError err
      -- The input was not valid Bech32. Attempt to deserialise it as hex.
      Left (Bech32DecodingError _) ->
        first
          (\e -> docToString $ "Invalid stake pool verification key: " <> prettyError e)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 2 times, most recently from de6d781 to 4721ced Compare August 13, 2026 15:45
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 2 times, most recently from c8cb8d4 to 92790ca Compare August 13, 2026 17:47
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from 92790ca to 2203d8b Compare August 24, 2026 15:24
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 2 times, most recently from 779ecbe to 569b2bb Compare September 2, 2026 12:54
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 2 times, most recently from b2a5459 to 0b0ffdb Compare October 9, 2026 10:47
@carbolymer
carbolymer added this pull request to stack #1458 October 9, 2026 10:48
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from 0b0ffdb to 9eeb7a3 Compare October 14, 2026 16:54
@carbolymer
carbolymer requested a review from a team as a code owner October 14, 2026 16:54
@carbolymer
carbolymer removed this pull request from stack #1458 October 14, 2026 16:55
& Exp.setTxMintValue validatedMintValue
& Exp.setTxVotingProcedures validatedVotingProcedures
& Exp.setTxProposalProcedures (Exp.mkTxProposalProcedures txProposals)
& maybe id Exp.setTxCurrentTreasuryValue (unTxCurrentTreasuryValue <$> mCurrentTreasury)
Comment thread cardano-cli/src/Cardano/CLI/EraBased/Transaction/SubTransaction/Run.hs Dismissed
@carbolymer
carbolymer changed the base branch from master to jordan/basic-sub-tx-integration October 14, 2026 16:55
@carbolymer
carbolymer added this pull request to stack #1466 October 14, 2026 16:56
Base automatically changed from jordan/basic-sub-tx-integration to master October 14, 2026 19:01
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from 9eeb7a3 to 5d15b49 Compare October 15, 2026 06:31
@carbolymer carbolymer changed the title Update compatible transaction building for the cardano-api changes Add --tx-in-collateral to compatible signed-transaction Oct 15, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 2 times, most recently from 89b98a6 to dea2f66 Compare October 15, 2026 07:54
@carbolymer carbolymer changed the title Add --tx-in-collateral to compatible signed-transaction Add --tx-in-collateral and derive the era in compatible commands Oct 15, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch 4 times, most recently from 32c0962 to 4c1e657 Compare October 15, 2026 08:33
Comment thread cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs Outdated
Comment thread cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs Outdated
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from 4c1e657 to 05dee42 Compare October 16, 2026 10:30
@carbolymer
carbolymer requested a review from Jimbo4350 October 16, 2026 10:31
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from 05dee42 to f7083c6 Compare October 16, 2026 12:13
Add a repeatable `--tx-in-collateral` option to
`compatible <era> transaction signed-transaction` and pass the inputs to
cardano-api's `compatibleTxInsCollateral`, so transactions with Plutus
witnesses can include collateral inputs.

The option is available from the Alonzo era onwards; Shelley, Allegra
and Mary do not offer it.

Compatible commands no longer pin Conway for vote, proposal and
certificate reference-script options or for protocol-parameter update
proposals, so a Dijkstra compatible group needs no further changes
there. Existing eras behave as before. The parser and runner match on
`ShelleyBasedEra` instead of using `*Onwards` eons and `Featured`.

Raise the Windows test watchdog to 90 seconds, because the
Wine-emulated cross-compiled test runs exceed 35 seconds per test
case.
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-compatible-tx branch from f7083c6 to f17a245 Compare October 16, 2026 12:30
@carbolymer
carbolymer merged commit c9b8249 into master Oct 16, 2026
17 of 18 checks passed
@carbolymer
carbolymer deleted the mgalazyn/feature/update-compatible-tx branch October 16, 2026 12:30
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.

4 participants