IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.06k stars 721 forks source link

[QUESTION] - Using the Cardano API to compute minimum UTxO values. #4163

Open jonathanknowles opened 2 years ago

jonathanknowles commented 2 years ago

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 replace cardano-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:

Question

Is this behaviour expected?

More generally:

Many thanks in advance! 🙏🏻

Jonathan

JaredCorduan commented 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

JaredCorduan commented 2 years ago

@jonathanknowles - setMinCoinSizedTxOut introduced in https://github.com/input-output-hk/cardano-ledger/pull/3008 computes the fixed point.