Open jonathanknowles opened 2 years ago
I'm less familiar with the use cases of the Cardano API, but it looks like calculateMinimumUTxO
mostly just wraps the ledger function evaluateMinLovelaceOutput
, which only computes the minimum and does not attempt to compute the fixed point.
But I think such a fixed point function would be very helpful for many folks, so I made this: https://github.com/input-output-hk/cardano-ledger/issues/2905
@jonathanknowles - setMinCoinSizedTxOut
introduced in https://github.com/input-output-hk/cardano-ledger/pull/3008 computes the fixed point.
Internal/External
Internal
Area
Using the Cardano API function
Cardano.Api.Fees.calculateMinimumUTxO
to compute minimum UTxO values.Context
We're currently attempting to use the
Cardano.Api.Fees.calculateMinimumUTxO
function to replacecardano-wallet
's hand-coded minimum UTxO calculation. Our main use cases of this function are:However, while testing this function, we've discovered some interesting behaviour:
TxOut
t
with arbitrary tokens and an arbitrary address, whose ada quantity we can adjust with the functionsetLovelace :: Lovelace -> TxOut -> TxOut
.calculateMinimumUTxO
witht0 = setLovelace 0 t
, and the function returns ada quantitya
.calculateMinimumUTxO
withta = setLovelace a t
, and the function returns ada quantityb
.b > a
.calculateMinimumUTxO
appears to not reach a fixed point before returning its final value.Question
Is this behaviour expected?
More generally:
calculateMinimumUTxO
function to satisfy?Many thanks in advance! 🙏🏻
Jonathan