Implement transaction validate command#1386
Draft
palas wants to merge 4 commits into
Draft
Conversation
Second iteration of `transaction validate`
This was referenced May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
Context
Implements the
transaction validateCLI command, which validates a signed transaction file against a running node's ledger state.Part of IntersectMBO/cardano-cli#1380.
Big picture:
transaction validatecurrently appliesapplyTxclient-side with an empty UTxO set, making it unable to properly validate transactions. This cross-repo change adds a newValidateTxquery to theLocalStateQueryprotocol so the node validates transactions against its real ledger state and UTxO set.transaction validatePR list:NodeToClientV_24forValidateTxquery ouroboros-network#5377ValidateTxquery forLocalStateQueryprotocol ouroboros-consensus#2052NodeToClientV_24andtransaction validateintegration tests cardano-node#6582What this PR does
transaction validatesubcommand under the Conway and Latest era parsers, accepting--node-socket-path,--testnet-magic/--mainnet, and--tx-filerunTransactionValidateCmdwhich deserialises the tx file, connects to the node, callsvalidateTxfromcardano-api, and renders the resultsrenderApplyTxErrorsinCardano.CLI.EraBased.Transaction.Internal.ErrorRendering) that renders Conway ledger predicate failures including: UTxO validation errors (fee too low, value not conserved, missing inputs, max tx size exceeded), witness errors (missing VKey/script witnesses, native script failures), certificate errors (delegation, DRep, pool), governance errors, and Plutus script failures with script hashes and redeemer detailsconway transactionandlatest transactionHow to trust this PR
Integration tests in
cardano-testnet(in the cardano-node PR) exercise the full round-trip: valid simple txs, valid Plutus txs, fee-too-low, value-not-conserved, missing witnesses, missing script witnesses, no collateral, max-tx-size exceeded, phase-2 failures, and multi-error scenarios — each with golden file comparison.Checklist
Closes #1380