Implement ValidateTx query for LocalStateQuery protocol#2052
Draft
palas wants to merge 3 commits into
Draft
Conversation
Adds a new BlockQuery constructor `ValidateTx` that validates a transaction against the current ledger state without submitting it. Gated behind ShelleyNodeToClientVersion16 / NodeToClientV_24.
This was referenced May 27, 2026
Draft
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.
Description
Implements the
ValidateTxquery in the Shelley ledger query infrastructure, allowing clients to validate transactions against the node's real ledger state and UTxO via theLocalStateQueryprotocol.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#5377transaction validatecommand cardano-cli#1386NodeToClientV_24andtransaction validateintegration tests cardano-node#6582What this PR does
ValidateTxconstructor toBlockQuery (ShelleyBlock proto era)withQFLookupTablesfootprint, so the query has access to the on-disk UTxO via aReadOnlyForkerValidateTxhandler inanswerShelleyLookupQueries: reads the ledger state from the forker, looks up the transaction's UTxO inputs, injects them into the ledger state, and runsapplyShelleyBasedTxgetShelleyLedgerStateaction throughanswerShelleyLookupQueriesso lookup queries can access the Shelley ledger state regardless of whether the block type isShelleyBlockorHardForkBlockShelleyNodeToClientVersion16gatingValidateTxtoNodeToClientV_24CardanoNodeToClientVersion20pattern mapping all eras toShelleyNodeToClientVersion16NodeToClientV_24toCardanoNodeToClientVersion20insupportedNodeToClientVersionsand updateslatestReleasedNodeVersionNodeToClientV_24 -> QueryVersion3innodeToClientVersionToQueryVersionShow, andEqinstances for the new query and version constructors across Shelley, Cardano, and HFC layersAlso note that:
WARNING
To update your feature branch if it's stale, please rebase it manually on top of
main. Don't update your feature branch by mergingmaininto it. Your pull request will not pass CI if you do.