Skip to content

Commit

Permalink
Lower cost of joining and quitting in STAKE_POOLS_{JOIN,QUIT}_01x.
Browse files Browse the repository at this point in the history
A previous commit adjusted the dummy output used by function
`performSelectionEmpty` so that it uses a null-length `Address` value.

This null-length `Address` value is identical to the one we used before
we adjusted `computeMinimumCoinForUTxO` to require a valid `Address`.

However, we were also able to adjust `performSelectionEmpty` so that it
no longer needs to validate minimum ada quantities of user-specified
outputs, and consequently we were able to reduce the dummy output's
`Coin` value to just `Coin 1`, which has the smallest space cost of
any non-zero `Coin` value.

This results in a further reduction in cost overestimation while
constructing change, which results in a lower cost when joining and
quitting stake pools.
  • Loading branch information
jonathanknowles committed Aug 2, 2022
1 parent 12b0d7f commit fe2841c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,8 @@ spec = describe "SHELLEY_STAKE_POOLS" $ do
costOfJoining :: Context -> Natural
costOfJoining ctx =
if _mainEra ctx >= ApiBabbage
then costOf (\coeff cst -> 487 * coeff + cst) ctx
else costOf (\coeff cst -> 483 * coeff + cst) ctx
then costOf (\coeff cst -> 454 * coeff + cst) ctx
else costOf (\coeff cst -> 450 * coeff + cst) ctx

costOfQuitting :: Context -> Natural
costOfQuitting ctx =
Expand Down

0 comments on commit fe2841c

Please sign in to comment.