IntersectMBO / IntersectMBO/cardano-ledger

Improve fee and script budget calculation in ImpTest fixup

Open
#4,784 0 comments 0 reactions 0 assignees View on GitHub
:credit_card: technical-debt :detective: testing
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.