IntersectMBO / IntersectMBO/cardano-ledger
Improve fee and script budget calculation in ImpTest fixup
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
The script budget (set in the redeemers) depends on the value of the fee, which in turn depends on the value of the budget.
The current solution (implemented in https://github.com/IntersectMBO/cardano-ledger/pull/4766) is to first compute the fee, maximizing it with respect to the budget (so assuming the maximum budget), then computing the real budget, with a previously computed more realistic fee. Unfortunately this is not precisely enough in some cases, so it also adds a 10% to the fee as a margin - because in some cases the required fee would still go over.
A more elegant and reliable way to satisfy this circular dependency between redeemers and fee would be to find a fixed point by calling fixup functionality until the transaction stops changing. This would require some refactoring of the fixup (one idea: making the fixup idempotent).
Contributor guide
Assessment
This issue has not been assessed yet.