diff --git a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs index e1dbb3d0c4d..872ef42c642 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs @@ -57,6 +57,7 @@ assumeMapCosts _proxy = stepFunction [ ShelleyBasedEraMary -> 39 -- Unconfirmed ! update when alonzo is runnable. ShelleyBasedEraAlonzo -> error "39" + ShelleyBasedEraBabbage -> error "39" -- Bytestring costs are not LINEAR !! -- Costs are piecewise linear for payload sizes [0..23] and [24..64]. @@ -127,6 +128,7 @@ metadataInEra (Just m) = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxMetadataInEra TxMetadataInAllegraEra m ShelleyBasedEraMary -> TxMetadataInEra TxMetadataInMaryEra m ShelleyBasedEraAlonzo -> TxMetadataInEra TxMetadataInAlonzoEra m + ShelleyBasedEraBabbage -> TxMetadataInEra TxMetadataInBabbageEra m mkMetadata :: forall era . IsShelleyBasedEra era => Int -> Either String (TxMetadataInEra era) mkMetadata 0 = Right $ metadataInEra Nothing @@ -140,6 +142,7 @@ mkMetadata size ShelleyBasedEraAllegra -> 39 ShelleyBasedEraMary -> 39 ShelleyBasedEraAlonzo -> 39 -- TODO: check minSize for Alonzo + ShelleyBasedEraBabbage -> 39 -- TODO: check minSize for Babbage nettoSize = size - minSize -- At 24 the CBOR representation changes. diff --git a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs index 09eeeae9087..b4a20683766 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs @@ -196,6 +196,7 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback = (ShelleyBasedEraAllegra, ShelleyTx _ tx') -> GenTxAllegra (mkShelleyTx tx') (ShelleyBasedEraMary, ShelleyTx _ tx') -> GenTxMary (mkShelleyTx tx') (ShelleyBasedEraAlonzo, ShelleyTx _ tx') -> GenTxAlonzo (mkShelleyTx tx') + (ShelleyBasedEraBabbage, ShelleyTx _ _tx') -> error "TODO:Babbage" fromGenTxId :: GenTxId CardanoBlock -> TxId fromGenTxId (Block.GenTxIdShelley (Mempool.ShelleyTxId i)) = fromShelleyTxId i diff --git a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/Tx.hs b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/Tx.hs index e80c169220d..0b4a3f92178 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/Tx.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/Tx.hs @@ -86,12 +86,14 @@ mkGenesisTransaction key _payloadSize ttl fee txins txouts ShelleyBasedEraAllegra -> TxFeeExplicit TxFeesExplicitInAllegraEra fee ShelleyBasedEraMary -> TxFeeExplicit TxFeesExplicitInMaryEra fee ShelleyBasedEraAlonzo -> TxFeeExplicit TxFeesExplicitInAlonzoEra fee + ShelleyBasedEraBabbage -> TxFeeExplicit TxFeesExplicitInBabbageEra fee validityUpperBound = case shelleyBasedEra @ era of ShelleyBasedEraShelley -> TxValidityUpperBound ValidityUpperBoundInShelleyEra ttl ShelleyBasedEraAllegra -> TxValidityUpperBound ValidityUpperBoundInAllegraEra ttl ShelleyBasedEraMary -> TxValidityUpperBound ValidityUpperBoundInMaryEra ttl ShelleyBasedEraAlonzo -> TxValidityUpperBound ValidityUpperBoundInAlonzoEra ttl - + ShelleyBasedEraBabbage -> TxValidityUpperBound ValidityUpperBoundInBabbageEra ttl + mkTransaction :: forall era . IsShelleyBasedEra era => SigningKey PaymentKey @@ -132,6 +134,7 @@ mkFee f = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxFeeExplicit TxFeesExplicitInAllegraEra f ShelleyBasedEraMary -> TxFeeExplicit TxFeesExplicitInMaryEra f ShelleyBasedEraAlonzo -> TxFeeExplicit TxFeesExplicitInAlonzoEra f + ShelleyBasedEraBabbage -> TxFeeExplicit TxFeesExplicitInBabbageEra f mkValidityUpperBound :: forall era . IsShelleyBasedEra era @@ -142,6 +145,7 @@ mkValidityUpperBound ttl = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxValidityUpperBound ValidityUpperBoundInAllegraEra ttl ShelleyBasedEraMary -> TxValidityUpperBound ValidityUpperBoundInMaryEra ttl ShelleyBasedEraAlonzo -> TxValidityUpperBound ValidityUpperBoundInAlonzoEra ttl + ShelleyBasedEraBabbage -> TxValidityUpperBound ValidityUpperBoundInBabbageEra ttl mkTransactionGen :: forall era . IsShelleyBasedEra era @@ -206,7 +210,8 @@ mkTxOutValueAdaOnly l = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxOutAdaOnly AdaOnlyInAllegraEra l ShelleyBasedEraMary -> TxOutValue MultiAssetInMaryEra $ lovelaceToValue l ShelleyBasedEraAlonzo -> TxOutValue MultiAssetInAlonzoEra $ lovelaceToValue l - + ShelleyBasedEraBabbage -> TxOutValue MultiAssetInBabbageEra $ lovelaceToValue l + txOutValueToLovelace :: TxOutValue era -> Lovelace txOutValueToLovelace = \case TxOutAdaOnly AdaOnlyInByronEra x -> x @@ -222,3 +227,4 @@ txInModeCardano tx = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxInMode tx AllegraEraInCardanoMode ShelleyBasedEraMary -> TxInMode tx MaryEraInCardanoMode ShelleyBasedEraAlonzo -> TxInMode tx AlonzoEraInCardanoMode + ShelleyBasedEraBabbage -> TxInMode tx BabbageEraInCardanoMode diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs index fb5f2c69124..d962af009ae 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs @@ -66,6 +66,7 @@ withEra :: (forall era. IsShelleyBasedEra era => AsType era -> ActionM x) -> Act withEra action = do era <- get $ User TEra case era of + AnyCardanoEra BabbageEra -> action AsBabbageEra AnyCardanoEra AlonzoEra -> action AsAlonzoEra AnyCardanoEra MaryEra -> action AsMaryEra AnyCardanoEra AllegraEra -> action AsAllegraEra diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Wallet.hs b/bench/tx-generator/src/Cardano/Benchmarking/Wallet.hs index 0a4a594c22a..5a84181039b 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Wallet.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Wallet.hs @@ -172,6 +172,7 @@ genTx protocolParameters (collateral, collFunds) fee metadata witness inFunds ou ShelleyBasedEraAllegra -> TxValidityNoUpperBound ValidityNoUpperBoundInAllegraEra ShelleyBasedEraMary -> TxValidityNoUpperBound ValidityNoUpperBoundInMaryEra ShelleyBasedEraAlonzo -> TxValidityNoUpperBound ValidityNoUpperBoundInAlonzoEra + ShelleyBasedEraBabbage -> TxValidityNoUpperBound ValidityNoUpperBoundInBabbageEra newtype WalletScript era = WalletScript { runWalletScript :: IO (WalletStep era) } @@ -232,3 +233,4 @@ mkTxOutValueAdaOnly l = case shelleyBasedEra @ era of ShelleyBasedEraAllegra -> TxOutAdaOnly AdaOnlyInAllegraEra l ShelleyBasedEraMary -> TxOutValue MultiAssetInMaryEra $ lovelaceToValue l ShelleyBasedEraAlonzo -> TxOutValue MultiAssetInAlonzoEra $ lovelaceToValue l + ShelleyBasedEraBabbage -> TxOutValue MultiAssetInBabbageEra $ lovelaceToValue l