Skip to content

Remove --update-proposal-file CLI flag and dead TxUpdateProposal threading - #1372

Merged
Jimbo4350 merged 2 commits into
masterfrom
jordan/remove-unused-tx-update-proposal
May 4, 2026
Merged

Jimbo4350 merged 2 commits into
masterfrom
jordan/remove-unused-tx-update-proposal

Conversation

@Jimbo4350

@Jimbo4350 Jimbo4350 commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes the deprecated --update-proposal-file flag from the era-based transaction build and transaction build-raw commands, plus the dead internal TxUpdateProposal plumbing it was wired into. Update proposals are deprecated since Conway (replaced by governance proposals); the read value was already being discarded inside runTxBuild, so the flag was effectively a no-op.

Two commits, intended to be reviewable in order:

  1. Remove unused TxUpdateProposal threading from build/build-raw — pure dead-code removal: drops the _txUpdateProposal bind, the unused runTxBuild parameter, and the matching field destructures. No CLI change.
  2. Drop --update-proposal-file from era-based transaction build / build-raw — removes the parser hookups and the mUpdateProposalFile / mUpdateProprosalFile record fields from TransactionBuildCmdArgs / TransactionBuildRawCmdArgs. CLI breaking for any script that was passing the flag, though the flag was a no-op for Conway+ already (the Featured ShelleyToBabbageEra constraint excluded it from --help for those eras).

Out of scope: compatible <era> transaction signed-transaction keeps --update-proposal-file, since pre-Conway eras still genuinely use it. Byron's separate --byron-update-proposal and create-/submit-update-proposal commands are also untouched.

How to trust this PR

  • cabal build cardano-cli -j4 is clean
  • cabal test cardano-cli-golden -j4 passes (695/695, including all --help goldens)
  • cabal test cardano-cli-test -j4 passes (69/69)
  • Manually verified: cardano-cli latest transaction build-raw --help no longer mentions update-proposal; cardano-cli compatible babbage transaction signed-transaction --help still does

Changelog

- description: |
    Remove the deprecated `--update-proposal-file` flag from era-based
    `transaction build` and `transaction build-raw`. Update proposals are
    deprecated since Conway and the flag was already a no-op for Conway+.
    The flag is kept for `compatible <era> transaction signed-transaction`
    where pre-Conway eras still need it.
  type:
    - breaking

The `_txUpdateProposal` parameter to `runTxBuild` and the matching
read in `runTransactionBuildRawCmd` were both flagged with `TODO`s
to remove them. Update proposals are deprecated since Conway and
the value was never consumed downstream.

This drops the dead bindings, the unused `runTxBuild` parameter,
and the corresponding field destructures, but leaves the CLI flag
(`--update-proposal-file`) and the record fields in
`TransactionBuildCmdArgs` / `TransactionBuildRawCmdArgs` intact, so
this is not a user-visible CLI change.
Copilot AI review requested due to automatic review settings May 4, 2026 14:17

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

This PR removes end-to-end threading of deprecated TxUpdateProposal values through transaction build and transaction build-raw in the era-based transaction runner, simplifying the build pipeline while keeping the --update-proposal-file flag in the CLI surface.

Changes:

  • Removes reading/binding of update proposal files in runTransactionBuildCmd and runTransactionBuildRawCmd.
  • Drops the TxUpdateProposal era parameter from runTxBuild and removes its call-site argument(s).
  • Cleans up now-unused record field destructuring related to mUpdateProposalFile / mUpdateProprosalFile.
Comments suppressed due to low confidence (2)

cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs:317

  • Removing the mUpdateProposalFile plumbing means --update-proposal-file is now completely ignored at runtime (the file is no longer read/validated). Previously, providing the flag could still fail early if the file was missing/invalid due to readTxUpdateProposal. This is a (small) user-visible behavior change in error cases, so either update the PR description/changelog to reflect that, or keep a warning/validation path when the flag is supplied (even if the value remains unused).
    let mCurrenTreasuryValue = case includeCurrentTreasuryValue of
          IncludeCurrentTreasuryValue -> unFeatured <$> featuredCurrentTreasuryValueM
          ExcludeCurrentTreasuryValue -> Nothing

    -- We need to construct the txBodycontent outside of runTxBuild
    (balancedTxBody@(Exp.UnsignedTx tx), txBodyContent) <-
      fromExceptTCli $
        runTxBuild
          nodeSocketPath
          networkId
          mScriptValidity
          txinsAndMaybeScriptWits
          allReferenceInputs
          filteredTxinsc
          mReturnCollateral
          mTotalCollateral
          txOuts
          changeAddresses
          (mintedMultiAsset, mintingWitnesses)
          mValidityLowerBound
          mValidityUpperBound
          certsAndMaybeScriptWits
          withdrawalsAndMaybeScriptWits
          requiredSigners
          txAuxScripts
          txMetadata
          mOverrideWitnesses
          votingProceduresAndMaybeScriptWits
          proposals
          mCurrenTreasuryValue
          mTreasuryDonation
          supplementalDatums

cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs:656

  • With the _txUpdateProposal <- ... block removed, transaction build-raw --update-proposal-file ... will no longer attempt to read/validate the provided file. If the intent is to keep the flag parsing for compatibility, consider emitting a deprecation warning when it is supplied (or update release notes/PR description to note that invalid paths will no longer error).
    txAuxScripts <-
      fromEitherCli $
        validateTxAuxScripts scripts

    pparams <- forM mProtocolParamsFile $ \ppf ->
      fromExceptTCli (readProtocolParameters ppf)

    let mLedgerPParams = LedgerProtocolParameters <$> pparams

    requiredSigners <-
      mapM (fromEitherIOCli . readRequiredSigner) reqSigners

    mReturnCollateralAndDatums <- mapM toTxOutInShelleyBasedEra mReturnColl
    let mReturnCollateral = fst <$> mReturnCollateralAndDatums
        returnCollDatums = maybe mempty snd mReturnCollateralAndDatums

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

Removes the deprecated `--update-proposal-file` flag from the era-based
`transaction build` and `transaction build-raw` commands by dropping the
two `pUpdateProposalFile` parser hookups and the corresponding record
fields (`mUpdateProposalFile` / `mUpdateProprosalFile`) from
`TransactionBuildCmdArgs` and `TransactionBuildRawCmdArgs`.

Update proposals are deprecated since Conway and the value was already
being discarded internally — the flag was a no-op. Conway and later
eras already excluded the flag from --help (the `Featured
ShelleyToBabbageEra` constraint), so this only affects scripts that
were silently passing the flag for show.

Compatible-mode (`compatible <era> transaction signed-transaction`)
keeps `--update-proposal-file`, since pre-Conway eras still need it.
@Jimbo4350 Jimbo4350 changed the title Remove unused TxUpdateProposal threading from build/build-raw Remove --update-proposal-file CLI flag and dead TxUpdateProposal threading May 4, 2026

@palas palas 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.

👍

@Jimbo4350
Jimbo4350 added this pull request to the merge queue May 4, 2026
Merged via the queue into master with commit b84db0a May 4, 2026
28 checks passed
@Jimbo4350
Jimbo4350 deleted the jordan/remove-unused-tx-update-proposal branch May 4, 2026 20:28
Jimbo4350 added a commit that referenced this pull request May 7, 2026
The field was hardcoded to null across all eras since the
update-proposal handling was removed in #1372. Always-null fields
are noise; drop the key entirely and regenerate the goldens.
Jimbo4350 added a commit that referenced this pull request May 7, 2026
The field was hardcoded to null across all eras since the
update-proposal handling was removed in #1372. Always-null fields
are noise; drop the key entirely and regenerate the goldens.
Jimbo4350 added a commit that referenced this pull request May 7, 2026
The field was hardcoded to null across all eras since the
update-proposal handling was removed in #1372. Always-null fields
are noise; drop the key entirely and regenerate the goldens.
Jimbo4350 added a commit that referenced this pull request May 8, 2026
The field was hardcoded to null across all eras since the
update-proposal handling was removed in #1372. Always-null fields
are noise; drop the key entirely and regenerate the goldens.
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.

3 participants