Skip to content

Commit

Permalink
[FAIL] Use Babbage-era minimum UTxO calculation in Babbage era.
Browse files Browse the repository at this point in the history
We re-introduce the Babbage-era minimum UTxO calculation in the Babbage
era, and remove the workaround.

This causes multiple integration tests to fail with `utxo_too_small`.

For example:

```hs
API Specifications, SHELLEY_TRANSACTIONS, TRANSMETA_ESTIMATE_01b - fee estimation includes no-schema metadata
       expected a successful response but got an error: ClientError (Object (fromList [("code",String "utxo_too_small"),("message",String "Some outputs have ada values that are too small. There's a minimum ada value specified by the protocol that each output must satisfy. I'll handle that minimum value myself when you do not explicitly specify an ada value for an output. Otherwise, you must specify enough ada. Here are the problematic outputs:   - Expected min coin value: 1.077500     Address: 010d62b5...3a953592     Token bundle:       coin: 0.999920       tokens: [] ")]))
       While verifying value:
         ( Status
             { statusCode = 403
             , statusMessage = "Forbidden"
             }
         , Left
             ( ClientError
                 ( Object
                     ( fromList
                         [
                             ( "code"
                             , String "utxo_too_small"
                             )
                         ,
                             ( "message"
                             , String "Some outputs have ada values that are too small. There's a minimum ada value specified by the protocol that each output must satisfy. I'll handle that minimum value myself when you do not explicitly specify an ada value for an output. Otherwise, you must specify enough ada. Here are the problematic outputs:   - Expected min coin value: 1.077500     Address: 010d62b5...3a953592     Token bundle:       coin: 0.999920       tokens: [] "
                             )
                         ]
                     )
                 )
             )
         )
```
  • Loading branch information
jonathanknowles committed Jul 14, 2022
1 parent f8d3217 commit 7baf98b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ import Data.ByteString.Short
( fromShort, toShort )
import Data.Coerce
( coerce )
import Data.Default
( Default (..) )
import Data.Foldable
( toList )
import Data.Function
Expand Down Expand Up @@ -915,19 +913,7 @@ fromBabbagePParams eraInfo currentNodeProtocolParameters pp =
, desiredNumberOfStakePools =
desiredNumberOfStakePoolsFromPParams pp
, minimumUTxO =
-- FIXME [ADP-1978] need to fix for final Babbage support ⚠️
--
-- We unexpectedly needed to increase @maxLengthAddress@ causing
-- tests to break in Babbage. Using the Alonzo calculation even in
-- Babbage is correct enough to make the integration tests to pass
-- in Babbage, and for us to be able to merge the Babbage
-- integration cluster support to master. This is not waterproof
-- though, and we should definitely use the babbage-specific
-- calculation.
minimumUTxOForShelleyBasedEra ShelleyBasedEraAlonzo $
def { Alonzo._coinsPerUTxOWord =
multiplyCoinBy 8 $ Babbage._coinsPerUTxOByte pp
}
minimumUTxOForShelleyBasedEra ShelleyBasedEraBabbage pp
, stakeKeyDeposit = stakeKeyDepositFromPParams pp
, eras = fromBoundToEpochNo <$> eraInfo
, maximumCollateralInputCount = unsafeIntToWord $
Expand All @@ -938,8 +924,6 @@ fromBabbagePParams eraInfo currentNodeProtocolParameters pp =
Just $ executionUnitPricesFromPParams pp
, currentNodeProtocolParameters
}
where
multiplyCoinBy a (SL.Coin c) = SL.Coin (a * c)

-- | Extract the current network decentralization level from the given set of
-- protocol parameters.
Expand Down

0 comments on commit 7baf98b

Please sign in to comment.