From 7baf98b808300b17af1f7a793fc6c76c982d0b94 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 14 Jul 2022 02:46:25 +0000 Subject: [PATCH] [FAIL] Use Babbage-era minimum UTxO calculation in Babbage era. 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: [] " ) ] ) ) ) ) ``` --- .../Cardano/Wallet/Shelley/Compatibility.hs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs b/lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs index d0c3c38e2a0..3afea0ccdf3 100644 --- a/lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs +++ b/lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs @@ -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 @@ -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 $ @@ -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.