From 62537f4890037608872ba06688469b2786e107a6 Mon Sep 17 00:00:00 2001 From: Konstantinos Lambrou-Latreille Date: Wed, 21 Jun 2023 13:12:12 -0400 Subject: [PATCH 01/24] Upgrade GHC from 8.10.7 to 9.2.7 --- .../library/cabal-project-index-state.nix | 2 +- .../library/ghc-compiler-nix-name.nix | 2 +- flake.lock | 586 ++++-------------- 3 files changed, 108 insertions(+), 482 deletions(-) diff --git a/__std__/cells/plutus-apps/library/cabal-project-index-state.nix b/__std__/cells/plutus-apps/library/cabal-project-index-state.nix index 762cddf60a..4862aab524 100644 --- a/__std__/cells/plutus-apps/library/cabal-project-index-state.nix +++ b/__std__/cells/plutus-apps/library/cabal-project-index-state.nix @@ -2,4 +2,4 @@ { inputs, cell }: -cell.library.plutus-apps-project.index-state +cell.library.plutus-apps-project.index-state-max diff --git a/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix b/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix index bb8ff99fa7..9c48faaa81 100644 --- a/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix +++ b/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix @@ -2,4 +2,4 @@ { inputs, cell }: -"ghc8107" +"ghc927" diff --git a/flake.lock b/flake.lock index e89dcdd838..f7f8dc6ad6 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1683628047, - "narHash": "sha256-p8H6fHmcTlerNB/SxHoWjXR5A0+rFUXJb39jP2jon1g=", + "lastModified": 1687312611, + "narHash": "sha256-Tvq04QEK/Kkj977GM3p7KxGtOrl15ef2y6OagSS5gtM=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "94cad9a3163ffc48b8d736ca9a448b4801b697e9", + "rev": "42e80e6600314053b7e0db2cb71725b9a1c8cdcf", "type": "github" }, "original": { @@ -48,21 +48,6 @@ "type": "github" } }, - "blank_2": { - "locked": { - "lastModified": 1625557891, - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", - "owner": "divnix", - "repo": "blank", - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "blank", - "type": "github" - } - }, "cabal-32": { "flake": false, "locked": { @@ -83,11 +68,11 @@ "cabal-34": { "flake": false, "locked": { - "lastModified": 1640353650, - "narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=", + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", "owner": "haskell", "repo": "cabal", - "rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", "type": "github" }, "original": { @@ -100,11 +85,11 @@ "cabal-36": { "flake": false, "locked": { - "lastModified": 1641652457, - "narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=", + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", "owner": "haskell", "repo": "cabal", - "rev": "f27667f8ec360c475027dcaee0138c937477b070", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", "type": "github" }, "original": { @@ -131,35 +116,6 @@ } }, "devshell": { - "inputs": { - "flake-utils": [ - "haskell-nix", - "tullia", - "std", - "flake-utils" - ], - "nixpkgs": [ - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1663445644, - "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", - "owner": "numtide", - "repo": "devshell", - "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "devshell_2": { "inputs": { "flake-utils": [ "std", @@ -185,35 +141,6 @@ } }, "dmerge": { - "inputs": { - "nixlib": [ - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ], - "yants": [ - "haskell-nix", - "tullia", - "std", - "yants" - ] - }, - "locked": { - "lastModified": 1659548052, - "narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=", - "owner": "divnix", - "repo": "data-merge", - "rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "data-merge", - "type": "github" - } - }, - "dmerge_2": { "inputs": { "nixlib": [ "std", @@ -272,22 +199,6 @@ } }, "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_4": { "flake": false, "locked": { "lastModified": 1673956053, @@ -305,65 +216,21 @@ }, "flake-utils": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", + "lastModified": 1679360468, + "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", + "owner": "hamishmack", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", "type": "github" }, "original": { - "owner": "numtide", + "owner": "hamishmack", + "ref": "hkm/nested-hydraJobs", "repo": "flake-utils", "type": "github" } }, "flake-utils_2": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -378,7 +245,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_3": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -393,7 +260,7 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_4": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -466,25 +333,6 @@ "type": "github" } }, - "gomod2nix": { - "inputs": { - "nixpkgs": "nixpkgs_2", - "utils": "utils" - }, - "locked": { - "lastModified": 1655245309, - "narHash": "sha256-d/YPoQ/vFn1+GTmSdvbSBSTOai61FONxB4+Lt6w/IVI=", - "owner": "tweag", - "repo": "gomod2nix", - "rev": "40d32f82fc60d66402eb0972e6e368aeab3faf58", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "gomod2nix", - "type": "github" - } - }, "hackage-nix": { "flake": false, "locked": { @@ -531,6 +379,8 @@ "hackage": [ "hackage-nix" ], + "hls-1.10": "hls-1.10", + "hls-2.0": "hls-2.0", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -542,17 +392,17 @@ "nixpkgs-2111": "nixpkgs-2111", "nixpkgs-2205": "nixpkgs-2205", "nixpkgs-2211": "nixpkgs-2211", + "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", - "stackage": "stackage", - "tullia": "tullia" + "stackage": "stackage" }, "locked": { - "lastModified": 1675900540, - "narHash": "sha256-yItNeUA3yG0VBle6PG0KOnKV/ZVMG8gAMLZKGp0HiWY=", + "lastModified": 1687308678, + "narHash": "sha256-Vlj+78vMgRQLPbHJYH3ZatYQW7RAk4xJTTaop3SYAzA=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "7075077d46e684d50e1b00759bb4590426c99c70", + "rev": "f1c9456823444534696710a2f78e61be3f10f2f8", "type": "github" }, "original": { @@ -561,6 +411,40 @@ "type": "github" } }, + "hls-1.10": { + "flake": false, + "locked": { + "lastModified": 1680000865, + "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.0": { + "flake": false, + "locked": { + "lastModified": 1684398654, + "narHash": "sha256-RW44up2BIyBBYN6tZur5f9kDDR3kr0Rd+TgPbLTfwB4=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "20c6d1e731cd9c0beef7338e2fc7a8126ba9b6fb", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.0.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -588,11 +472,11 @@ ] }, "locked": { - "lastModified": 1646878427, - "narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=", + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", "owner": "NixOS", "repo": "hydra", - "rev": "28b682b85b7efc5cf7974065792a1f22203a5927", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", "type": "github" }, "original": { @@ -669,49 +553,9 @@ "type": "github" } }, - "mdbook-kroki-preprocessor_2": { - "flake": false, - "locked": { - "lastModified": 1661755005, - "narHash": "sha256-1TJuUzfyMycWlOQH67LR63/ll2GDZz25I3JfScy/Jnw=", - "owner": "JoelCourtney", - "repo": "mdbook-kroki-preprocessor", - "rev": "93adb5716d035829efed27f65f2f0833a7d3e76f", - "type": "github" - }, - "original": { - "owner": "JoelCourtney", - "repo": "mdbook-kroki-preprocessor", - "type": "github" - } - }, "n2c": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": [ - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1665039323, - "narHash": "sha256-SAh3ZjFGsaCI8FRzXQyp56qcGdAqgKEfJWPCQ0Sr7tQ=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "b008fe329ffb59b67bf9e7b08ede6ee792f2741a", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, - "n2c_2": { - "inputs": { - "flake-utils": "flake-utils_7", "nixpkgs": [ "std", "nixpkgs" @@ -738,110 +582,21 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1643066034, - "narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=", + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", "owner": "NixOS", "repo": "nix", - "rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "2.6.0", + "ref": "2.11.0", "repo": "nix", "type": "github" } }, - "nix-nomad": { - "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": [ - "haskell-nix", - "tullia", - "nix2container", - "flake-utils" - ], - "gomod2nix": "gomod2nix", - "nixpkgs": [ - "haskell-nix", - "tullia", - "nixpkgs" - ], - "nixpkgs-lib": [ - "haskell-nix", - "tullia", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1658277770, - "narHash": "sha256-T/PgG3wUn8Z2rnzfxf2VqlR1CBjInPE0l1yVzXxPnt0=", - "owner": "tristanpemble", - "repo": "nix-nomad", - "rev": "054adcbdd0a836ae1c20951b67ed549131fd2d70", - "type": "github" - }, - "original": { - "owner": "tristanpemble", - "repo": "nix-nomad", - "type": "github" - } - }, - "nix2container": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1658567952, - "narHash": "sha256-XZ4ETYAMU7XcpEeAFP3NOl9yDXNuZAen/aIJ84G+VgA=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "60bb43d405991c1378baf15a40b5811a53e32ffa", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, "nixago": { - "inputs": { - "flake-utils": [ - "haskell-nix", - "tullia", - "std", - "flake-utils" - ], - "nixago-exts": [ - "haskell-nix", - "tullia", - "std", - "blank" - ], - "nixpkgs": [ - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1661824785, - "narHash": "sha256-/PnwdWoO/JugJZHtDUioQp3uRiWeXHUdgvoyNbXesz8=", - "owner": "nix-community", - "repo": "nixago", - "rev": "8c1f9e5f1578d4b2ea989f618588d62a335083c3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago", - "type": "github" - } - }, - "nixago_2": { "inputs": { "flake-utils": [ "std", @@ -872,17 +627,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1632864508, - "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-21.05-small", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-22.05-small", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-2003": { @@ -935,11 +691,11 @@ }, "nixpkgs-2205": { "locked": { - "lastModified": 1663981975, - "narHash": "sha256-TKaxWAVJR+a5JJauKZqibmaM5e/Pi5tBDx9s8fl/kSE=", + "lastModified": 1682600000, + "narHash": "sha256-ha4BehR1dh8EnXSoE1m/wyyYVvHI9txjW4w5/oxsW5Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "309faedb8338d3ae8ad8f1043b3ccf48c9cc2970", + "rev": "50fc86b75d2744e1ab3837ef74b53f103a9b55a0", "type": "github" }, "original": { @@ -951,11 +707,11 @@ }, "nixpkgs-2211": { "locked": { - "lastModified": 1676253841, - "narHash": "sha256-jhuI8Mmky8VCD45OoJEuF6HdPLFBwNrHA0ljjZ/zkfw=", + "lastModified": 1685314633, + "narHash": "sha256-8LXBPqTQXl5ofkjpJ18JcbmLJ/lWDoMxtUwiDYv0wro=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a45a8916243a7d27acc358f4fc18c4491f3eeca8", + "rev": "c8a17ce7abc03c50cd072e9e6c9b389c5f61836b", "type": "github" }, "original": { @@ -965,101 +721,71 @@ "type": "github" } }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "indirect" - } - }, - "nixpkgs-stable": { + "nixpkgs-2305": { "locked": { - "lastModified": 1676177817, - "narHash": "sha256-OQnBnuKkpwkfNY31xQyfU5hNpLs1ilWt+hVY6ztEEOM=", + "lastModified": 1685338297, + "narHash": "sha256-+Aq4O0Jn1W1q927ZHc3Zn6RO7bwQGmb6O8xYoGy0KrM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1b82144edfcd0c86486d2e07c7298f85510e7fb8", + "rev": "6287b47dbfabbb8bfbb9b1b53d198ad58a774de4", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixpkgs-23.05-darwin", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-regression": { "locked": { - "lastModified": 1663905476, - "narHash": "sha256-0CSwRKaYravh9v6qSlBpM0gNg0UhKT2lL7Yn6Zbx7UM=", + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e14f9fb57315f0d4abde222364f19f88c77d2b79", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-stable": { "locked": { - "lastModified": 1653581809, - "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", + "lastModified": 1676177817, + "narHash": "sha256-OQnBnuKkpwkfNY31xQyfU5hNpLs1ilWt+hVY6ztEEOM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", + "rev": "1b82144edfcd0c86486d2e07c7298f85510e7fb8", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_3": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1654807842, - "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", + "lastModified": 1685347552, + "narHash": "sha256-9woSppRyUFo26yUffORTzttJ+apOt8MmCv6RxpPNTU4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fc909087cc3386955f21b4665731dbdaceefb1d8", + "rev": "f2f1ec390714d303cf84ba086e34e45b450dd8c4", "type": "github" }, "original": { "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1665087388, - "narHash": "sha256-FZFPuW9NWHJteATOf79rZfwfRn5fE0wi9kRzvGfDHPA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "95fda953f6db2e9496d2682c4fc7b82f959878f7", - "type": "github" - }, - "original": { - "owner": "nixos", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_2": { "locked": { "lastModified": 1663905476, "narHash": "sha256-0CSwRKaYravh9v6qSlBpM0gNg0UhKT2lL7Yn6Zbx7UM=", @@ -1093,8 +819,8 @@ }, "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_5", + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_2", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -1124,10 +850,10 @@ "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix", "iohk-nix": "iohk-nix", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock", - "std": "std_2" + "std": "std" } }, "sphinxcontrib-haddock": { @@ -1149,11 +875,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1667524765, - "narHash": "sha256-rY58ROG9paYqqhUPFxZArU59qOIatIFHrurhVo7JXX4=", + "lastModified": 1687306175, + "narHash": "sha256-wZzi1m5hteGQjZAhPQ+mp7T+buaV9WwHwy0sNJzPjI8=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "ed1ec5f81f9eb32eb627fd447088eb782e7ff71b", + "rev": "57f5246f08e0ebbe9f1612b67408391c81bde02e", "type": "github" }, "original": { @@ -1169,58 +895,20 @@ "dmerge": "dmerge", "flake-utils": "flake-utils_3", "makes": [ - "haskell-nix", - "tullia", "std", "blank" ], "mdbook-kroki-preprocessor": "mdbook-kroki-preprocessor", "microvm": [ - "haskell-nix", - "tullia", "std", "blank" ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_4", - "yants": "yants" - }, - "locked": { - "lastModified": 1665513321, - "narHash": "sha256-D6Pacw9yf/HMs84KYuCxHXnNDL7v43gtcka5URagFqE=", - "owner": "divnix", - "repo": "std", - "rev": "94a90eedb9cfc115b12ae8f6622d9904788559e4", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "std", - "type": "github" - } - }, - "std_2": { - "inputs": { - "blank": "blank_2", - "devshell": "devshell_2", - "dmerge": "dmerge_2", - "flake-utils": "flake-utils_6", - "makes": [ - "std", - "blank" - ], - "mdbook-kroki-preprocessor": "mdbook-kroki-preprocessor_2", - "microvm": [ - "std", - "blank" - ], - "n2c": "n2c_2", - "nixago": "nixago_2", "nixpkgs": [ "nixpkgs" ], - "yants": "yants_2" + "yants": "yants" }, "locked": { "lastModified": 1665513321, @@ -1236,69 +924,7 @@ "type": "github" } }, - "tullia": { - "inputs": { - "nix-nomad": "nix-nomad", - "nix2container": "nix2container", - "nixpkgs": [ - "haskell-nix", - "nixpkgs" - ], - "std": "std" - }, - "locked": { - "lastModified": 1666200256, - "narHash": "sha256-cJPS8zBu30SMhxMe7I8DWutwqMuhPsEez87y9gxMKc4=", - "owner": "input-output-hk", - "repo": "tullia", - "rev": "575362c2244498e8d2c97f72861510fa72e75d44", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "tullia", - "type": "github" - } - }, - "utils": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "yants": { - "inputs": { - "nixpkgs": [ - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660507851, - "narHash": "sha256-BKjq7JnVuUR/xDtcv6Vm9GYGKAblisXrAgybor9hT/s=", - "owner": "divnix", - "repo": "yants", - "rev": "0b895ca02a8fa72bad50b454cb3e7d8a66407c96", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "yants", - "type": "github" - } - }, - "yants_2": { "inputs": { "nixpkgs": [ "std", From 4d7bce63008ae92874bf406180bbddba7bf96b2a Mon Sep 17 00:00:00 2001 From: Konstantinos Lambrou-Latreille Date: Thu, 22 Jun 2023 08:28:06 -0400 Subject: [PATCH 02/24] WIP --- CONTRIBUTING.adoc | 33 +++++++++++++++++++ .../haskell-language-server-project.nix | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 65340a66ae..6d43815443 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -211,6 +211,39 @@ Specifically, you will probably want to say `nix flake lock --update-input Date: Thu, 27 Jul 2023 10:14:33 +0200 Subject: [PATCH 03/24] Update cardano-wallet dependency --- .../library/ghc-compiler-nix-name.nix | 2 +- cabal.project | 108 ++++++------------ flake.lock | 12 +- nix/pkgs/haskell/sha256map.nix | 7 +- 4 files changed, 46 insertions(+), 83 deletions(-) diff --git a/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix b/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix index 9c48faaa81..8cfb3d0d0e 100644 --- a/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix +++ b/__std__/cells/plutus-apps/library/ghc-compiler-nix-name.nix @@ -2,4 +2,4 @@ { inputs, cell }: -"ghc927" +"ghc928" diff --git a/cabal.project b/cabal.project index 4940af1758..6848d44403 100644 --- a/cabal.project +++ b/cabal.project @@ -11,12 +11,10 @@ repository cardano-haskell-packages c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56 d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee -index-state: 2023-04-20T00:00:00Z - -- See CONTRIBUTING.adoc for how to update index-state index-state: - , hackage.haskell.org 2023-04-20T00:00:00Z - , cardano-haskell-packages 2023-05-10T00:00:00Z + , hackage.haskell.org 2023-07-27T00:00:00Z + , cardano-haskell-packages 2023-07-27T00:00:00Z packages: cardano-node-emulator cardano-node-socket-emulator @@ -60,40 +58,47 @@ allow-newer: , servant-server:aeson , servant-foreign:lens , blockfrost-api:lens + -- temporary + , quickcheck-contractmodel:* constraints: + -- cardano-wallet needs + , cardano-api ^>=8.2 + , cardano-slotting >= 0.1 + , ouroboros-network ^>= 0.8.1.0 + -- cardano-prelude-0.1.0.0 needs - , protolude <0.3.1 + -- , protolude <0.3.1 -- cardano-ledger-byron-0.1.0.0 needs - , cardano-binary <1.5.0.1 + -- , cardano-binary <1.5.0.1 -- plutus-core-1.0.0.1 needs - , cardano-crypto-class >2.0.0.0 - , algebraic-graphs <0.7 + -- , cardano-crypto-class >2.0.0.0 + -- , algebraic-graphs <0.7 -- cardano-ledger-core-0.1.0.0 needs - , cardano-crypto-class <2.0.0.1 + -- , cardano-crypto-class <2.0.0.1 -- cardano-crypto-class-2.0.0.0.1 needs - , cardano-prelude <0.1.0.1 + -- , cardano-prelude <0.1.0.1 -- dbvar from cardano-wallet needs - , io-classes <0.3.0.0 + -- , io-classes <0.3.0.0 -- newer typed-protocols need io-classes>=0.3.0.0 which is incompatible with dbvar's constraint above - , typed-protocols==0.1.0.0 + -- , typed-protocols==0.1.0.0 - , aeson >= 2 + -- , aeson >= 2 - , hedgehog >= 1.1 + -- , hedgehog >= 1.1 - , resource-pool <0.4.0.0 + -- , resource-pool <0.4.0.0 - , http2 <4.0.0 + -- , http2 <4.0.0 -- ouroboros-consensus-shelley-0.1.0.1 needs - , ouroboros-consensus-protocol==0.1.0.1 + -- , ouroboros-consensus-protocol==0.1.0.1 -- The plugin will typically fail when producing Haddock documentation. However, -- in this instance you can simply tell it to defer any errors to runtime (which @@ -133,75 +138,38 @@ package cardano-wallet-launcher package cardano-wallet-core-integration optimization: False --- Direct dependency. --- Compared to others, cardano-wallet doesn't bump dependencies very often. --- Making it a good place to start when bumping dependencies. --- As, for example, bumping the node first highly risks breaking API with the wallet. --- Unless early bug fixes are required, this is fine as the wallet tracks stable releases of the node. --- And it is indeed nice for plutus-apps to track stable releases of the node too. --- --- The current version is dated 2022/08/10 source-repository-package type: git location: https://github.com/input-output-hk/cardano-wallet - tag: 18a931648550246695c790578d4a55ee2f10463e + tag: 3f0d2f3abe706958fab8cdc528184068bd0453c9 + --sha256: 1xbr5qrz716mh3vhng64m4v6zhp03x5lcf0kld5mmm1yij0fadwa subdir: - lib/cli - lib/core - lib/core-integration - lib/dbvar - lib/launcher - lib/numeric - lib/shelley - lib/strict-non-empty-containers - lib/test-utils + -- lib/balance-tx + -- lib/coin-selection + -- lib/delta-store + -- lib/delta-table + -- lib/delta-types + -- lib/launcher + -- lib/numeric + -- lib/primitive + -- lib/test-utils lib/text-class + -- lib/wai-middleware-logging + lib/wallet + -- lib/wallet-benchmarks -- Should follow cardano-wallet. source-repository-package type: git location: https://github.com/input-output-hk/cardano-addresses - tag: b7273a5d3c21f1a003595ebf1e1f79c28cd72513 + tag: 6b55f96d57a181f898eb2a50531d3ae4280c549c + --sha256: 0yygam995i3mawk6hfgxb6v918phvqzyipzhjflff0l6zfrldy7f subdir: -- cardano-addresses-cli command-line -- cardano-addresses core --- This is needed because we rely on an unreleased branch of --- cardano-ledger-alonzo. The feature we need --- (evaluateTransactionExecutionUnitsWithLogs) in only included from --- cardano-ledger-alonzo version 1.0.0.0 --- See https://github.com/input-output-hk/cardano-ledger/pull/3111 -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-ledger - tag: da3e9ae10cf9ef0b805a046c84745f06643583c2 - subdir: - eras/alonzo/impl - eras/alonzo/test-suite - eras/babbage/impl - eras/babbage/test-suite - eras/byron/chain/executable-spec - eras/byron/crypto - eras/byron/crypto/test - eras/byron/ledger/executable-spec - eras/byron/ledger/impl - eras/byron/ledger/impl/test - eras/shelley/impl - eras/shelley/test-suite - eras/shelley-ma/impl - eras/shelley-ma/test-suite - libs/cardano-ledger-core - libs/cardano-ledger-pretty - libs/cardano-protocol-tpraos - libs/cardano-data - libs/vector-map - libs/set-algebra - libs/small-steps - libs/small-steps-test - libs/non-integral - source-repository-package type: git location: https://github.com/input-output-hk/marconi diff --git a/flake.lock b/flake.lock index f7f8dc6ad6..d53f89bcf7 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1687312611, - "narHash": "sha256-Tvq04QEK/Kkj977GM3p7KxGtOrl15ef2y6OagSS5gtM=", + "lastModified": 1690341504, + "narHash": "sha256-RWMP2yOu1/k6hUpQqn1PZ/n1e07lkiZjIGK6ZK+EAns=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "42e80e6600314053b7e0db2cb71725b9a1c8cdcf", + "rev": "21f05b352252442b483677211ad401e9458e802e", "type": "github" }, "original": { @@ -336,11 +336,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1682036591, - "narHash": "sha256-QPrmInnsudgOP+bpJKzosItR0H1C5F54SmPLV8AlFPg=", + "lastModified": 1690331094, + "narHash": "sha256-xGJlmbRruW61N0rEcFn2pRlpLnE1TCKvvyz2nytYzE4=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "9d83fdf40d77bc15719c6e498da98dbd0714dfa4", + "rev": "efc8a53a648a6a3b0973aaefc93ace7d0ddf198d", "type": "github" }, "original": { diff --git a/nix/pkgs/haskell/sha256map.nix b/nix/pkgs/haskell/sha256map.nix index 68d2882155..ffcd4415b0 100644 --- a/nix/pkgs/haskell/sha256map.nix +++ b/nix/pkgs/haskell/sha256map.nix @@ -1,6 +1 @@ -{ - "https://github.com/input-output-hk/cardano-addresses"."b7273a5d3c21f1a003595ebf1e1f79c28cd72513" = "129r5kyiw10n2021bkdvnr270aiiwyq58h472d151ph0r7wpslgp"; - "https://github.com/input-output-hk/cardano-ledger"."da3e9ae10cf9ef0b805a046c84745f06643583c2" = "sha256-3VUZKkLu1R43GUk9IwgsGQ55O0rnu8NrCkFX9gqA4ck="; - "https://github.com/input-output-hk/cardano-wallet"."18a931648550246695c790578d4a55ee2f10463e" = "0i40hp1mdbljjcj4pn3n6zahblkb2jmpm8l4wnb36bya1pzf66fx"; - "https://github.com/input-output-hk/marconi"."7285a3bc1ae53bf672c7cc2359210c6c29fbce44" = "sha256-Z1ex1CqsIDzhzE8tbHtFvK+V+W3Fn1me2tHL/D+HhUE="; -} +{ } From bad6900eb96816dc0e9eaf958c05288b226efeba Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Thu, 27 Jul 2023 10:14:50 +0200 Subject: [PATCH 04/24] change cardano-api bounds --- .../cardano-node-emulator.cabal | 2 +- .../cardano-node-socket-emulator.cabal | 2 +- doc/plutus-doc.cabal | 2 +- .../plutus-chain-index-core.cabal | 4 ++-- plutus-chain-index/plutus-chain-index.cabal | 2 +- .../plutus-contract-model.cabal | 2 +- plutus-contract/plutus-contract.cabal | 4 ++-- plutus-example/plutus-example.cabal | 18 +++++++++--------- plutus-ledger/plutus-ledger.cabal | 4 ++-- .../plutus-pab-executables.cabal | 6 +++--- plutus-pab/plutus-pab.cabal | 4 ++-- plutus-script-utils/plutus-script-utils.cabal | 2 +- .../plutus-tx-constraints.cabal | 4 ++-- plutus-use-cases/plutus-use-cases.cabal | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cardano-node-emulator/cardano-node-emulator.cabal b/cardano-node-emulator/cardano-node-emulator.cabal index 86a8d28ce1..e86effb68a 100644 --- a/cardano-node-emulator/cardano-node-emulator.cabal +++ b/cardano-node-emulator/cardano-node-emulator.cabal @@ -52,7 +52,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , cardano-crypto , cardano-ledger-alonzo , cardano-ledger-babbage diff --git a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal index bec2f8c4d3..1d5e343719 100644 --- a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal +++ b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal @@ -48,7 +48,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-ledger-alonzo , cardano-ledger-byron , cardano-ledger-core diff --git a/doc/plutus-doc.cabal b/doc/plutus-doc.cabal index 05d76c2d2e..e5ab17c9d1 100644 --- a/doc/plutus-doc.cabal +++ b/doc/plutus-doc.cabal @@ -91,7 +91,7 @@ executable doc-doctests -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , plutus-core >=1.0.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-chain-index-core/plutus-chain-index-core.cabal b/plutus-chain-index-core/plutus-chain-index-core.cabal index 4c801c01bd..7806399a46 100644 --- a/plutus-chain-index-core/plutus-chain-index-core.cabal +++ b/plutus-chain-index-core/plutus-chain-index-core.cabal @@ -83,7 +83,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , iohk-monitoring , ouroboros-network , ouroboros-network-framework @@ -161,7 +161,7 @@ test-suite plutus-chain-index-test -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-chain-index/plutus-chain-index.cabal b/plutus-chain-index/plutus-chain-index.cabal index f172ef5b5f..d95619ba78 100644 --- a/plutus-chain-index/plutus-chain-index.cabal +++ b/plutus-chain-index/plutus-chain-index.cabal @@ -66,7 +66,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , iohk-monitoring , ouroboros-network , plutus-ledger-api >=1.0.0 diff --git a/plutus-contract-model/plutus-contract-model.cabal b/plutus-contract-model/plutus-contract-model.cabal index 550b658d22..cbdc455510 100644 --- a/plutus-contract-model/plutus-contract-model.cabal +++ b/plutus-contract-model/plutus-contract-model.cabal @@ -74,7 +74,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 , quickcheck-contractmodel >=0.1.4.0 diff --git a/plutus-contract/plutus-contract.cabal b/plutus-contract/plutus-contract.cabal index 2332d7af1c..a11afa403c 100644 --- a/plutus-contract/plutus-contract.cabal +++ b/plutus-contract/plutus-contract.cabal @@ -128,7 +128,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-crypto , cardano-crypto-class , cardano-ledger-alonzo @@ -265,7 +265,7 @@ test-suite plutus-contract-test -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , plutus-core >=1.0.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-example/plutus-example.cabal b/plutus-example/plutus-example.cabal index 1fe66e22bd..5474244516 100644 --- a/plutus-example/plutus-example.cabal +++ b/plutus-example/plutus-example.cabal @@ -78,8 +78,8 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 - , cardano-cli >=1.35 + , cardano-api >=8.0 + , cardano-cli >=8.0 , cardano-ledger-alonzo , cardano-ledger-babbage , cardano-ledger-core @@ -118,7 +118,7 @@ executable plutus-example -------------------------- -- Other IOG dependencies -------------------------- - build-depends: cardano-api >=1.35 + build-depends: cardano-api >=8.0 ------------------------ -- Non-IOG dependencies @@ -137,7 +137,7 @@ executable create-script-context -- Local components -------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , plutus-example -------------------------- @@ -168,8 +168,8 @@ test-suite plutus-example-test -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 - , cardano-cli >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 + , cardano-cli >=8.0 , cardano-ledger-alonzo , cardano-ledger-core , cardano-ledger-shelley @@ -207,7 +207,7 @@ test-suite plutus-example-test ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T build-tool-depends: - , cardano-cli:cardano-cli >=1.35 - , cardano-node:cardano-node >=1.35 - , cardano-submit-api:cardano-submit-api >=1.35 + , cardano-cli:cardano-cli >=8.0 + , cardano-node:cardano-node >=8.0 + , cardano-submit-api:cardano-submit-api >=8.0 , plutus-example:create-script-context diff --git a/plutus-ledger/plutus-ledger.cabal b/plutus-ledger/plutus-ledger.cabal index 3459315f7a..235510c099 100644 --- a/plutus-ledger/plutus-ledger.cabal +++ b/plutus-ledger/plutus-ledger.cabal @@ -114,7 +114,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-binary , cardano-crypto , cardano-crypto-class @@ -194,7 +194,7 @@ test-suite plutus-ledger-test -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , cardano-crypto-class >=2.0.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-pab-executables/plutus-pab-executables.cabal b/plutus-pab-executables/plutus-pab-executables.cabal index 1b2f63a0a5..ba8df233e9 100644 --- a/plutus-pab-executables/plutus-pab-executables.cabal +++ b/plutus-pab-executables/plutus-pab-executables.cabal @@ -369,7 +369,7 @@ executable tx-inject -------------------------- -- Other IOG dependencies -------------------------- - build-depends: cardano-api >=1.35 + build-depends: cardano-api >=8.0 ------------------------ -- Non-IOG dependencies @@ -410,7 +410,7 @@ executable sync-client -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-slotting ------------------------ @@ -449,7 +449,7 @@ executable pab-cli -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-ledger-shelley , ouroboros-consensus-shelley diff --git a/plutus-pab/plutus-pab.cabal b/plutus-pab/plutus-pab.cabal index 507c570b46..92a117d32a 100644 --- a/plutus-pab/plutus-pab.cabal +++ b/plutus-pab/plutus-pab.cabal @@ -136,7 +136,7 @@ library -------------------------- build-depends: , cardano-addresses - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-crypto , cardano-crypto-class , cardano-ledger-alonzo @@ -247,7 +247,7 @@ test-suite plutus-pab-test-light -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-script-utils/plutus-script-utils.cabal b/plutus-script-utils/plutus-script-utils.cabal index a5746e7952..e303e47634 100644 --- a/plutus-script-utils/plutus-script-utils.cabal +++ b/plutus-script-utils/plutus-script-utils.cabal @@ -84,7 +84,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , cardano-ledger-alonzo , plutus-core >=1.0.0 , plutus-ledger-api >=1.0.0 diff --git a/plutus-tx-constraints/plutus-tx-constraints.cabal b/plutus-tx-constraints/plutus-tx-constraints.cabal index 3f8c1f53f4..b328bdb628 100644 --- a/plutus-tx-constraints/plutus-tx-constraints.cabal +++ b/plutus-tx-constraints/plutus-tx-constraints.cabal @@ -67,7 +67,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=1.35 + , cardano-api >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 @@ -106,7 +106,7 @@ test-suite plutus-tx-constraints-test -- Other IOG dependencies -------------------------- build-depends: - , cardano-api:{cardano-api, gen} >=1.35 + , cardano-api:{cardano-api, gen} >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 , plutus-tx-plugin >=1.0.0 diff --git a/plutus-use-cases/plutus-use-cases.cabal b/plutus-use-cases/plutus-use-cases.cabal index bdf9a950c1..1282698535 100644 --- a/plutus-use-cases/plutus-use-cases.cabal +++ b/plutus-use-cases/plutus-use-cases.cabal @@ -197,7 +197,7 @@ test-suite plutus-use-cases-test -- Other IOG dependencies -------------------------- build-depends: - cardano-api >=1.35 + cardano-api >=8.0 , cardano-binary , cardano-ledger-alonzo , cardano-ledger-babbage @@ -297,7 +297,7 @@ executable plutus-use-cases-scripts -- Other IOG dependencies -------------------------- build-depends: - cardano-api >=1.35 + cardano-api >=8.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 From 63c880862d897d0cacee84064df4c7da90a57a84 Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Thu, 3 Aug 2023 16:37:04 +0200 Subject: [PATCH 05/24] Upgrade haskell-language-server --- flake.lock | 8 ++++---- flake.nix | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index d53f89bcf7..c5570fea9d 100644 --- a/flake.lock +++ b/flake.lock @@ -352,16 +352,16 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1663135728, - "narHash": "sha256-ghyyig0GZXRXS56FxH8unpDceU06i/uGBCBmRwneZPw=", + "lastModified": 1672051165, + "narHash": "sha256-j3XRQTWa7jsVlimaxFZNnlE9IzWII9Prj1/+otks5FQ=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "ddb21a0c8d4e657c4b81ce250239bccf28fc9524", + "rev": "1916b5782d9f3204d25a1d8f94da4cfd83ae2607", "type": "github" }, "original": { "owner": "haskell", - "ref": "1.8.0.0", + "ref": "1.9.0.0", "repo": "haskell-language-server", "type": "github" } diff --git a/flake.nix b/flake.nix index ae640a5985..4f307c4149 100644 --- a/flake.nix +++ b/flake.nix @@ -56,8 +56,7 @@ flake = false; }; haskell-language-server = { - # TODO Bump to 1.9.0.0 once plutus-apps hits GHC 9.2 - url = "github:haskell/haskell-language-server?ref=1.8.0.0"; + url = "github:haskell/haskell-language-server?ref=1.9.0.0"; flake = false; }; }; From 4a0ef70d360be491029452debfd951d9a290e4e2 Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Thu, 3 Aug 2023 16:49:55 +0200 Subject: [PATCH 06/24] WIP --- cabal.project | 65 +++++++------------------------ plutus-ledger/plutus-ledger.cabal | 10 ++--- plutus-pab/plutus-pab.cabal | 16 ++++---- 3 files changed, 27 insertions(+), 64 deletions(-) diff --git a/cabal.project b/cabal.project index 6848d44403..0f79b7d247 100644 --- a/cabal.project +++ b/cabal.project @@ -26,7 +26,6 @@ packages: cardano-node-emulator plutus-contract plutus-contract-certification plutus-contract-model - plutus-example plutus-ledger plutus-pab plutus-pab-executables @@ -56,49 +55,15 @@ allow-newer: , servant:aeson , servant-client-core:aeson , servant-server:aeson + , persistent:aeson , servant-foreign:lens , blockfrost-api:lens -- temporary , quickcheck-contractmodel:* + , cardano-wallet:cardano-api + , ouroboros-consensus-byron:* constraints: - -- cardano-wallet needs - , cardano-api ^>=8.2 - , cardano-slotting >= 0.1 - , ouroboros-network ^>= 0.8.1.0 - - -- cardano-prelude-0.1.0.0 needs - -- , protolude <0.3.1 - - -- cardano-ledger-byron-0.1.0.0 needs - -- , cardano-binary <1.5.0.1 - - -- plutus-core-1.0.0.1 needs - -- , cardano-crypto-class >2.0.0.0 - -- , algebraic-graphs <0.7 - - -- cardano-ledger-core-0.1.0.0 needs - -- , cardano-crypto-class <2.0.0.1 - - -- cardano-crypto-class-2.0.0.0.1 needs - -- , cardano-prelude <0.1.0.1 - - -- dbvar from cardano-wallet needs - -- , io-classes <0.3.0.0 - - -- newer typed-protocols need io-classes>=0.3.0.0 which is incompatible with dbvar's constraint above - -- , typed-protocols==0.1.0.0 - - -- , aeson >= 2 - - -- , hedgehog >= 1.1 - - -- , resource-pool <0.4.0.0 - - -- , http2 <4.0.0 - - -- ouroboros-consensus-shelley-0.1.0.1 needs - -- , ouroboros-consensus-protocol==0.1.0.1 -- The plugin will typically fail when producing Haddock documentation. However, -- in this instance you can simply tell it to defer any errors to runtime (which @@ -135,8 +100,6 @@ package cardano-wallet-cli optimization: False package cardano-wallet-launcher optimization: False -package cardano-wallet-core-integration - optimization: False source-repository-package type: git @@ -144,19 +107,19 @@ source-repository-package tag: 3f0d2f3abe706958fab8cdc528184068bd0453c9 --sha256: 1xbr5qrz716mh3vhng64m4v6zhp03x5lcf0kld5mmm1yij0fadwa subdir: - -- lib/balance-tx - -- lib/coin-selection - -- lib/delta-store - -- lib/delta-table - -- lib/delta-types - -- lib/launcher - -- lib/numeric - -- lib/primitive - -- lib/test-utils + lib/balance-tx + lib/coin-selection + lib/delta-store + lib/delta-table + lib/delta-types + lib/launcher + lib/numeric + lib/primitive + lib/test-utils lib/text-class - -- lib/wai-middleware-logging + lib/wai-middleware-logging lib/wallet - -- lib/wallet-benchmarks + lib/wallet-benchmarks -- Should follow cardano-wallet. source-repository-package diff --git a/plutus-ledger/plutus-ledger.cabal b/plutus-ledger/plutus-ledger.cabal index 235510c099..7825b91a70 100644 --- a/plutus-ledger/plutus-ledger.cabal +++ b/plutus-ledger/plutus-ledger.cabal @@ -92,11 +92,11 @@ library Prettyprinter.Extras reexported-modules: - Plutus.V1.Ledger.Bytes as Ledger.Bytes, - Plutus.V1.Ledger.Credential as Ledger.Credential, - Plutus.V1.Ledger.DCert as Ledger.DCert, - Plutus.V1.Ledger.Interval as Ledger.Interval, - Plutus.V1.Ledger.Time as Ledger.Time, + PlutusLedgerApi.V1.Bytes as Ledger.Bytes, + PlutusLedgerApi.V1.Credential as Ledger.Credential, + PlutusLedgerApi.V1.DCert as Ledger.DCert, + PlutusLedgerApi.V1.Interval as Ledger.Interval, + PlutusLedgerApi.V1.Time as Ledger.Time, -- The rest of the plutus-ledger-api modules are reexported from within -- the Haskell modules and not in the current cabal file. diff --git a/plutus-pab/plutus-pab.cabal b/plutus-pab/plutus-pab.cabal index 92a117d32a..32d31efabd 100644 --- a/plutus-pab/plutus-pab.cabal +++ b/plutus-pab/plutus-pab.cabal @@ -136,31 +136,31 @@ library -------------------------- build-depends: , cardano-addresses - , cardano-api >=8.0 + , cardano-api >=8.0 , cardano-crypto , cardano-crypto-class , cardano-ledger-alonzo , cardano-ledger-core , cardano-slotting , cardano-wallet - , cardano-wallet-cli - , cardano-wallet-core - , cardano-wallet-core-integration , cardano-wallet-launcher , iohk-monitoring , lobemo-backend-ekg , ouroboros-network , ouroboros-network-framework - , plutus-ledger-api >=1.0.0 - , plutus-tx >=1.0.0 - , plutus-tx-plugin >=1.0.0 + , plutus-ledger-api >=1.0.0 + , plutus-tx >=1.0.0 + , plutus-tx-plugin >=1.0.0 , Win32-network + -- , cardano-wallet-cli + -- , cardano-wallet-core + -- , cardano-wallet-core-integration ------------------------ -- Non-IOG dependencies ------------------------ build-depends: - , aeson <2.0.3.0 + , aeson , aeson-pretty , async , base >=4.7 && <5 From 9f2d628be5f89e010d7a5e8755aebabf34a773db Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Thu, 3 Aug 2023 18:17:52 +0200 Subject: [PATCH 07/24] Fix dependent-sum-template --- cabal.project | 3 ++- flake.lock | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index 0f79b7d247..5ec8739a17 100644 --- a/cabal.project +++ b/cabal.project @@ -13,7 +13,7 @@ repository cardano-haskell-packages -- See CONTRIBUTING.adoc for how to update index-state index-state: - , hackage.haskell.org 2023-07-27T00:00:00Z + , hackage.haskell.org 2023-08-03T00:00:00Z , cardano-haskell-packages 2023-07-27T00:00:00Z packages: cardano-node-emulator @@ -64,6 +64,7 @@ allow-newer: , ouroboros-consensus-byron:* constraints: + dependent-sum-template >= 0.2 -- The plugin will typically fail when producing Haddock documentation. However, -- in this instance you can simply tell it to defer any errors to runtime (which diff --git a/flake.lock b/flake.lock index c5570fea9d..b6cef3e7e3 100644 --- a/flake.lock +++ b/flake.lock @@ -336,11 +336,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1690331094, - "narHash": "sha256-xGJlmbRruW61N0rEcFn2pRlpLnE1TCKvvyz2nytYzE4=", + "lastModified": 1691022320, + "narHash": "sha256-P8/QsT2Jn25R2GzQqBhBv7ghKVybVC0G0st2njicz84=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "efc8a53a648a6a3b0973aaefc93ace7d0ddf198d", + "rev": "c7abe023b3352f1202b3dd09d7e5ce8a9ed09058", "type": "github" }, "original": { From 0d435e436671b61d582fbcedb78e557871de0eb4 Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Mon, 21 Aug 2023 14:34:15 +0200 Subject: [PATCH 08/24] Now really stuck on quickcheck-contractmodel --- cabal.project | 8 ++++++++ cardano-node-emulator/cardano-node-emulator.cabal | 11 ++++++----- .../cardano-node-socket-emulator.cabal | 5 +++-- plutus-contract/plutus-contract.cabal | 12 ++++++------ plutus-example/plutus-example.cabal | 2 +- plutus-ledger/plutus-ledger.cabal | 11 ++++++----- plutus-use-cases/plutus-use-cases.cabal | 9 +++++---- 7 files changed, 35 insertions(+), 23 deletions(-) diff --git a/cabal.project b/cabal.project index 5ec8739a17..593b460da8 100644 --- a/cabal.project +++ b/cabal.project @@ -58,13 +58,21 @@ allow-newer: , persistent:aeson , servant-foreign:lens , blockfrost-api:lens + , plutus-core:dependent-sum-template + , docopt:template-haskell + , *:vector -- temporary , quickcheck-contractmodel:* , cardano-wallet:cardano-api , ouroboros-consensus-byron:* +allow-older: + strict-containers:binary,containers + constraints: dependent-sum-template >= 0.2 + , docopt >= 0.7.0.7 + , strict-containers ^>= 0.2 -- The plugin will typically fail when producing Haddock documentation. However, -- in this instance you can simply tell it to defer any errors to runtime (which diff --git a/cardano-node-emulator/cardano-node-emulator.cabal b/cardano-node-emulator/cardano-node-emulator.cabal index e86effb68a..a0e8b9ff44 100644 --- a/cardano-node-emulator/cardano-node-emulator.cabal +++ b/cardano-node-emulator/cardano-node-emulator.cabal @@ -54,11 +54,12 @@ library build-depends: , cardano-api:{cardano-api, gen} >=8.0 , cardano-crypto + , cardano-ledger-allegra , cardano-ledger-alonzo , cardano-ledger-babbage , cardano-ledger-core + , cardano-ledger-mary , cardano-ledger-shelley - , cardano-ledger-shelley-ma , cardano-slotting , mtl , ouroboros-consensus @@ -71,10 +72,11 @@ library -- Non-IOG dependencies ------------------------ build-depends: - , aeson >=2 + , aeson >=2 , array - , base >=4.9 && <5 + , base >=4.9 && <5 , bytestring + , cardano-strict-containers , containers , data-default , either @@ -82,11 +84,10 @@ library , hedgehog , lens , mtl - , prettyprinter >=1.1.0.1 + , prettyprinter >=1.1.0.1 , QuickCheck , quickcheck-dynamic , serialise - , strict-containers , text , time diff --git a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal index 1d5e343719..e0a867128d 100644 --- a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal +++ b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal @@ -49,12 +49,14 @@ library -------------------------- build-depends: , cardano-api >=8.0 + , cardano-ledger-allegra , cardano-ledger-alonzo , cardano-ledger-byron , cardano-ledger-core + , cardano-ledger-mary , cardano-ledger-shelley - , cardano-ledger-shelley-ma , cardano-slotting + , cardano-strict-containers , cryptonite , exceptions , io-classes @@ -72,7 +74,6 @@ library , plutus-tx >=1.0.0 , quickcheck-contractmodel >=0.1.4.0 , serialise - , strict-containers , text-class , typed-protocols diff --git a/plutus-contract/plutus-contract.cabal b/plutus-contract/plutus-contract.cabal index a11afa403c..00037b1b65 100644 --- a/plutus-contract/plutus-contract.cabal +++ b/plutus-contract/plutus-contract.cabal @@ -146,12 +146,13 @@ library -- Non-IOG dependencies ------------------------ build-depends: - , aeson >=2 + , aeson >=2 , aeson-pretty - , base >=4.7 && <5 + , base >=4.7 && <5 , bytestring + , cardano-strict-containers , containers - , cryptonite >=0.25 + , cryptonite >=0.25 , data-default , directory , filepath @@ -167,16 +168,15 @@ library , mmorph , mtl , pretty - , prettyprinter >=1.1.0.1 + , prettyprinter >=1.1.0.1 , profunctors , QuickCheck - , row-types >=1.0.1.0 + , row-types >=1.0.1.0 , semigroupoids , serialise , servant , stm , streaming - , strict-containers , template-haskell , text , text-class diff --git a/plutus-example/plutus-example.cabal b/plutus-example/plutus-example.cabal index 5474244516..8e8dc0b012 100644 --- a/plutus-example/plutus-example.cabal +++ b/plutus-example/plutus-example.cabal @@ -97,9 +97,9 @@ library build-depends: , aeson , bytestring + , cardano-strict-containers , containers , serialise - , strict-containers , text , transformers , transformers-except diff --git a/plutus-ledger/plutus-ledger.cabal b/plutus-ledger/plutus-ledger.cabal index 7825b91a70..d15ba27207 100644 --- a/plutus-ledger/plutus-ledger.cabal +++ b/plutus-ledger/plutus-ledger.cabal @@ -118,12 +118,13 @@ library , cardano-binary , cardano-crypto , cardano-crypto-class + , cardano-ledger-allegra , cardano-ledger-alonzo , cardano-ledger-babbage , cardano-ledger-byron , cardano-ledger-core + , cardano-ledger-mary , cardano-ledger-shelley - , cardano-ledger-shelley-ma , cardano-slotting , data-default , iohk-monitoring @@ -140,12 +141,13 @@ library -- defined there. build-depends: , aeson - , base >=4.9 && <5 + , base >=4.9 && <5 , base16-bytestring , bytestring + , cardano-strict-containers , cborg , containers - , cryptonite >=0.25 + , cryptonite >=0.25 , flat , hashable , http-api-data @@ -154,11 +156,10 @@ library , mtl , newtype-generics , prettyprinter - , quickcheck-contractmodel >=0.1.4.0 + , quickcheck-contractmodel >=0.1.4.0 , scientific , serialise , servant - , strict-containers , tagged , template-haskell , text diff --git a/plutus-use-cases/plutus-use-cases.cabal b/plutus-use-cases/plutus-use-cases.cabal index 1282698535..e30ae950ee 100644 --- a/plutus-use-cases/plutus-use-cases.cabal +++ b/plutus-use-cases/plutus-use-cases.cabal @@ -199,11 +199,12 @@ test-suite plutus-use-cases-test build-depends: cardano-api >=8.0 , cardano-binary + , cardano-ledger-allegra , cardano-ledger-alonzo , cardano-ledger-babbage , cardano-ledger-core + , cardano-ledger-mary , cardano-ledger-shelley - , cardano-ledger-shelley-ma , cardano-slotting , ouroboros-consensus , ouroboros-consensus-cardano @@ -220,8 +221,9 @@ test-suite plutus-use-cases-test ------------------------ build-depends: aeson - , base >=4.9 && <5 + , base >=4.9 && <5 , bytestring + , cardano-strict-containers , containers , data-default , foldl @@ -233,10 +235,9 @@ test-suite plutus-use-cases-test , prettyprinter , QuickCheck , streaming - , strict-containers , tasty , tasty-golden - , tasty-hedgehog >=0.2.0.0 + , tasty-hedgehog >=0.2.0.0 , tasty-hunit , tasty-quickcheck , text From 869476390f49e4aec4d53ee36722fdf36da1e334 Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Thu, 7 Sep 2023 17:20:45 +0200 Subject: [PATCH 09/24] nix develop working again --- cabal.project | 39 ++++++++++++------- .../cardano-node-socket-emulator.cabal | 2 - flake.lock | 12 +++--- plutus-ledger/plutus-ledger.cabal | 9 ++--- .../plutus-pab-executables.cabal | 3 +- 5 files changed, 37 insertions(+), 28 deletions(-) diff --git a/cabal.project b/cabal.project index 593b460da8..48c6e798bb 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,8 @@ repository cardano-haskell-packages -- See CONTRIBUTING.adoc for how to update index-state index-state: - , hackage.haskell.org 2023-08-03T00:00:00Z - , cardano-haskell-packages 2023-07-27T00:00:00Z + , hackage.haskell.org 2023-08-23T00:00:00Z + , cardano-haskell-packages 2023-08-23T00:00:00Z packages: cardano-node-emulator cardano-node-socket-emulator @@ -62,17 +62,34 @@ allow-newer: , docopt:template-haskell , *:vector -- temporary - , quickcheck-contractmodel:* , cardano-wallet:cardano-api + , cardano-testnet:cardano-api , ouroboros-consensus-byron:* allow-older: strict-containers:binary,containers + , marconi-chain-index:* constraints: dependent-sum-template >= 0.2 , docopt >= 0.7.0.7 - , strict-containers ^>= 0.2 + , strict-containers ^>= 0.2, + plutus-tx >= 1.5.0 && < 1.6, + cardano-api >= 8.2.0 && < 8.3, + cardano-strict-containers >= 0.1.2 && < 0.2, + cardano-slotting >= 0.1.1 && < 0.2, + cardano-ledger-binary >= 1.1.1 && < 1.2, + cardano-ledger-allegra >= 1.1.1 && < 1.2, + cardano-ledger-core >= 1.2.0 && < 1.3, + cardano-ledger-shelley >= 1.2.0 && < 1.3, + cardano-ledger-alonzo >= 1.2.1 && < 1.3, + cardano-ledger-api >= 1.2.0 && < 1.3, + cardano-ledger-babbage >= 1.2.1 && < 1.3, + ouroboros-consensus >= 0.7.0 && < 0.8, + ouroboros-consensus-cardano >= 0.6.0 && < 0.7, + + optparse-applicative-fork < 0.18, + optparse-applicative < 0.18 -- The plugin will typically fail when producing Haddock documentation. However, -- in this instance you can simply tell it to defer any errors to runtime (which @@ -95,8 +112,6 @@ package plutus-contract-model -- For dev work we don't care about performance so much, so this is okay. package cardano-ledger-alonzo optimization: False -package ouroboros-consensus-shelley - optimization: False package ouroboros-consensus-cardano optimization: False package cardano-api @@ -137,16 +152,14 @@ source-repository-package tag: 6b55f96d57a181f898eb2a50531d3ae4280c549c --sha256: 0yygam995i3mawk6hfgxb6v918phvqzyipzhjflff0l6zfrldy7f subdir: - -- cardano-addresses-cli command-line - -- cardano-addresses core source-repository-package type: git - location: https://github.com/input-output-hk/marconi - tag: 7285a3bc1ae53bf672c7cc2359210c6c29fbce44 + location: https://github.com/input-output-hk/quickcheck-contractmodel + tag: 40f645223bc0ec69fa15c8d5c92eea6e76877199 + --sha256: sha256-PrIFKBAXXX/fD3MGqqFCtArzD2xF1wJtCVB62LjZHHI= subdir: - cardano-streaming - marconi-chain-index - marconi-core + quickcheck-contractmodel + quickcheck-threatmodel diff --git a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal index e0a867128d..9efef9c779 100644 --- a/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal +++ b/cardano-node-socket-emulator/cardano-node-socket-emulator.cabal @@ -63,10 +63,8 @@ library , iohk-monitoring , memory , ouroboros-consensus - , ouroboros-consensus-byron , ouroboros-consensus-cardano , ouroboros-consensus-protocol - , ouroboros-consensus-shelley , ouroboros-network , ouroboros-network-framework , plutus-core >=1.0.0 diff --git a/flake.lock b/flake.lock index b6cef3e7e3..084c968270 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1690341504, - "narHash": "sha256-RWMP2yOu1/k6hUpQqn1PZ/n1e07lkiZjIGK6ZK+EAns=", + "lastModified": 1693988844, + "narHash": "sha256-0fvQy6GxgSkpufa0QeEtYNEY4G5nSQ7L4VIkGdfTt+w=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "21f05b352252442b483677211ad401e9458e802e", + "rev": "27f047c00b5d079e6322a3eab53549cad9e77680", "type": "github" }, "original": { @@ -336,11 +336,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1691022320, - "narHash": "sha256-P8/QsT2Jn25R2GzQqBhBv7ghKVybVC0G0st2njicz84=", + "lastModified": 1693959895, + "narHash": "sha256-qLmbEucG4NTA507cQzhsqnE3nJqUSVAALQX6MgzDwGo=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "c7abe023b3352f1202b3dd09d7e5ce8a9ed09058", + "rev": "d0d990c3a8daba50aee6ee31794cb87226f4e18f", "type": "github" }, "original": { diff --git a/plutus-ledger/plutus-ledger.cabal b/plutus-ledger/plutus-ledger.cabal index d15ba27207..43ae9f912d 100644 --- a/plutus-ledger/plutus-ledger.cabal +++ b/plutus-ledger/plutus-ledger.cabal @@ -114,7 +114,7 @@ library -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=8.0 + , cardano-api >=8.0 , cardano-binary , cardano-crypto , cardano-crypto-class @@ -128,10 +128,9 @@ library , cardano-slotting , data-default , iohk-monitoring - , ouroboros-consensus-shelley - , plutus-core >=1.0.0 - , plutus-ledger-api >=1.0.0 - , plutus-tx >=1.0.0 + , plutus-core >=1.0.0 + , plutus-ledger-api >=1.0.0 + , plutus-tx >=1.0.0 ------------------------ -- Non-IOG dependencies diff --git a/plutus-pab-executables/plutus-pab-executables.cabal b/plutus-pab-executables/plutus-pab-executables.cabal index ba8df233e9..7838e4d7ad 100644 --- a/plutus-pab-executables/plutus-pab-executables.cabal +++ b/plutus-pab-executables/plutus-pab-executables.cabal @@ -449,9 +449,8 @@ executable pab-cli -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=8.0 + , cardano-api >=8.0 , cardano-ledger-shelley - , ouroboros-consensus-shelley ------------------------ -- Non-IOG dependencies From 1839415d22ae10d80c300a64d5542102077f69bf Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Fri, 8 Sep 2023 15:18:34 +0200 Subject: [PATCH 10/24] Remove marconi depedency --- cabal.project | 9 - .../plutus-chain-index-core.cabal | 16 +- .../src/Plutus/ChainIndex/Marconi.hs | 212 --------------- .../test/Plutus/ChainIndex/MarconiSpec.hs | 113 -------- plutus-chain-index-core/test/Spec.hs | 3 - plutus-pab/plutus-pab.cabal | 3 +- plutus-pab/src/Marconi/Core/Index/VSplit.hs | 245 ++++++++++++++++++ plutus-pab/src/Marconi/Core/Index/VSqlite.hs | 69 +++++ 8 files changed, 321 insertions(+), 349 deletions(-) delete mode 100644 plutus-chain-index-core/src/Plutus/ChainIndex/Marconi.hs delete mode 100644 plutus-chain-index-core/test/Plutus/ChainIndex/MarconiSpec.hs create mode 100644 plutus-pab/src/Marconi/Core/Index/VSplit.hs create mode 100644 plutus-pab/src/Marconi/Core/Index/VSqlite.hs diff --git a/cabal.project b/cabal.project index 48c6e798bb..086b9f8520 100644 --- a/cabal.project +++ b/cabal.project @@ -154,12 +154,3 @@ source-repository-package subdir: command-line core - -source-repository-package - type: git - location: https://github.com/input-output-hk/quickcheck-contractmodel - tag: 40f645223bc0ec69fa15c8d5c92eea6e76877199 - --sha256: sha256-PrIFKBAXXX/fD3MGqqFCtArzD2xF1wJtCVB62LjZHHI= - subdir: - quickcheck-contractmodel - quickcheck-threatmodel diff --git a/plutus-chain-index-core/plutus-chain-index-core.cabal b/plutus-chain-index-core/plutus-chain-index-core.cabal index 7806399a46..23b4347c82 100644 --- a/plutus-chain-index-core/plutus-chain-index-core.cabal +++ b/plutus-chain-index-core/plutus-chain-index-core.cabal @@ -55,7 +55,6 @@ library Plutus.ChainIndex.Emulator.Handlers Plutus.ChainIndex.Emulator.Server Plutus.ChainIndex.Handlers - Plutus.ChainIndex.Marconi Plutus.ChainIndex.Server Plutus.ChainIndex.Tx Plutus.ChainIndex.TxIdState @@ -74,8 +73,6 @@ library , cardano-node-emulator >=1.2.0 , cardano-node-socket-emulator >=1.2.0 , freer-extras >=1.2.0 - , marconi-chain-index >=1.2.0 - , marconi-core >=1.2.0 , plutus-ledger >=1.2.0 , plutus-script-utils >=1.2.0 @@ -142,20 +139,17 @@ test-suite plutus-chain-index-test Plutus.ChainIndex.Emulator.DiskStateSpec Plutus.ChainIndex.Emulator.HandlersSpec Plutus.ChainIndex.HandlersSpec - Plutus.ChainIndex.MarconiSpec Util -------------------- -- Local components -------------------- build-depends: - , cardano-node-emulator >=1.2.0 - , freer-extras >=1.2.0 - , marconi-chain-index:{marconi-chain-index, marconi-chain-index-test-lib} >=1.2.0 - , marconi-core >=1.2.0 - , plutus-chain-index-core >=1.2.0 - , plutus-ledger >=1.2.0 - , plutus-script-utils >=1.2.0 + , cardano-node-emulator >=1.2.0 + , freer-extras >=1.2.0 + , plutus-chain-index-core >=1.2.0 + , plutus-ledger >=1.2.0 + , plutus-script-utils >=1.2.0 -------------------------- -- Other IOG dependencies diff --git a/plutus-chain-index-core/src/Plutus/ChainIndex/Marconi.hs b/plutus-chain-index-core/src/Plutus/ChainIndex/Marconi.hs deleted file mode 100644 index 08e4b8bc9a..0000000000 --- a/plutus-chain-index-core/src/Plutus/ChainIndex/Marconi.hs +++ /dev/null @@ -1,212 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE TypeOperators #-} - -module Plutus.ChainIndex.Marconi where - -import Cardano.Api (AddressInEra (AddressInEra), AddressTypeInEra (..), TxIx (TxIx), toAddressAny) -import Cardano.Api qualified as C -import Cardano.BM.Trace (Trace) -import Control.Concurrent (MVar, newMVar, putMVar, takeMVar) -import Control.Lens (Lens', _1, folded, makeLenses, views, (&), (.~), (^.), (^..)) -import Control.Monad.Freer (Eff, LastMember, Member, interpret, type (~>)) -import Control.Monad.Freer.Error (Error, runError, throwError) -import Control.Monad.Freer.Extras -import Control.Monad.Freer.Extras.Pagination (PageQuery, pageOf) -import Control.Monad.Freer.Reader (Reader, ask, runReader) -import Control.Monad.Freer.State qualified as Eff (State, get, put, runState) -import Control.Monad.Freer.TH (makeEffect) -import Control.Monad.IO.Class (MonadIO (liftIO)) -import Data.Foldable (foldl') -import Data.Map (elems) -import Data.Set qualified as Set -import Ledger.Address (CardanoAddress) -import Ledger.Tx (CardanoTx (CardanoTx)) -import Marconi.ChainIndex.Indexers.Utxo (StorableEvent (UtxoEvent), StorableQuery (UtxoByAddress), UtxoHandle, - getInputs, getUtxoResult, getUtxosFromTxBody, txId, txIx, urUtxo) -import Marconi.Core.Storable (HasPoint, QueryInterval (QEverything), Queryable, State, StorableMonad, StorablePoint, - StorableResult, insertMany, query) -import Plutus.ChainIndex.Api (UtxosResponse (UtxosResponse)) -import Plutus.ChainIndex.ChainIndexError (ChainIndexError (..)) -import Plutus.ChainIndex.ChainIndexLog (ChainIndexLog) -import Plutus.ChainIndex.Compatibility (toCardanoPoint) -import Plutus.ChainIndex.Effects (ChainIndexControlEffect (AppendBlocks), ChainIndexQueryEffect (UtxoSetAtAddress)) -import Plutus.ChainIndex.Types (ChainSyncBlock (..), Tip (TipAtGenesis), citxCardanoTx, tipAsPoint) -import Plutus.Contract.CardanoAPI (fromCardanoTxId) -import Plutus.Monitoring.Util (PrettyObject (PrettyObject), convertLog, runLogEffects) -import Plutus.V2.Ledger.Api (TxOutRef (TxOutRef)) - -{- Handling ChainIndexEffects with Marconi - Developer notes: - - The general idea is to transform `ChainIndexQueryEffect` into a @MarconiEffect@ for an handler, - and to resolve these effects afterwards with a bunch of calls to `handleMarconiQuery`. - - The main reason for this is that we mutualise the code that queries the handlers (see @handleMarconiQuery@) and we have a - uniform way to query the different indexers. - - And a minor one: - - * There's no need of different handlers for @MarconiEffect@ at this stage but we leave the door open to it. - A possible use case might be to provide a simpler indexer backend for the emulator. - - How to add new indexer to support new effect? - - 1. add the indexer MVar to `ChainIndexIndexersMvar` and the corresponding indexer to `ChainIndexIndexers` - 2. edit `getChainIndexIndexers` and `putChainIndexIndexers` accordingly - 3. handle the appropriate queries of `ChainIndexQueries` in `handleQuery` - 4. Add the indexer update in the control operations --} - -data ChainIndexIndexers -- We don't use `newtype` since other indexers will be needed - = ChainIndexIndexers - { _utxosIndexer :: State UtxoHandle - } - -makeLenses ''ChainIndexIndexers - -data ChainIndexIndexersMVar -- We don't use `newtype` since other indexers will be needed - = ChainIndexIndexersMVar - { _utxosIndexerMVar :: MVar (State UtxoHandle) - } - -boxChainIndexIndexers :: ChainIndexIndexers -> IO ChainIndexIndexersMVar -boxChainIndexIndexers ci = - ChainIndexIndexersMVar <$> - (newMVar $ ci ^. utxosIndexer) - -makeLenses ''ChainIndexIndexersMVar - -getChainIndexIndexers :: ChainIndexIndexersMVar -> IO ChainIndexIndexers -getChainIndexIndexers mvarCi = - ChainIndexIndexers <$> takeMVar (mvarCi ^. utxosIndexerMVar) - -putChainIndexIndexers :: ChainIndexIndexers -> ChainIndexIndexersMVar -> IO () -putChainIndexIndexers ci mvarCi = do - putMVar (mvarCi ^. utxosIndexerMVar) (ci ^. utxosIndexer) - - - -data MarconiEffect handle r where - QueryIndexer :: StorableQuery handle -> MarconiEffect handle (StorableResult handle) - -makeEffect ''MarconiEffect - -handleMarconiQuery :: - ( LastMember IO effs - , Member (Eff.State ChainIndexIndexers) effs - , StorableMonad handle ~ IO - , HasPoint (StorableEvent handle) (StorablePoint handle) - , Ord (StorablePoint handle) - , Queryable handle - ) - => Lens' ChainIndexIndexers (State handle) -> MarconiEffect handle ~> Eff effs -handleMarconiQuery l (QueryIndexer q) = do - ci <- Eff.get - liftIO $ query QEverything (ci ^. l) q - -getUtxoSetAtAddress - :: forall effs. - ( Member (MarconiEffect UtxoHandle) effs - ) - => PageQuery TxOutRef - -> CardanoAddress - -> Eff effs UtxosResponse -getUtxoSetAtAddress pageQuery addrInEra = let - toTxOutRef utxo = TxOutRef - (fromCardanoTxId $ utxo ^. txId) - (toInteger . (\(TxIx x) -> x) $ utxo ^. txIx) - addr = case addrInEra of - AddressInEra ByronAddressInAnyEra addr' -> toAddressAny addr' - AddressInEra (ShelleyAddressInEra _) addr' -> toAddressAny addr' - in UtxosResponse TipAtGenesis - . pageOf pageQuery - . Set.fromList - . fmap (views urUtxo toTxOutRef) - . getUtxoResult - <$> queryIndexer (UtxoByAddress addr Nothing) - - -getUtxoEvents - :: [CardanoTx] - -> C.ChainPoint - -> StorableEvent UtxoHandle -- ^ UtxoEvents are stored in storage after conversion to UtxoRow -getUtxoEvents txs cp = - let utxosFromCardanoTx (CardanoTx (C.Tx txBody _) _) = elems $ getUtxosFromTxBody Nothing txBody - inputsFromCardanoTx (CardanoTx (C.Tx txBody _) _) = getInputs txBody - utxos = Set.fromList $ concatMap utxosFromCardanoTx txs - ins = foldl' Set.union Set.empty $ inputsFromCardanoTx <$> txs - in UtxoEvent utxos ins cp - --- | The required arguments to run the chain index effects. -data RunRequirements = RunRequirements - { trace :: !(Trace IO (PrettyObject ChainIndexLog)) - , indexers :: !ChainIndexIndexersMVar - } - - --- | Run the chain index effects. -runChainIndexEffects - :: RunRequirements - -> Eff '[ChainIndexQueryEffect, ChainIndexControlEffect] a - -> IO (Either ChainIndexError a) -runChainIndexEffects runReq action = - runLogEffects (convertLog PrettyObject $ trace runReq) - $ runReader (indexers runReq) - $ handleChainIndexEffects - $ raiseEnd action - -handleControl :: - ( LastMember IO effs - , Member (Eff.State ChainIndexIndexers) effs - , Member (Error ChainIndexError) effs - ) => - ChainIndexControlEffect ~> Eff effs -handleControl = \case - AppendBlocks xs -> do - ci <- Eff.get - utxosIndexer' <- liftIO $ insertMany (extractUtxosEvent <$> xs) (ci ^. utxosIndexer) - Eff.put (ci & utxosIndexer .~ utxosIndexer') - _other -> throwError UnsupportedControlOperation - where - extractUtxosEvent Block{blockTip,blockTxs} = let - point = toCardanoPoint $ tipAsPoint blockTip - in getUtxoEvents - (blockTxs ^.. folded . _1 . citxCardanoTx . folded) - point - -handleQuery :: - ( LastMember IO effs - , Member (Eff.State ChainIndexIndexers) effs - , Member (Error ChainIndexError) effs - ) => ChainIndexQueryEffect - ~> Eff effs -handleQuery = \case - UtxoSetAtAddress pageQuery addr -> - interpret (handleMarconiQuery utxosIndexer) $ getUtxoSetAtAddress pageQuery addr - _eff -> throwError UnsupportedQuery - --- | Handle the chain index effects from the set of all effects. -handleChainIndexEffects :: - ( LastMember IO effs - , Member (Reader ChainIndexIndexersMVar) effs - ) - => Eff (ChainIndexQueryEffect ': ChainIndexControlEffect ': effs) a - -> Eff effs (Either ChainIndexError a) -handleChainIndexEffects action = do - mIndexers <- ask - indexers <- liftIO $ getChainIndexIndexers mIndexers - (result, indexers') <- Eff.runState indexers - $ runError @ChainIndexError - $ interpret handleControl - $ interpret handleQuery - $ raiseMUnderN @[_,_] @[_,_] action - liftIO $ putChainIndexIndexers indexers' mIndexers - pure result diff --git a/plutus-chain-index-core/test/Plutus/ChainIndex/MarconiSpec.hs b/plutus-chain-index-core/test/Plutus/ChainIndex/MarconiSpec.hs deleted file mode 100644 index 1a7ac95ee3..0000000000 --- a/plutus-chain-index-core/test/Plutus/ChainIndex/MarconiSpec.hs +++ /dev/null @@ -1,113 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE TupleSections #-} -module Plutus.ChainIndex.MarconiSpec (tests) where - -import Control.Monad.IO.Class (MonadIO, liftIO) - -import Hedgehog.Internal.Property (Property, forAll, property) -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.Hedgehog (testPropertyNamed) - -import Cardano.Api qualified as C -import Control.Concurrent (readMVar) -import Control.Lens (_1, folded, to, toListOf, (^.), (^..), (^?)) -import Control.Monad (void) -import Control.Tracer (nullTracer) -import Data.Default (def) -import Gen.Marconi.ChainIndex.Mockchain (MockBlock (MockBlock), genMockchain) -import Hedgehog (Gen) -import Hedgehog qualified -import Ledger.Tx (TxOutRef) -import Marconi.ChainIndex.Indexers.Utxo (StorableEvent (..), UtxoHandle) -import Marconi.ChainIndex.Indexers.Utxo qualified as Utxo -import Marconi.Core.Storable qualified as Storable -import Plutus.ChainIndex (ChainIndexTxOut, ChainSyncBlock (Block), appendBlocks, citoAddress, citxInputs, citxOutputs, - utxoSetAtAddress) -import Plutus.ChainIndex.Compatibility (tipFromCardanoBlockHeader) -import Plutus.ChainIndex.Marconi (ChainIndexIndexers (ChainIndexIndexers), ChainIndexIndexersMVar, - RunRequirements (RunRequirements), boxChainIndexIndexers, runChainIndexEffects, - utxosIndexerMVar) -import Plutus.ChainIndex.Types (ChainSyncBlock (blockTxs), chainIndexTxOutputs) -import Plutus.Contract.CardanoAPI (fromCardanoTx) - -tests :: TestTree -tests = testGroup "Plutus.ChainIndex.MarconiSpec" - [ testGroup "testSetAtAddress" - [ testPropertyNamed "Indexer do store blocks txOuts" "checkTxOutStorage" - checkTxOutStorage - , testPropertyNamed "Indexer do store blocks txIn" "checkTxInStorage" - checkTxInStorage - ] - ] - -genBlocks :: Gen [ChainSyncBlock] -genBlocks = fmap fromMockBlock <$> genMockchain - where - fromMockBlock :: MockBlock C.BabbageEra -> ChainSyncBlock - fromMockBlock (MockBlock header txs) = - Block - (tipFromCardanoBlockHeader header) - ((,def) . fromCardanoTx C.BabbageEraInCardanoMode <$> txs) - -newChainIndexIndexers :: IO ChainIndexIndexersMVar -newChainIndexIndexers = do - indexers <- ChainIndexIndexers - <$> Utxo.open ":memory:" (Utxo.Depth 10) False -- do not perfrom SQLite vacuum, see: https://www.sqlite.org/lang_vacuum.html - boxChainIndexIndexers indexers - -getUtxoEvents :: MonadIO m => ChainIndexIndexersMVar -> m [StorableEvent UtxoHandle] -getUtxoEvents indexers = - liftIO $ readMVar (indexers ^. utxosIndexerMVar) >>= Storable.getEvents - -allTxOuts :: ChainSyncBlock -> [ChainIndexTxOut] -allTxOuts = - toListOf (to blockTxs . folded . _1 . citxOutputs . chainIndexTxOutputs) - -allTxIns :: ChainSyncBlock -> [TxOutRef] -allTxIns = - toListOf (to blockTxs . folded . _1 . citxInputs . folded) - - -checkTxOutStorage :: Property -checkTxOutStorage = property $ do - blocks <- forAll genBlocks - indexers <- liftIO newChainIndexIndexers - let txOutAddr = blocks ^? folded . to blockTxs . folded . _1 - . citxOutputs . chainIndexTxOutputs . to citoAddress - maybe - Hedgehog.success - (\addr -> do - void $ liftIO $ runChainIndexEffects (RunRequirements nullTracer indexers) $ do - appendBlocks blocks - utxoSetAtAddress def addr - events <- getUtxoEvents indexers - let originalTxOuts = blocks >>= allTxOuts - Hedgehog.annotateShow events - Hedgehog.annotateShow originalTxOuts - let eventUtxos = events ^.. folded . to ueUtxos . folded - length eventUtxos Hedgehog.=== length originalTxOuts - ) - txOutAddr - -checkTxInStorage :: Property -checkTxInStorage = property $ do - blocks <- forAll genBlocks - indexers <- liftIO newChainIndexIndexers - let txOutAddr = blocks ^? folded . to blockTxs . folded . _1 - . citxOutputs . chainIndexTxOutputs . to citoAddress - maybe - Hedgehog.success - (\addr -> do - void $ liftIO $ runChainIndexEffects (RunRequirements nullTracer indexers) $ do - appendBlocks blocks - utxoSetAtAddress def addr - events <- getUtxoEvents indexers - let originalTxIns = blocks >>= allTxIns - Hedgehog.annotateShow events - Hedgehog.annotateShow originalTxIns - let eventTxIns = events ^.. folded . to ueInputs . folded - length eventTxIns Hedgehog.=== length originalTxIns - ) - txOutAddr - diff --git a/plutus-chain-index-core/test/Spec.hs b/plutus-chain-index-core/test/Spec.hs index 81073b0a19..2dc9f3931a 100644 --- a/plutus-chain-index-core/test/Spec.hs +++ b/plutus-chain-index-core/test/Spec.hs @@ -39,8 +39,6 @@ import Plutus.ChainIndex.UtxoState qualified as UtxoState import Test.Tasty import Test.Tasty.Hedgehog (testPropertyNamed) -import Plutus.ChainIndex.MarconiSpec qualified as Marconi - main :: IO () main = defaultMain tests @@ -50,7 +48,6 @@ tests = [ testGroup "tx out balance" txOutBalanceTests , testGroup "utxo balance" utxoBalanceTests , testGroup "txidstate" txIdStateTests - , Marconi.tests , testPropertyNamed "lift tx output status to tx status" "txOutStatusTxStatusProp" txOutStatusTxStatusProp , testPropertyNamed "tx output status" "txOutStatusSpentUnspentProp" txOutStatusSpentUnspentProp , DiskStateSpec.tests diff --git a/plutus-pab/plutus-pab.cabal b/plutus-pab/plutus-pab.cabal index 32d31efabd..21956a8cf6 100644 --- a/plutus-pab/plutus-pab.cabal +++ b/plutus-pab/plutus-pab.cabal @@ -74,6 +74,8 @@ library Control.Concurrent.Availability Control.Concurrent.STM.Extras Control.Concurrent.STM.Extras.Stream + Marconi.Core.Index.VSplit + Marconi.Core.Index.VSqlite Plutus.PAB.App Plutus.PAB.Arbitrary Plutus.PAB.Core @@ -122,7 +124,6 @@ library , cardano-node-emulator >=1.2.0 , cardano-node-socket-emulator >=1.2.0 , freer-extras >=1.2.0 - , marconi-core >=1.2.0 , pab-blockfrost >=1.2.0 , plutus-chain-index >=1.2.0 , plutus-chain-index-core >=1.2.0 diff --git a/plutus-pab/src/Marconi/Core/Index/VSplit.hs b/plutus-pab/src/Marconi/Core/Index/VSplit.hs new file mode 100644 index 0000000000..8aaf758044 --- /dev/null +++ b/plutus-pab/src/Marconi/Core/Index/VSplit.hs @@ -0,0 +1,245 @@ +module Marconi.Core.Index.VSplit + ( SplitIndex(..) + , new + , newBoxed + , newUnboxed + , insert + , insertL + , size + , rewind + -- * Accessors + , handle + , storage + , notifications + , store + , query + , onInsert + -- * Storage + , Storage(..) + , getBuffer + , getEvents + , k + ) where + +import Control.Lens ((%~), (&), (.~), (^.)) +import Control.Lens.TH qualified as Lens +import Control.Monad.Primitive (PrimMonad, PrimState) +import Data.Foldable (foldlM) +import Data.Vector qualified as V +import Data.Vector.Generic qualified as VG +import Data.Vector.Generic.Mutable qualified as VGM +import Data.Vector.Unboxed qualified as VU + +data Storage v m e = Storage + { _events :: (VG.Mutable v) (PrimState m) e + , _cursor :: Int + , _eSize :: Int + , _bSize :: Int + , _k :: Int + } +$(Lens.makeLenses ''Storage) + +maxSize + :: VGM.MVector (VG.Mutable v) e + => Storage v m e + -> Int +maxSize store = store ^. events & VGM.length + +isStorageFull + :: VGM.MVector (VG.Mutable v) e + => Storage v m e + -> Bool +isStorageFull store = maxSize store == store ^. eSize + store ^. bSize + +getBuffer + :: forall v m e. + VGM.MVector (VG.Mutable v) e + => PrimMonad m + => Show e + => Storage v m e + -> m [e] +getBuffer store = + let bufferEnd = store ^. cursor - store ^. eSize + bufferStart = bufferEnd - store ^. bSize + in reverse <$> getInterval bufferStart (store ^. bSize) store + +getEvents + :: forall v m e. + VGM.MVector (VG.Mutable v) e + => PrimMonad m + => Show e + => Storage v m e + -> m [e] +getEvents store = + let c = store ^. cursor + esz = store ^. eSize + in reverse <$> getInterval (c - esz) esz store + +getInterval + :: forall v m e. + VGM.MVector (VG.Mutable v) e + => PrimMonad m + => Show e + => Int + -> Int + -> Storage v m e + -> m [e] +getInterval start size' store + | size' == 0 = pure [] + -- k underflows to the begining + | start < 0 = do + getInterval (maxSize store + start) size' store + -- buffer overflows to the start + | start + size' > maxSize store = + let endSize = (start + size') `rem` maxSize store + startSize = size' - endSize + in (++) <$> getInterval start startSize store + <*> getInterval 0 endSize store + -- normal case + | otherwise = do + VGM.foldr' (:) [] $ VGM.slice start size' (store ^. events) + +data SplitIndex m h v e n q r = SplitIndex + { _handle :: h + , _storage :: Storage v m e + , _notifications :: [n] + , _store :: SplitIndex m h v e n q r -> m () + , _query :: SplitIndex m h v e n q r -> q -> [e] -> m r + , _onInsert :: SplitIndex m h v e n q r -> e -> m [n] + } +$(Lens.makeLenses ''SplitIndex) + +new + :: Monad m + => VGM.MVector (VG.Mutable v) e + => (SplitIndex m h v e n q r -> q -> [e] -> m r) + -> (SplitIndex m h v e n q r -> m ()) + -> (SplitIndex m h v e n q r -> e -> m [n]) + -> Int + -> h + -> (VG.Mutable v) (PrimState m) e + -> m (Maybe (SplitIndex m h v e n q r)) +new query' store' onInsert' k' handle' vector + | k' < 0 = pure Nothing + -- The vector has to accomodate at least k + 1 elements. + | k' >= VGM.length vector = pure Nothing + | otherwise = pure . Just $ SplitIndex + { _handle = handle' + , _storage = Storage { _events = vector + , _cursor = 0 + , _eSize = 0 + , _bSize = 0 + , _k = k' + } + , _notifications = [] + , _store = store' + , _query = query' + , _onInsert = onInsert' + } + +type BoxedIndex m h e n q r = + SplitIndex m h V.Vector e n q r + +newBoxed + :: Monad m + => PrimMonad m + => (BoxedIndex m h e n q r -> q -> [e] -> m r) + -> (BoxedIndex m h e n q r -> m ()) + -> (BoxedIndex m h e n q r -> e -> m [n]) + -> Int + -> Int + -> h + -> m (Maybe (BoxedIndex m h e n q r)) +newBoxed query' store' onInsert' k' size' handle' + | k' < 0 || size' <= 0 = pure Nothing + | otherwise = do + v <- VGM.new (k' + size') + new query' store' onInsert' k' handle' v + +type UnboxedIndex m h e n q r = + SplitIndex m h VU.Vector e n q r + +newUnboxed + :: Monad m + => PrimMonad m + => VGM.MVector VU.MVector e + => (UnboxedIndex m h e n q r -> q -> [e] -> m r) + -> (UnboxedIndex m h e n q r -> m ()) + -> (UnboxedIndex m h e n q r -> e -> m [n]) + -> Int + -> Int + -> h + -> m (Maybe (UnboxedIndex m h e n q r)) +newUnboxed query' store' onInsert' k' size' handle' + | k' < 0 || size' <= 0 = pure Nothing + | otherwise = do + v <- VGM.new (k' + size') + new query' store' onInsert' k' handle' v + +insert + :: forall m h v e n q r. + Monad m + => PrimMonad m + => VGM.MVector (VG.Mutable v) e + => e + -> SplitIndex m h v e n q r + -> m (SplitIndex m h v e n q r) +insert e ix = do + let es = ix ^. storage . events + c = ix ^. storage . cursor + vs = VGM.length es + VGM.unsafeWrite es c e + ns <- (ix ^. onInsert) ix e + let ix' = storage %~ updateSizes $ + (storage . cursor) %~ (\c' -> (c' + 1) `rem` vs) $ + notifications %~ (ns++) $ ix + if isStorageFull (ix' ^. storage) + then storeEvents ix' + else pure ix' + + where + updateSizes :: Storage v m e -> Storage v m e + updateSizes st = + -- Event sizes increase by one upto K + eSize %~ (\sz -> min (sz + 1) (st ^. k)) $ + -- The buffer only grows when the event buffer is full + bSize %~ (\sz -> if st ^. eSize == st ^. k then sz + 1 else sz) $ st + +storeEvents + :: Monad m + => SplitIndex m h v e n q r + -> m (SplitIndex m h v e n q r) +storeEvents ix = do + -- TODO: Change store to store :: h -> [e] -> m () (?) + ix & ix ^. store + pure $ + (storage . bSize) .~ 0 $ ix + +insertL + :: PrimMonad m + => VGM.MVector (VG.Mutable v) e + => [e] + -> SplitIndex m h v e n q r + -> m (SplitIndex m h v e n q r) +insertL es ix = foldlM (flip insert) ix es + +size + :: SplitIndex m h v e n q r + -> Int +size ix = 1 + (ix ^. storage . eSize) + +rewind + :: VGM.MVector (VG.Mutable v) e + => Int + -> SplitIndex m h v e n q r + -> Maybe (SplitIndex m h v e n q r) +rewind n ix + | ix ^. storage . eSize >= n = Just $ + (storage . cursor) %~ (\c -> adjust (c - n)) $ + (storage . eSize ) %~ (\sz -> sz - n) $ ix + | otherwise = Nothing + where + adjust :: Int -> Int + adjust p + | p < 0 = maxSize (ix ^. storage) + p + | otherwise = p diff --git a/plutus-pab/src/Marconi/Core/Index/VSqlite.hs b/plutus-pab/src/Marconi/Core/Index/VSqlite.hs new file mode 100644 index 0000000000..d675ba9f8d --- /dev/null +++ b/plutus-pab/src/Marconi/Core/Index/VSqlite.hs @@ -0,0 +1,69 @@ +module Marconi.Core.Index.VSqlite + ( -- * API + SqliteIndex + , new + , newBoxed + , S.insert + , S.insertL + , S.size + , S.rewind + , S.getEvents + , S.getBuffer + , S.handle + , S.storage + ) where + +import Control.Monad.Primitive (PrimState) +import Data.Vector qualified as V +import Data.Vector.Generic qualified as VG +import Data.Vector.Generic.Mutable qualified as VGM +import Database.SQLite.Simple (Connection, execute_, open) + +import Marconi.Core.Index.VSplit (SplitIndex (SplitIndex), Storage (Storage)) +import Marconi.Core.Index.VSplit qualified as S + +type SqliteIndex e n q r = SplitIndex IO Connection V.Vector e n q r + +new + :: (SqliteIndex e n q r -> q -> [e] -> IO r) + -> (SqliteIndex e n q r -> IO ()) + -> (SqliteIndex e n q r -> e -> IO [n]) + -> Int + -> FilePath + -> (VG.Mutable V.Vector) (PrimState IO) e + -> IO (Maybe (SqliteIndex e n q r)) +new fquery fstore foninsert k' db vector + | k' < 0 = pure Nothing + | otherwise = do + connection <- open db + execute_ connection "PRAGMA journal_mode=WAL" + + pure . Just $ SplitIndex + { S._handle = connection + , S._storage = Storage { S._events = vector + , S._cursor = 0 + , S._eSize = 0 + , S._bSize = 0 + , S._k = k' + } + , S._notifications = [] + , S._store = fstore + , S._query = fquery + , S._onInsert = foninsert + } + +type BoxedIndex e n q r = SqliteIndex e n q r + +newBoxed + :: (BoxedIndex e n q r -> q -> [e] -> IO r) + -> (BoxedIndex e n q r -> IO ()) + -> (BoxedIndex e n q r -> e -> IO [n]) + -> Int + -> Int + -> FilePath + -> IO (Maybe (BoxedIndex e n q r)) +newBoxed query' store' onInsert' k' size' dbPath + | k' < 0 || size' <= 0 = pure Nothing + | otherwise = do + v <- VGM.new (k' + size') + new query' store' onInsert' k' dbPath v From c0b6abc752591e445819e8ec47e0bd13109aa735 Mon Sep 17 00:00:00 2001 From: Sjoerd Visscher Date: Fri, 8 Sep 2023 15:22:19 +0200 Subject: [PATCH 11/24] Fix plutus-script-utils --- plutus-script-utils/plutus-script-utils.cabal | 3 +- .../src/Plutus/Script/Utils/Ada.hs | 4 +- .../src/Plutus/Script/Utils/Scripts.hs | 194 ++++++++++++++---- .../src/Plutus/Script/Utils/Typed.hs | 31 ++- .../src/Plutus/Script/Utils/V1/Address.hs | 6 +- .../src/Plutus/Script/Utils/V1/Contexts.hs | 4 +- .../src/Plutus/Script/Utils/V1/Generators.hs | 5 +- .../src/Plutus/Script/Utils/V1/Scripts.hs | 24 +-- .../src/Plutus/Script/Utils/V1/Tx.hs | 4 +- .../Plutus/Script/Utils/V1/Typed/Scripts.hs | 7 +- .../V1/Typed/Scripts/MonetaryPolicies.hs | 20 +- .../Utils/V1/Typed/Scripts/StakeValidators.hs | 20 +- .../Utils/V1/Typed/Scripts/Validators.hs | 11 +- .../src/Plutus/Script/Utils/V2/Address.hs | 6 +- .../src/Plutus/Script/Utils/V2/Contexts.hs | 6 +- .../src/Plutus/Script/Utils/V2/Generators.hs | 12 +- .../src/Plutus/Script/Utils/V2/Scripts.hs | 3 +- .../src/Plutus/Script/Utils/V2/Tx.hs | 5 +- .../Plutus/Script/Utils/V2/Typed/Scripts.hs | 8 +- .../V2/Typed/Scripts/MonetaryPolicies.hs | 20 +- .../Utils/V2/Typed/Scripts/StakeValidators.hs | 20 +- .../Utils/V2/Typed/Scripts/Validators.hs | 10 +- .../src/Plutus/Script/Utils/Value.hs | 25 ++- .../src/Prettyprinter/Extras.hs | 36 ++++ 24 files changed, 315 insertions(+), 169 deletions(-) create mode 100644 plutus-script-utils/src/Prettyprinter/Extras.hs diff --git a/plutus-script-utils/plutus-script-utils.cabal b/plutus-script-utils/plutus-script-utils.cabal index e303e47634..7f95525231 100644 --- a/plutus-script-utils/plutus-script-utils.cabal +++ b/plutus-script-utils/plutus-script-utils.cabal @@ -79,12 +79,13 @@ library Plutus.Script.Utils.V2.Typed.Scripts.StakeValidators Plutus.Script.Utils.V2.Typed.Scripts.Validators Plutus.Script.Utils.Value + Prettyprinter.Extras -------------------------- -- Other IOG dependencies -------------------------- build-depends: - , cardano-api >=8.0 + , cardano-api ^>=8.2 , cardano-ledger-alonzo , plutus-core >=1.0.0 , plutus-ledger-api >=1.0.0 diff --git a/plutus-script-utils/src/Plutus/Script/Utils/Ada.hs b/plutus-script-utils/src/Plutus/Script/Utils/Ada.hs index 7066767f5d..622eb7a803 100644 --- a/plutus-script-utils/src/Plutus/Script/Utils/Ada.hs +++ b/plutus-script-utils/src/Plutus/Script/Utils/Ada.hs @@ -34,8 +34,8 @@ import Codec.Serialise.Class (Serialise) import Data.Aeson (FromJSON, ToJSON) import Data.Tagged (Tagged (Tagged)) import GHC.Generics (Generic) -import Plutus.V1.Ledger.Value (CurrencySymbol (CurrencySymbol), TokenName (TokenName), Value) -import Plutus.V1.Ledger.Value qualified as TH +import PlutusLedgerApi.V1.Value (CurrencySymbol (CurrencySymbol), TokenName (TokenName), Value) +import PlutusLedgerApi.V1.Value qualified as TH import PlutusTx qualified import PlutusTx.Lift (makeLift) import PlutusTx.Prelude (AdditiveGroup, AdditiveMonoid, AdditiveSemigroup ((+)), Bool, Eq ((==)), Integer, Monoid, diff --git a/plutus-script-utils/src/Plutus/Script/Utils/Scripts.hs b/plutus-script-utils/src/Plutus/Script/Utils/Scripts.hs index 32d7471b74..7683f45351 100644 --- a/plutus-script-utils/src/Plutus/Script/Utils/Scripts.hs +++ b/plutus-script-utils/src/Plutus/Script/Utils/Scripts.hs @@ -1,9 +1,10 @@ -{-# LANGUAGE DeriveAnyClass #-} -{-# LANGUAGE DerivingStrategies #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} - +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DerivingVia #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-orphans #-} +{-# LANGUAGE RankNTypes #-} {-| This module contains functions related to versioning scripts and BuiltinData, or more specifially, @@ -13,13 +14,27 @@ module Plutus.Script.Utils.Scripts ( -- * Plutus language versioning Language (..) , Versioned (..) + , Script (..) + , Validator (..) + , mkValidatorScript + , unValidatorScript + , MintingPolicy (..) + , mkMintingPolicyScript + , unMintingPolicyScript + , StakeValidator (..) + , mkStakeValidatorScript + , unStakeValidatorScript -- * Script hashing + , ValidatorHash (..) + , MintingPolicyHash (..) + , StakeValidatorHash (..) , scriptHash , validatorHash , mintingPolicyHash , stakeValidatorHash -- * Script utilities , scriptCurrencySymbol + , withCardanoApiScript -- * Script data hashes , PV1.Datum , PV1.DatumHash @@ -28,26 +43,34 @@ module Plutus.Script.Utils.Scripts , datumHash , redeemerHash , dataHash + -- * Address utilities + , toScriptAddress + , fromCardanoHash + , mkValidatorCardanoAddress ) where import Cardano.Api qualified as C.Api import Cardano.Api.Shelley qualified as C.Api -import Cardano.Ledger.Alonzo.Language (Language (PlutusV1, PlutusV2)) -import Codec.Serialise (Serialise, serialise) +import Cardano.Ledger.Alonzo.Language (Language (PlutusV1, PlutusV2, PlutusV3)) +import Codec.Serialise (Serialise) import Data.Aeson (FromJSON, ToJSON) -import Data.ByteString.Lazy qualified as BSL -import Data.ByteString.Short qualified as SBS +import Data.String (IsString) import GHC.Generics (Generic) -import Plutus.V1.Ledger.Api qualified as PV1 -import Plutus.V1.Ledger.Scripts qualified as PV1 +import PlutusLedgerApi.Common (serialiseCompiledCode) +import PlutusLedgerApi.V1 qualified as PV1 +import PlutusLedgerApi.V1.Bytes (LedgerBytes (LedgerBytes)) +import PlutusTx (CompiledCode, makeLift) +import PlutusTx.Builtins (BuiltinData) import PlutusTx.Builtins qualified as Builtins import Prettyprinter (Pretty (pretty)) +import Prettyprinter.Extras (PrettyShow (PrettyShow)) deriving instance Serialise Language instance Pretty Language where pretty PlutusV1 = "Plutus V1" pretty PlutusV2 = "Plutus V2" + pretty PlutusV3 = "Plutus V3" -- | A script of some kind with its Plutus language version data Versioned script = Versioned { unversioned :: script, version :: Language } @@ -58,49 +81,54 @@ instance Pretty script => Pretty (Versioned script) where pretty Versioned{unversioned,version} = pretty unversioned <> " (" <> pretty version <> ")" -- | Hash a 'Versioned' 'Script' -scriptHash :: Versioned PV1.Script -> PV1.ScriptHash -scriptHash (Versioned script lang) = +scriptHash :: Versioned Script -> PV1.ScriptHash +scriptHash = fromCardanoHash . cardanoScriptHash + +-- | Transform a Cardano Script hash in a Plutus Script hash +fromCardanoHash :: C.Api.ScriptHash -> PV1.ScriptHash +fromCardanoHash = PV1.ScriptHash . Builtins.toBuiltin . C.Api.serialiseToRawBytes - . hashInner lang - . SBS.toShort - . BSL.toStrict - . serialise - $ script - where - hashInner PlutusV1 = C.Api.hashScript . C.Api.PlutusScript C.Api.PlutusScriptV1 . C.Api.PlutusScriptSerialised - hashInner PlutusV2 = C.Api.hashScript . C.Api.PlutusScript C.Api.PlutusScriptV2 . C.Api.PlutusScriptSerialised - --- | Hash a 'Versioned' 'PV1.Validator' script. -validatorHash :: Versioned PV1.Validator -> PV1.ValidatorHash + +withCardanoApiScript :: (forall lang. C.Api.Script lang -> r) -> Versioned Script -> r +withCardanoApiScript f (Versioned (Script script) lang) = case lang of + PlutusV1 -> f . C.Api.PlutusScript C.Api.PlutusScriptV1 $ C.Api.PlutusScriptSerialised script + PlutusV2 -> f . C.Api.PlutusScript C.Api.PlutusScriptV2 $ C.Api.PlutusScriptSerialised script + PlutusV3 -> f . C.Api.PlutusScript C.Api.PlutusScriptV3 $ C.Api.PlutusScriptSerialised script + +cardanoScriptHash :: Versioned Script -> C.Api.ScriptHash +cardanoScriptHash = withCardanoApiScript C.Api.hashScript + +-- | Hash a 'Versioned' 'Validator' script. +validatorHash :: Versioned Validator -> ValidatorHash validatorHash = - PV1.ValidatorHash + ValidatorHash . PV1.getScriptHash . scriptHash - . fmap PV1.getValidator + . fmap getValidator --- | Hash a 'Versioned' 'PV1.MintingPolicy' script. -mintingPolicyHash :: Versioned PV1.MintingPolicy -> PV1.MintingPolicyHash +-- | Hash a 'Versioned' 'MintingPolicy' script. +mintingPolicyHash :: Versioned MintingPolicy -> MintingPolicyHash mintingPolicyHash = - PV1.MintingPolicyHash + MintingPolicyHash . PV1.getScriptHash . scriptHash - . fmap PV1.getMintingPolicy + . fmap getMintingPolicy --- | Hash a 'Versioned' 'PV1.StakeValidator' script. -stakeValidatorHash :: Versioned PV1.StakeValidator -> PV1.StakeValidatorHash +-- | Hash a 'Versioned' 'StakeValidator' script. +stakeValidatorHash :: Versioned StakeValidator -> StakeValidatorHash stakeValidatorHash = - PV1.StakeValidatorHash + StakeValidatorHash . PV1.getScriptHash . scriptHash - . fmap PV1.getStakeValidator + . fmap getStakeValidator {-# INLINABLE scriptCurrencySymbol #-} -- | The 'CurrencySymbol' of a 'MintingPolicy'. -scriptCurrencySymbol :: Versioned PV1.MintingPolicy -> PV1.CurrencySymbol +scriptCurrencySymbol :: Versioned MintingPolicy -> PV1.CurrencySymbol scriptCurrencySymbol scrpt = - let (PV1.MintingPolicyHash hsh) = mintingPolicyHash scrpt in PV1.CurrencySymbol hsh + let (MintingPolicyHash hsh) = mintingPolicyHash scrpt in PV1.CurrencySymbol hsh -- | Hash a 'PV1.Datum builtin data. datumHash :: PV1.Datum -> PV1.DatumHash @@ -115,7 +143,7 @@ dataHash :: Builtins.BuiltinData -> Builtins.BuiltinByteString dataHash = Builtins.toBuiltin . C.Api.serialiseToRawBytes - . C.Api.hashScriptData + . C.Api.hashScriptDataBytes . toCardanoAPIData -- | Convert a 'Builtins.BuiltinsData' value to a 'cardano-api' script @@ -123,8 +151,8 @@ dataHash = -- -- For why we depend on `cardano-api`, -- see note [Hash computation of datums, redeemers and scripts] -toCardanoAPIData :: Builtins.BuiltinData -> C.Api.ScriptData -toCardanoAPIData = C.Api.fromPlutusData . Builtins.builtinDataToData +toCardanoAPIData :: Builtins.BuiltinData -> C.Api.HashableScriptData +toCardanoAPIData = C.Api.unsafeHashableScriptData . C.Api.fromPlutusData . Builtins.builtinDataToData {- Note [Hash computation of datums, redeemers and scripts] @@ -151,3 +179,91 @@ also probably depend on `cardano-api`, so the dependency on `cardano-api` should If this becomes an issue, we'll change the implementation. -} +-- | 'Validator' is a wrapper around 'Script's which are used as validators in transaction outputs. +newtype Validator = Validator { getValidator :: Script } + deriving stock (Generic) + deriving newtype (Eq, Ord, Serialise) + deriving Pretty via (PrettyShow Validator) + +instance Show Validator where + show = const "Validator {