tweag/cooked-validators

Improve our balancing mechanism

mmontin opened this issue · 0 comments

For now, we have our own mechanism to balance transactions that operate on our TxSkel. This does multiple things, depending on our skeleton parameters:

  • ensure each output is given a minimal amount of ada depending on the output size
  • compute fees and add them to the transaction
  • add collaterals to the transaction
  • balance the transaction

It is well known that this process is complicated and involves a fixpoint because adding fees will increase the size of the transaction, thus possibly requiring more fees and so on. How we currently handle all of this could be improved in many ways:

  • investigate the use of an external balancing function
  • add proper collateral amount with return collaterals instead of a single big Utxo
  • for now, we can only add governance features after balancing on the actual Cardano transaction. This might be an issue if the fees (which we compute before) depend on the presence of Governance elements.