From b54a42aae777532edc165504bb53c6faeed4ee84 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Sat, 20 Jun 2026 18:11:22 +0200 Subject: [PATCH] prefer user-defined utxos over automatically resolved ones. (cherry picked from commit 839e491f5ad9029b349c8744cacb2cad9b67503d) (adapted to the formatting and the changelog of this fork; its utxoFromMempool part is already in the Dijkstra additionalUtxo port) --- CHANGELOG.md | 2 ++ server/src/Ogmios/App/Protocol/TxSubmission.hs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fe50446f..2a4b269d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,8 @@ math: true - `evaluateTransaction` now reads scripts with `"language": "plutus:v4"` in `additionalUtxo`. Before, it refused them. +- `evaluateTransaction` now uses the outputs given in `additionalUtxo` over the outputs that transactions in the mempool create, when both have the same output reference. Before, the mempool outputs won. + ### [6.14.0] - 2025-10-16 #### Added diff --git a/server/src/Ogmios/App/Protocol/TxSubmission.hs b/server/src/Ogmios/App/Protocol/TxSubmission.hs index cb415959e..e84829f3f 100644 --- a/server/src/Ogmios/App/Protocol/TxSubmission.hs +++ b/server/src/Ogmios/App/Protocol/TxSubmission.hs @@ -289,7 +289,7 @@ mkTxSubmissionClient tr defaultWithInternalError TxSubmissionCodecs{..} Executio mempoolUtxo <- utxoFromMempool <$> readMempoolM logWith tr $ TxSubmissionEvaluateUtxoProvidedByUser{utxoRefs = utxoReferences additionalUtxo} logWith tr $ TxSubmissionEvaluateUtxoInferredFromMempool{utxoRefs = utxoReferences mempoolUtxo} - result <- evaluateExecutionUnitsM (mergeUtxo mempoolUtxo additionalUtxo, transaction) + result <- evaluateExecutionUnitsM (mergeUtxo additionalUtxo mempoolUtxo, transaction) result & toResponse & encodeEvaluateTransactionResponse