From e219d752f0dc78faa3fe483b4b13f41fc2f7c263 Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 23 Sep 2024 13:59:32 +0000 Subject: [PATCH 1/4] Bump ouroboros-network dependency to version 0.17 --- .gitignore | 1 + cabal.project | 10 ++++------ flake.lock | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a841ec7fb7b..b91f91736aa 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ package.json # buildkite artifacts testing artifacts deposit-* +cabal.project.freeze diff --git a/cabal.project b/cabal.project index ca5869d8391..90e9703e79a 100644 --- a/cabal.project +++ b/cabal.project @@ -50,11 +50,11 @@ repository cardano-haskell-packages d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee -- repeating the index-state for hackage to work around hackage.nix parsing limitation -index-state: 2024-08-08T00:00:00Z +index-state: 2024-09-23T00:00:00Z index-state: - , hackage.haskell.org 2024-08-08T00:00:00Z - , cardano-haskell-packages 2024-09-01T03:50:08Z + , hackage.haskell.org 2024-09-23T00:00:00Z + , cardano-haskell-packages 2024-09-20T19:39:13Z packages: lib/address-derivation-discovery @@ -187,9 +187,7 @@ constraints: , io-classes >= 1.4 , io-classes -asserts - , ouroboros-consensus-cardano ^>= 0.18 - , ouroboros-network ^>= 0.16.1 - , ouroboros-network-protocols ^>= 0.9 + , ouroboros-network ^>= 0.17 -- Related to: https://github.com/haskell/cabal/issues/8554 diff --git a/flake.lock b/flake.lock index cd12ab19fde..91877520c47 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1725170790, - "narHash": "sha256-dByd5I847MxV5i9kps89yL1OAvi7iDyC95BU7EM2wtw=", + "lastModified": 1726886523, + "narHash": "sha256-AEcPggMhxKSPlQPxciYiuJ9RRSqvszaZQQq5JEGICwc=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "3bed5fccc06ecc11d4a8427112f107876263e0f3", + "rev": "110f4bd9adf3809fa00af7807fb7f3edbf3d6538", "type": "github" }, "original": { From 1ac35fca441a4b01843e300a8378047d5a2ae65c Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 23 Sep 2024 14:20:42 +0000 Subject: [PATCH 2/4] Remove cardano api deprecations --- lib/cardano-api-extra/lib/Cardano/Api/Gen.hs | 16 +++++++++------- .../Primitive/Ledger/Read/Tx/Features/Outputs.hs | 5 ++++- .../Cardano/Wallet/Primitive/Ledger/Shelley.hs | 3 ++- .../Cardano/Wallet/Shelley/TransactionSpec.hs | 4 ++-- .../src/Cardano/Wallet/Shelley/Transaction.hs | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs b/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs index 62d6fe8eec7..6d49c91e03b 100644 --- a/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs +++ b/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs @@ -225,7 +225,7 @@ import Cardano.Api , Witness (..) , byronAddressInEra , collectTxBodyScriptWitnesses - , createAndValidateTransactionBody + , createTransactionBody , forEraMaybeEon , hashScript , languageOfScriptLanguageInEra @@ -245,7 +245,6 @@ import Cardano.Api , scriptLanguageSupportedInEra , shelleyAddressInEra , validateAndHashStakePoolMetadata - , valueFromList ) import Cardano.Api.Byron ( KeyWitness (ByronKeyWitness) @@ -340,6 +339,9 @@ import Data.Word , Word32 , Word64 ) +import GHC.IsList + ( fromList + ) import Network.Socket ( PortNumber ) @@ -760,7 +762,7 @@ genValueForTxOut = do ] assetQuantities <- infiniteListOf genUnsignedQuantity ada <- fromIntegral <$> genCoinForTxOutAdaValue - return $ valueFromList $ (AdaAssetId, ada) : zip assetIds assetQuantities + return $ fromList $ (AdaAssetId, ada) : zip assetIds assetQuantities -- | Generate a 'Value' which could represent the balance of a partial -- transaction, where both ada and other assets can be included, and quantities @@ -779,13 +781,13 @@ genSignedValue = do [ genCoin , negate <$> genCoin ] - return $ valueFromList $ (AdaAssetId, ada) : zip assetIds assetQuantities + return $ fromList $ (AdaAssetId, ada) : zip assetIds assetQuantities -- | Generate a 'Value' suitable for minting, i.e. non-ADA asset ID and a -- positive or negative quantity. genValueForMinting :: Gen Value genValueForMinting = - valueFromList <$> listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity) + fromList <$> listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity) genTxMintValue :: forall era. CardanoEra era -> Gen (TxMintValue BuildTx era) genTxMintValue era = withEraWitness era $ \supported -> @@ -1852,7 +1854,7 @@ genTxBodyContent era = withEraWitness era $ \sbe -> do genTxBody :: CardanoEra era -> Gen (TxBody era) genTxBody era = withEraWitness era $ \se -> do - res <- createAndValidateTransactionBody se <$> genTxBodyContent era + res <- createTransactionBody se <$> genTxBodyContent era case res of Left err -> error (displayError err) Right txBody -> pure txBody @@ -1864,7 +1866,7 @@ displayError = show -- balancing. genTxBodyForBalancing :: CardanoEra era -> Gen (TxBody era) genTxBodyForBalancing era = withEraWitness era $ \se -> do - res <- createAndValidateTransactionBody se <$> genStrippedContent + res <- createTransactionBody se <$> genStrippedContent case res of Left err -> error (displayError err) Right txBody -> pure txBody diff --git a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Read/Tx/Features/Outputs.hs b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Read/Tx/Features/Outputs.hs index 071b1af6c5e..fa6194f0a8d 100644 --- a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Read/Tx/Features/Outputs.hs +++ b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Read/Tx/Features/Outputs.hs @@ -82,6 +82,9 @@ import qualified Cardano.Wallet.Primitive.Types.TokenBundle as TokenBundle import qualified Cardano.Wallet.Primitive.Types.TokenPolicyId as W import qualified Cardano.Wallet.Primitive.Types.TokenQuantity as W import qualified Cardano.Wallet.Primitive.Types.Tx.TxOut as W +import qualified GHC.IsList as GHC + ( toList + ) {-# INLINABLE getOutputs #-} getOutputs :: forall era . IsEra era => Outputs era -> [W.TxOut] @@ -149,7 +152,7 @@ fromCardanoValue = uncurry TokenBundle.fromFlatList . extract where extract value = ( fromCardanoLovelace $ Cardano.selectLovelace value - , mkBundle $ Cardano.valueToList value + , mkBundle $ GHC.toList value ) -- Do Integer to Natural conversion. Quantities from ledger TxOuts can diff --git a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs index e96f5b2ebfe..1cea5402504 100644 --- a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs +++ b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs @@ -339,6 +339,7 @@ import qualified Data.ListMap as ListMap import qualified Data.Map.Strict as Map import qualified Data.Percentage as Percentage import qualified Data.Set as Set +import qualified GHC.IsList as GHC import qualified Ouroboros.Consensus.Protocol.Praos as Consensus import qualified Ouroboros.Consensus.Protocol.Praos.Header as Consensus import qualified Ouroboros.Consensus.Protocol.TPraos as Consensus @@ -935,7 +936,7 @@ toCardanoTxOut era refScriptM = case era of ] toCardanoValue :: TokenBundle.TokenBundle -> Cardano.Value -toCardanoValue tb = Cardano.valueFromList $ +toCardanoValue tb = GHC.fromList $ (Cardano.AdaAssetId, coinToQuantity coin) : map (bimap toCardanoAssetId toQuantity) bundle where diff --git a/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs b/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs index 468131a4019..b5ba2a19755 100644 --- a/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs +++ b/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs @@ -422,7 +422,7 @@ showTransactionBody -> String showTransactionBody recentEra = either Cardano.displayError show - . Cardano.createAndValidateTransactionBody + . Cardano.createTransactionBody (Write.shelleyBasedEraFromRecentEra recentEra) unsafeMakeTransactionBody @@ -431,7 +431,7 @@ unsafeMakeTransactionBody -> Cardano.TxBody (Write.CardanoApiEra era) unsafeMakeTransactionBody recentEra = either (error . Cardano.displayError) id - . Cardano.createAndValidateTransactionBody + . Cardano.createTransactionBody (Write.shelleyBasedEraFromRecentEra recentEra) stakeAddressForKey diff --git a/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs b/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs index d706f373b47..cba92b44c95 100644 --- a/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs +++ b/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs @@ -826,7 +826,7 @@ mkUnsignedTx = extractValidatedOutputs cs >>= \outs -> left toErrMkTx $ fmap removeDummyInput - $ Cardano.createAndValidateTransactionBody shelleyEra + $ Cardano.createTransactionBody shelleyEra Cardano.TxBodyContent { Cardano.txIns = inputWits From e770f8eebbed0cdd031833ac375c7f2a327eae5a Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 23 Sep 2024 14:32:55 +0000 Subject: [PATCH 3/4] Rename forall in forAll from Test.StateMachine dep --- lib/unit/test/unit/Cardano/Wallet/DB/StateMachine.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/unit/test/unit/Cardano/Wallet/DB/StateMachine.hs b/lib/unit/test/unit/Cardano/Wallet/DB/StateMachine.hs index d0a507d5d66..75925b1e98f 100644 --- a/lib/unit/test/unit/Cardano/Wallet/DB/StateMachine.hs +++ b/lib/unit/test/unit/Cardano/Wallet/DB/StateMachine.hs @@ -327,8 +327,8 @@ import Test.StateMachine , Reference , StateMachine , Symbolic + , forAll , forAllCommands - , forall , member , prettyCommands , runCommands @@ -684,7 +684,7 @@ transition m c = after . lockstep m c precondition :: Model s Symbolic -> Cmd s :@ Symbolic -> Logic precondition (Model _ wids) (At c) = - forall (toList c) (`member` map fst wids) + forAll (toList c) (`member` map fst wids) postcondition :: (Eq s, Show s) From db28ecef35f17c6d3f9c4f4e8e20f4783fc69fb6 Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 23 Sep 2024 14:34:40 +0000 Subject: [PATCH 4/4] Bump node runtime dependency --- flake.lock | 120 ++++++++++++++++------------------------------------- flake.nix | 2 +- 2 files changed, 36 insertions(+), 86 deletions(-) diff --git a/flake.lock b/flake.lock index 91877520c47..e94bdef1d90 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ "CHaP_2": { "flake": false, "locked": { - "lastModified": 1725170790, - "narHash": "sha256-dByd5I847MxV5i9kps89yL1OAvi7iDyC95BU7EM2wtw=", + "lastModified": 1725978043, + "narHash": "sha256-3AwgQ308g74rISxUlbzQRX3At0trVoH836vBwkcFFYg=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "3bed5fccc06ecc11d4a8427112f107876263e0f3", + "rev": "ce5ba82d474225506523e66a4050718de7e2b3fe", "type": "github" }, "original": { @@ -309,7 +309,6 @@ "nixpkgs" ], "iohkNix": "iohkNix", - "nix2container": "nix2container_2", "nixpkgs": [ "cardano-node-runtime", "haskellNix", @@ -320,16 +319,16 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1725255033, - "narHash": "sha256-VIwEjpaGk09+dAcKELjLSR2OP3qBCWTGHpd0SBjgbVc=", + "lastModified": 1726677789, + "narHash": "sha256-utAO4ZP9EAW4LdMT/hdMoykwT/h9gizoVvCbmYfAZSQ=", "owner": "IntersectMBO", "repo": "cardano-node", - "rev": "efd560070aaf042d1eb4680ae37fc607c7742319", + "rev": "341ea87ba3b4936188f8c2d4f09bbf1976a7926e", "type": "github" }, "original": { "owner": "IntersectMBO", - "ref": "9.1.1", + "ref": "9.2.0", "repo": "cardano-node", "type": "github" } @@ -667,25 +666,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_6": { - "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1710146030, @@ -810,11 +791,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1719794527, - "narHash": "sha256-qHo/KumtwAzPkfLWODu/6EFY/LeK+C7iPJyAUdT8tGA=", + "lastModified": 1725928375, + "narHash": "sha256-XO/6kJ77bR99bAuRGr9PleQX75vde5CbSU+6Xf3e8NQ=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "da2a3bc9bd1b3dd41bb147279529c471c615fd3e", + "rev": "68cfb288b958e9d7a1329df614684132f44bd2b3", "type": "github" }, "original": { @@ -847,6 +828,7 @@ "hls-2.6": "hls-2.6", "hls-2.7": "hls-2.7", "hls-2.8": "hls-2.8", + "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -900,7 +882,7 @@ "hls-2.6": "hls-2.6_2", "hls-2.7": "hls-2.7_2", "hls-2.8": "hls-2.8_2", - "hls-2.9": "hls-2.9", + "hls-2.9": "hls-2.9_2", "hpc-coveralls": "hpc-coveralls_2", "hydra": "hydra_2", "iserv-proxy": "iserv-proxy_2", @@ -1263,6 +1245,23 @@ } }, "hls-2.9": { + "flake": false, + "locked": { + "lastModified": 1718469202, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.9.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.9_2": { "flake": false, "locked": { "lastModified": 1718469202, @@ -1627,29 +1626,10 @@ "type": "github" } }, - "nix2container_2": { - "inputs": { - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_6" - }, - "locked": { - "lastModified": 1712990762, - "narHash": "sha256-hO9W3w7NcnYeX8u8cleHiSpK2YJo7ecarFTUlbybl7k=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "20aad300c925639d5d6cbe30013c8357ce9f2a2e", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, "nix_2": { "inputs": { "lowdown-src": "lowdown-src_2", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "nixpkgs-regression": "nixpkgs-regression_2" }, "locked": { @@ -2102,21 +2082,6 @@ } }, "nixpkgs_6": { - "locked": { - "lastModified": 1712920918, - "narHash": "sha256-1yxFvUcJfUphK9V91KufIQom7gCsztza0H4Rz2VCWUU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "92323443a56f4e9fc4e4b712e3119f66d0969297", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { "locked": { "lastModified": 1708343346, "narHash": "sha256-qlzHvterVRzS8fS0ophQpkh0rqw0abijHEOAKm0HmV0=", @@ -2132,7 +2097,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -2266,7 +2231,7 @@ "cardano-node-runtime": "cardano-node-runtime", "customConfig": "customConfig_2", "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "hackage": "hackage", "haskellNix": "haskellNix_2", "hostNixpkgs": [ @@ -2457,7 +2422,7 @@ "std", "blank" ], - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "paisano": "paisano", "paisano-tui": "paisano-tui", "terranix": [ @@ -2511,21 +2476,6 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tullia": { "inputs": { "nix-nomad": "nix-nomad", @@ -2568,7 +2518,7 @@ }, "utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1710146030, diff --git a/flake.nix b/flake.nix index 566b0ea3d98..867c6d9ea0b 100644 --- a/flake.nix +++ b/flake.nix @@ -142,7 +142,7 @@ flake = false; }; customConfig.url = "github:input-output-hk/empty-flake"; - cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=9.1.1"; + cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=9.2.0"; }; outputs = { self, nixpkgs, nixpkgs-unstable, hostNixpkgs, flake-utils,