diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e8c0d2e3c85..41684ce35a0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ agents: queue: cardano-wallet env: - LC_ALL: "C.UTF-8" + LC_ALL: "en_US.UTF-8" NIX_PATH: "channel:nixos-21.11" STATE_DIR: "/var/lib/buildkite-agent/cache" STATE_DIR_MACOS: "/var/lib/buildkite-agent-hal-mac/cache" diff --git a/README.md b/README.md index 3312fd43f0e..e228dc68abe 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ Or modify the `docker-compose.yml` to host your client in the `mainnet_default` ### Running on preprod -Preprod network is broken for node 10.1.4 at some block in the past. +Preprod network is broken for node 10.2.1 at some block in the past. One way to overcome that limitation is to download a snapshot that used an old version node (1.35.2) to trespass that point. Use `snpashot.sh` to download the snapshot. diff --git a/cabal.project b/cabal.project index ad4c9a7a026..2721da8fb8e 100644 --- a/cabal.project +++ b/cabal.project @@ -49,11 +49,11 @@ repository cardano-haskell-packages d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee -- repeating the index-state for hackage to work around hackage.nix parsing limitation -index-state: 2024-10-10T00:52:24Z +index-state: 2025-01-01T23:24:19Z index-state: - , hackage.haskell.org 2024-10-10T00:52:24Z - , cardano-haskell-packages 2025-01-07T17:42:00Z + , hackage.haskell.org 2025-01-01T23:24:19Z + , cardano-haskell-packages 2025-03-01T00:00:00Z packages: lib/address-derivation-discovery @@ -154,8 +154,8 @@ source-repository-package source-repository-package type: git location: https://github.com/cardano-foundation/cardano-wallet-agda - tag: b5f11bde33585277aa3628b01fe6f5ee8bed2101 - --sha256: 0dc0b60vbq1ljwrdxr45nc99c3gdn98myjyd3c9xmlkn8cwpvjwx + tag: 7663f8ae600462ba460e771e651ff3bd66fe4a5c + --sha256: sha256-3ielFSr9G1YUuQcImCv3eppYbwE+WA9tEFc219VWHgk= subdir: lib/cardano-wallet-read @@ -167,20 +167,17 @@ allow-newer: , servant-openapi3:* , katip:Win32 , ekg-wai:time - + , cardano-wallet-read:cardano-ledger-api, ouroboros-consensus constraints: base >= 4.18.2.0 && < 5 , openapi3 >= 3.2.0 , persistent ^>= 2.14.6.0 - , bech32 >= 1.1.7 - -- Force newer version of `lobemo-backend-ekg` here, -- because older versions depend on `snap-server`, -- which in turns fails to link on linux musl -- due to some missing `sendfile64` hack. -- (We use linux musl to get statically linked binaries.) - , lobemo-backend-ekg >= 0.2.0.0 -- lower versions of katip won't build with the Win32-2.12.0.1 -- which is shipped with the ghc-9.2.8 @@ -188,15 +185,8 @@ constraints: -- Cardano Node dependencies: - , io-classes == 1.5.0.0 , io-classes -asserts - , cardano-ledger-api == 1.9.4.0 - - , ouroboros-network == 0.17.1.2 - - , cardano-api == 10.1.0.0 - -- Related to: https://github.com/haskell/cabal/issues/8554 if impl(ghc == 8.10.7) diff --git a/configs/cardano/mainnet/config.json b/configs/cardano/mainnet/config.json index 78e331e4988..58b844fe1cb 100644 --- a/configs/cardano/mainnet/config.json +++ b/configs/cardano/mainnet/config.json @@ -60,6 +60,7 @@ "TracingVerbosity": "NormalVerbosity", "TurnOnLogMetrics": true, "TurnOnLogging": true, + "UseTraceDispatcher": false, "defaultBackends": [ "KatipBK" ], diff --git a/configs/cardano/preview/config.json b/configs/cardano/preview/config.json index 2a5ab35ae43..b93c83babb6 100644 --- a/configs/cardano/preview/config.json +++ b/configs/cardano/preview/config.json @@ -11,14 +11,14 @@ "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, "LastKnownBlockVersion-Minor": 1, - "MinNodeVersion": "8.12.0", + "MinNodeVersion": "10.1.4", "PeerSharing": true, "Protocol": "Cardano", "RequiresNetworkMagic": "RequiresMagic", "ShelleyGenesisFile": "shelley-genesis.json", "ShelleyGenesisHash": "363498d1024f84bb39d3fa9593ce391483cb40d479b87233f868d6e57c3a400d", "TargetNumberOfActivePeers": 20, - "TargetNumberOfEstablishedPeers": 50, + "TargetNumberOfEstablishedPeers": 40, "TargetNumberOfKnownPeers": 150, "TargetNumberOfRootPeers": 60, "TestAllegraHardForkAtEpoch": 0, @@ -65,6 +65,7 @@ "TracingVerbosity": "NormalVerbosity", "TurnOnLogMetrics": true, "TurnOnLogging": true, + "UseTraceDispatcher": false, "defaultBackends": [ "KatipBK" ], diff --git a/configs/cardano/preview/download.sh b/configs/cardano/preview/download.sh index 83e52a5f839..251cdafdf11 100755 --- a/configs/cardano/preview/download.sh +++ b/configs/cardano/preview/download.sh @@ -3,9 +3,9 @@ set -euo pipefail rm ./*.json -curl https://book.play.dev.cardano.org/environments/preview/config.json > config.json -curl https://book.play.dev.cardano.org/environments/preview/conway-genesis.json > conway-genesis.json -curl https://book.play.dev.cardano.org/environments/preview/topology.json > topology.json -curl https://book.play.dev.cardano.org/environments/preview/byron-genesis.json > byron-genesis.json -curl https://book.play.dev.cardano.org/environments/preview/shelley-genesis.json > shelley-genesis.json -curl https://book.play.dev.cardano.org/environments/preview/alonzo-genesis.json > alonzo-genesis.json +curl https://book.play.dev.cardano.org/environments-pre/preview/config.json > config.json +curl https://book.play.dev.cardano.org/environments-pre/preview/conway-genesis.json > conway-genesis.json +curl https://book.play.dev.cardano.org/environments-pre/preview/topology.json > topology.json +curl https://book.play.dev.cardano.org/environments-pre/preview/byron-genesis.json > byron-genesis.json +curl https://book.play.dev.cardano.org/environments-pre/preview/shelley-genesis.json > shelley-genesis.json +curl https://book.play.dev.cardano.org/environments-pre/preview/alonzo-genesis.json > alonzo-genesis.json diff --git a/flake.lock b/flake.lock index 7f4f943f26e..d7ddeea7b9f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1733408643, - "narHash": "sha256-IH5nYTjx+CYAK4zQAkOs475X+AOhP/GPgwXm5LQHsEE=", + "lastModified": 1740707930, + "narHash": "sha256-tdP/adKe3MwMCrimV0R4OXieQk+Ekp+pKO6x4RwRrKU=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "e062328804c933d296e5956c989b326ea3c69eeb", + "rev": "6857abc36b3c7cc4af8cb59cfcea448a33dc4472", "type": "github" }, "original": { @@ -20,11 +20,11 @@ "CHaP_2": { "flake": false, "locked": { - "lastModified": 1735857786, - "narHash": "sha256-X6Fp2uU++62rgaH4J1pIN5AalfV7f9rM5dmFaByMWqU=", + "lastModified": 1739310549, + "narHash": "sha256-TfqfDfAn+0VoljIQENLezfhQTvBnZJdu2kcfVRA0ZQQ=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "b9eaf0bbe60ccf64b7afc969b79f9820a4534bcf", + "rev": "f837d4d481a0f2e4cd0cf7e458e4bd12a8400f9c", "type": "github" }, "original": { @@ -319,16 +319,16 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1736202991, - "narHash": "sha256-Oys38YkpSpB48/H2NseP9kTWXm92a7kjAZtdnorcIEY=", + "lastModified": 1739399665, + "narHash": "sha256-j59d23Bv3TCC4xjXDhPLtCDNRDA9V4VWLeBiVEzYgbA=", "owner": "IntersectMBO", "repo": "cardano-node", - "rev": "1f63dbf2ab39e0b32bf6901dc203866d3e37de08", + "rev": "52b708f37cd3dc92a188717deae2a6a60117f696", "type": "github" }, "original": { "owner": "IntersectMBO", - "ref": "10.1.4", + "ref": "10.2.1", "repo": "cardano-node", "type": "github" } @@ -808,11 +808,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1730680170, - "narHash": "sha256-CUPGIJ4PMrGKVC30bZfCrlzvTvlAjvz2bQ091DKqNNk=", + "lastModified": 1740702249, + "narHash": "sha256-+4J0jzz55cgDxndQHZ92o/uM7NhLLdQahMAtpkOfZ4U=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "3f9db9843a52f45de2e9884838de31fe7c526c75", + "rev": "5626963b37c97ba5d1d0908c2ffc2a04596b7db2", "type": "github" }, "original": { @@ -821,14 +821,31 @@ "type": "github" } }, + "hackage-for-stackage": { + "flake": false, + "locked": { + "lastModified": 1740702238, + "narHash": "sha256-Ko9ClsLnBWF367x9M+8fLZnEjtx77Fe6EHhTwJAx7GY=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "2c0ec7618b1b08d3c177840c241caa5e096cbdea", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "for-stackage", + "repo": "hackage.nix", + "type": "github" + } + }, "hackageNix": { "flake": false, "locked": { - "lastModified": 1729039425, - "narHash": "sha256-sIglYcw8Dacj4n0bRlUWo+NLkDMcVi6vtmKvUyG+ZrQ=", + "lastModified": 1736987292, + "narHash": "sha256-ZK4gWwsTWIP6j+SIHy7f2BLPcs8Q1yO8bP18thkIHLQ=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6dc43e5e01f113ce151056a8f94bce7bb2f13eb9", + "rev": "28b6ddfbfad7274f33ad99939e19afb29ee5adf6", "type": "github" }, "original": { @@ -906,6 +923,7 @@ "hackage": [ "hackage" ], + "hackage-for-stackage": "hackage-for-stackage", "hls-1.10": "hls-1.10_2", "hls-2.0": "hls-2.0_2", "hls-2.2": "hls-2.2_2", @@ -917,29 +935,24 @@ "hls-2.8": "hls-2.8_2", "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls_2", - "hydra": "hydra_2", "iserv-proxy": "iserv-proxy_2", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-2003": "nixpkgs-2003_2", - "nixpkgs-2105": "nixpkgs-2105_2", - "nixpkgs-2111": "nixpkgs-2111_2", - "nixpkgs-2205": "nixpkgs-2205_2", - "nixpkgs-2211": "nixpkgs-2211_2", "nixpkgs-2305": "nixpkgs-2305_2", "nixpkgs-2311": "nixpkgs-2311_2", "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-2411": "nixpkgs-2411", "nixpkgs-unstable": "nixpkgs-unstable_2", "old-ghc-nix": "old-ghc-nix_2", "stackage": "stackage_2" }, "locked": { - "lastModified": 1723164643, - "narHash": "sha256-GvfPyg7BzEnz0PR9gHaB4lmz0v05ELGnXo+mShTna5Y=", + "lastModified": 1740703875, + "narHash": "sha256-wk7qqz0M2GrdmK72RYRCSDAE5tcqiHiBtjQ5IOx91Cs=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "1d112d895f45335e28ccf819437703cbdfbaa744", + "rev": "6d10bd4ae0db013b56ffdbcddcac666019588064", "type": "github" }, "original": { @@ -1280,16 +1293,16 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1718469202, - "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "lastModified": 1720003792, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.9.0.0", + "ref": "2.9.0.1", "repo": "haskell-language-server", "type": "github" } @@ -1350,29 +1363,6 @@ "type": "indirect" } }, - "hydra_2": { - "inputs": { - "nix": "nix_2", - "nixpkgs": [ - "haskellNix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, "incl": { "inputs": { "nixlib": [ @@ -1406,11 +1396,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1728687575, - "narHash": "sha256-38uD8SqT557eh5yyRYuthKm1yTtiWzAN0FH7L/01QKM=", + "lastModified": 1738874249, + "narHash": "sha256-oyPD/zIhs5AUEdYXZHluMAOmT5ynJSgjV2bNIXt5aKE=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "86c2bd46e8a08f62ea38ffe77cb4e9c337b42217", + "rev": "e26038d47df5d17187288fd7c8f5b915c9447b2e", "type": "github" }, "original": { @@ -1507,22 +1497,6 @@ "type": "github" } }, - "lowdown-src_2": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, "mdbook-kroki-preprocessor": { "flake": false, "locked": { @@ -1543,7 +1517,7 @@ "inputs": { "crane": "crane", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -1664,27 +1638,6 @@ "type": "github" } }, - "nix_2": { - "inputs": { - "lowdown-src": "lowdown-src_2", - "nixpkgs": "nixpkgs_7", - "nixpkgs-regression": "nixpkgs-regression_2" - }, - "locked": { - "lastModified": 1661606874, - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", - "owner": "NixOS", - "repo": "nix", - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.11.0", - "repo": "nix", - "type": "github" - } - }, "nixago": { "inputs": { "flake-utils": [ @@ -1755,22 +1708,6 @@ "type": "github" } }, - "nixpkgs-2003_2": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2105": { "locked": { "lastModified": 1659914493, @@ -1787,22 +1724,6 @@ "type": "github" } }, - "nixpkgs-2105_2": { - "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2111": { "locked": { "lastModified": 1659446231, @@ -1819,22 +1740,6 @@ "type": "github" } }, - "nixpkgs-2111_2": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2205": { "locked": { "lastModified": 1685573264, @@ -1851,22 +1756,6 @@ "type": "github" } }, - "nixpkgs-2205_2": { - "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2211": { "locked": { "lastModified": 1688392541, @@ -1883,22 +1772,6 @@ "type": "github" } }, - "nixpkgs-2211_2": { - "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2305": { "locked": { "lastModified": 1701362232, @@ -1965,11 +1838,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1720122915, - "narHash": "sha256-Nby8WWxj0elBu1xuRaUcRjPi/rU3xVbkAt2kj4QwX2U=", + "lastModified": 1735564410, + "narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "835cf2d3f37989c5db6585a28de967a667a75fb1", + "rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8", "type": "github" }, "original": { @@ -1979,6 +1852,22 @@ "type": "github" } }, + "nixpkgs-2411": { + "locked": { + "lastModified": 1737255904, + "narHash": "sha256-r3fxHvh+M/mBgCZXOACzRFPsJdix2QSsKazb7VCXXo0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eacdab35066b0bb1c9413c96898e326b76398a81", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-24.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1735774519, @@ -2007,22 +1896,6 @@ "type": "github" } }, - "nixpkgs-regression_2": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1694822471, @@ -2041,11 +1914,11 @@ }, "nixpkgs-unstable_2": { "locked": { - "lastModified": 1720181791, - "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "lastModified": 1737110817, + "narHash": "sha256-DSenga8XjPaUV5KUFW/i3rNkN7jm9XmguW+qQ1ZJTR4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "rev": "041c867bad68dfe34b78b2813028a2e2ea70a23c", "type": "github" }, "original": { @@ -2148,22 +2021,6 @@ } }, "nixpkgs_7": { - "locked": { - "lastModified": 1657693803, - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_8": { "locked": { "lastModified": 1735617354, "narHash": "sha256-5zJyv66q68QZJZsXtmjDBazGnF0id593VSy+8eSckoo=", @@ -2399,11 +2256,11 @@ "stackage_2": { "flake": false, "locked": { - "lastModified": 1723162293, - "narHash": "sha256-f2BFFbwNUi6g86ucTA5F0ABSXO2RTeXubLmg2T4b1LE=", + "lastModified": 1740701503, + "narHash": "sha256-MZJNDPf0b4OeppLvDr09v6FD7FHw6P2u/oYshwMRruU=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "951d375ea7113198bc4e54e090e82fc8556bf7a7", + "rev": "5b348274e589398423e578f1694f2112da43fd29", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 53f30c3a186..ccdf1dc6be3 100644 --- a/flake.nix +++ b/flake.nix @@ -115,7 +115,7 @@ flake = false; }; customConfig.url = "github:input-output-hk/empty-flake"; - cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=10.1.4"; + cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=10.2.1"; mithril.url = "github:input-output-hk/mithril?ref=2506.0"; }; diff --git a/justfile b/justfile index ea0bf294b3c..66f9bc36321 100644 --- a/justfile +++ b/justfile @@ -127,8 +127,8 @@ integration-tests match: node: nix shell \ --accept-flake-config \ - 'github:IntersectMBO/cardano-node?ref=10.1.4#cardano-node' \ - 'github:IntersectMBO/cardano-node?ref=10.1.4#cardano-cli' + 'github:IntersectMBO/cardano-node?ref=10.2.1#cardano-node' \ + 'github:IntersectMBO/cardano-node?ref=10.2.1#cardano-cli' # run babbage integration tests matching the given pattern via nix babbage-integration-tests-match match: diff --git a/lib/address-derivation-discovery/address-derivation-discovery.cabal b/lib/address-derivation-discovery/address-derivation-discovery.cabal index a625eb4488f..13887352fc9 100644 --- a/lib/address-derivation-discovery/address-derivation-discovery.cabal +++ b/lib/address-derivation-discovery/address-derivation-discovery.cabal @@ -50,10 +50,10 @@ library , cardano-addresses >= 3.12.0 && < 3.13 , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-wallet-primitive , cardano-wallet-secrets @@ -69,7 +69,7 @@ library , int-cast , lens , memory - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 , QuickCheck , quiet , random diff --git a/lib/api/cardano-wallet-api.cabal b/lib/api/cardano-wallet-api.cabal index d4354b56060..13d5cc3b665 100644 --- a/lib/api/cardano-wallet-api.cabal +++ b/lib/api/cardano-wallet-api.cabal @@ -41,12 +41,12 @@ library , binary , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api:{cardano-api, internal} >= 10.1.0.0 && < 10.2 + , cardano-api:{cardano-api, internal} >= 10.8.0.0 && < 10.9 , cardano-balance-tx:{cardano-balance-tx, internal} , cardano-binary >= 1.7.1.0 && < 1.8 , cardano-crypto >= 1.1.2 && < 1.2 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 , cardano-wallet , cardano-wallet-launcher , cardano-wallet-network-layer diff --git a/lib/balance-tx/cardano-balance-tx.cabal b/lib/balance-tx/cardano-balance-tx.cabal index 97af10654a7..49b726b6f5d 100644 --- a/lib/balance-tx/cardano-balance-tx.cabal +++ b/lib/balance-tx/cardano-balance-tx.cabal @@ -39,7 +39,7 @@ library hs-source-dirs: lib/main build-depends: , cardano-balance-tx:internal - , cardano-ledger-api >= 1.9.4.0 && < 1.10 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 exposed-modules: Cardano.Write.Eras Cardano.Write.Tx @@ -52,18 +52,18 @@ library internal , base >= 4.14 && < 5 , bytestring >= 0.10.6 && < 0.13 , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-coin-selection , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-allegra >= 1.6.0.1 && < 1.7 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-babbage >= 1.10.0.0 && < 1.11 + , cardano-ledger-allegra >= 1.6.1.0 && < 1.7 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-babbage >= 1.10.1.0 && < 1.11 , cardano-ledger-binary - , cardano-ledger-conway >= 1.17.3.0 && < 1.18 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-mary >= 1.7.0.1 && < 1.8 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-conway >= 1.18.1.0 && < 1.19 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-mary >= 1.7.1.0 && < 1.8 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-strict-containers >= 0.1.3.0 && < 0.2 , cardano-wallet-primitive @@ -79,8 +79,8 @@ library internal , MonadRandom >= 0.6 && < 0.7 , monoid-subclasses >= 1.2.5.1 && < 1.3 , nonempty-containers >= 0.3.4.5 && < 0.4 - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 , pretty-simple >= 4.1.2.0 && < 4.2 , QuickCheck >= 2.14 && <= 2.16 , serialise >= 0.2.6.1 && < 0.3 @@ -114,7 +114,7 @@ test-suite test , base , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-api-extra , cardano-balance-tx:internal , cardano-binary >= 1.7.1.0 && < 1.8 @@ -122,16 +122,16 @@ test-suite test , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 , cardano-crypto-wrapper == 1.5.1.3 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-alonzo-test >= 1.3.0.0 && < 1.4 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-babbage:{cardano-ledger-babbage, testlib} >= 1.10.0.0 && < 1.11 - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-conway >= 1.17.3.0 && < 1.18 - , cardano-ledger-conway:testlib >= 1.17.3.0 && < 1.18 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-mary:testlib >= 1.7.0.1 && < 1.8 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-alonzo-test >= 1.3.0.1 && < 1.4 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-babbage:{cardano-ledger-babbage, testlib} >= 1.10.1.0 && < 1.11 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-conway >= 1.18.1.0 && < 1.19 + , cardano-ledger-conway:testlib >= 1.18.1.0 && < 1.19 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-mary:testlib >= 1.7.1.0 && < 1.8 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-numeric , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-strict-containers >= 0.1.3.0 && < 0.2 @@ -140,7 +140,7 @@ test-suite test , cardano-wallet-test-utils , cborg , containers - , data-default >= 0.7.1.1 && < 0.8 + , data-default >= 0.8.0.0 && < 0.9 , directory >= 1.3.8 && < 1.4 , filepath >= 1.4.300.1 && < 1.6 , fmt >= 0.6.3.0 && < 0.7 @@ -155,9 +155,9 @@ test-suite test , MonadRandom , monoid-subclasses , nonempty-containers - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , QuickCheck >= 2.14 && < 2.16 , quickcheck-classes >= 0.6.5 && < 0.7 , sop-extras >= 0.2.1 && < 0.3 diff --git a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Sign.hs b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Sign.hs index 1a2de6ad5f4..52b295aa6ed 100644 --- a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Sign.hs +++ b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Sign.hs @@ -119,6 +119,7 @@ import qualified Cardano.Wallet.Primitive.Types.Tx.Constraints as W import qualified Data.Foldable as F import qualified Data.List as L import qualified Data.Map as Map +import qualified GHC.IsList as IsList -- | Estimate the size of the transaction when fully signed. -- @@ -195,9 +196,8 @@ estimateKeyWitnessCounts utxo tx timelockKeyWitCounts = _ -> 0 txCerts = case CardanoApi.txCertificates txbodycontent of CardanoApi.TxCertificatesNone -> 0 - CardanoApi.TxCertificates _ certs _ -> - sumVia estimateDelegSigningKeys certs - + CardanoApi.TxCertificates _ certs -> + sumVia estimateDelegSigningKeys $ fst <$> IsList.toList certs nonInputWits = numberOfShelleyWitnesses $ fromIntegral $ length txExtraKeyWits' + length txWithdrawals' + @@ -215,9 +215,9 @@ estimateKeyWitnessCounts utxo tx timelockKeyWitCounts = in nonInputWits <> inputWits where - CardanoApi.Tx (CardanoApi.TxBody txbodycontent) _keyWits + CardanoApi.Tx body _keyWits = toCardanoApiTx tx - + txbodycontent = CardanoApi.getTxBodyContent body timelockTotalWitCount :: Natural timelockTotalWitCount = sum $ Map.elems $ Map.unionWith (\_est spec -> spec) -- Allow specified values to override diff --git a/lib/balance-tx/test/spec/Internal/Cardano/Write/Tx/BalanceSpec.hs b/lib/balance-tx/test/spec/Internal/Cardano/Write/Tx/BalanceSpec.hs index 1c2f0803222..fd1da11de9d 100644 --- a/lib/balance-tx/test/spec/Internal/Cardano/Write/Tx/BalanceSpec.hs +++ b/lib/balance-tx/test/spec/Internal/Cardano/Write/Tx/BalanceSpec.hs @@ -82,7 +82,7 @@ import Cardano.Ledger.Babbage.TxInfo import Cardano.Ledger.Conway.TxInfo ( ConwayContextError (..) ) -import Cardano.Ledger.Era +import Cardano.Ledger.Core ( Era ) import Cardano.Ledger.Keys.Bootstrap diff --git a/lib/benchmarks/cardano-wallet-benchmarks.cabal b/lib/benchmarks/cardano-wallet-benchmarks.cabal index 9aca1547109..ac693167f6f 100644 --- a/lib/benchmarks/cardano-wallet-benchmarks.cabal +++ b/lib/benchmarks/cardano-wallet-benchmarks.cabal @@ -187,7 +187,7 @@ benchmark db , base , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-crypto >= 1.1.2 && < 1.2 , cardano-wallet , cardano-wallet-benchmarks @@ -229,7 +229,7 @@ benchmark api , aeson , base , bytestring - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-balance-tx , cardano-balance-tx:internal , cardano-wallet diff --git a/lib/cardano-api-extra/cardano-api-extra.cabal b/lib/cardano-api-extra/cardano-api-extra.cabal index dcd2ad10b0c..dbbc61dba9e 100644 --- a/lib/cardano-api-extra/cardano-api-extra.cabal +++ b/lib/cardano-api-extra/cardano-api-extra.cabal @@ -41,17 +41,17 @@ library , aeson , base , bytestring - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-binary >= 1.7.1.0 && < 1.8 , cardano-crypto-class >= 2.1.5.0 && < 2.2 , cardano-crypto-test >= 1.5.0.2 && < 1.6 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-byron-test >= 1.5.1.1 && < 1.6 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-core:testlib >= 1.15.0.0 && < 1.16 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 - , cardano-ledger-conway:testlib >= 1.17.3.0 && < 1.18 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-byron-test >= 1.5.2.0 && < 1.6 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-core:testlib >= 1.16.0.0 && < 1.17 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 + , cardano-ledger-conway:testlib >= 1.18.1.0 && < 1.19 , cardano-strict-containers >= 0.1.3.0 && < 0.2 , cardano-wallet-test-utils , containers @@ -59,6 +59,7 @@ library , int-cast , iproute , network + , ordered-containers , plutus-ledger-api:plutus-ledger-api-testlib , QuickCheck , quickcheck-instances diff --git a/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs b/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs index 1c517a64e36..3a91b8894be 100644 --- a/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs +++ b/lib/cardano-api-extra/lib/Cardano/Api/Gen.hs @@ -7,6 +7,10 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# OPTIONS_GHC -Wno-orphans #-} +{-# OPTIONS_GHC -Wno-unused-matches #-} +{-# OPTIONS_GHC -Wno-unused-top-binds #-} +{-# OPTIONS_GHC -Wno-unused-local-binds #-} +{-# OPTIONS_GHC -Wno-unused-imports #-} module Cardano.Api.Gen ( genAddressAny @@ -132,6 +136,7 @@ import Cardano.Api , ByronEra , CardanoEra (..) , Certificate + , Convert (..) , ConwayEra , ConwayEraOnwards (..) , CostModel (..) @@ -241,7 +246,6 @@ import Cardano.Api , makeStakeAddressUnregistrationCertificate , makeStakePoolRegistrationCertificate , makeStakePoolRetirementCertificate - , maryEraOnwardsToShelleyBasedEra , scriptLanguageSupportedInEra , shelleyAddressInEra , validateAndHashStakePoolMetadata @@ -407,6 +411,7 @@ import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Short as SBS import qualified Data.Map as Map +import qualified Data.Map.Ordered.Strict as OMap import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T @@ -681,7 +686,6 @@ genSimpleScriptOrReferenceInput = <$> genSimpleScript , SReferenceScript <$> genReferenceInput - <*> liftArbitrary genScriptHash ] genScript :: ScriptLanguage lang -> Gen (Script lang) @@ -785,38 +789,40 @@ genSignedValue = do -- | Generate a 'Value' suitable for minting, i.e. non-ADA asset ID and a -- positive or negative quantity. -genValueForMinting :: Gen Value +genValueForMinting :: Gen [(AssetId, Quantity)] genValueForMinting = - fromList <$> listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity) + listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity) -genTxMintValue :: forall era. CardanoEra era -> Gen (TxMintValue BuildTx era) +genTxMintValue + :: forall era. CardanoEra era -> Gen (TxMintValue BuildTx era) genTxMintValue era = withEraWitness era $ \supported -> do let - scriptWitnessGenerators :: [Gen (ScriptWitness WitCtxMint era)] + scriptWitnessGenerators :: Gen (ScriptWitness WitCtxMint era) scriptWitnessGenerators = - [ genScriptWitnessMint langInEra - | AnyScriptLanguage lang <- [minBound .. maxBound] - , Just langInEra <- - [ scriptLanguageSupportedInEra - (maryEraOnwardsToShelleyBasedEra supported) - lang + oneof + [ genScriptWitnessMint langInEra + | AnyScriptLanguage lang <- [minBound .. maxBound] + , Just langInEra <- + [ scriptLanguageSupportedInEra + (convert supported) + lang + ] ] - ] + mints = do + policy <- genPolicyId + assets <- listOf $ do + assetName <- genAssetName + quantity <- genSignedQuantity + script <- BuildTxWith <$> scriptWitnessGenerators + pure (assetName, quantity, script) + pure (policy, assets) + oneof [ pure TxMintNone - , TxMintValue supported - <$> genValueForMinting - <*> ( (BuildTxWith . Map.fromList) - <$> scale - (`div` 3) - ( listOf - ( (,) - <$> genPolicyId - <*> oneof scriptWitnessGenerators - ) - ) - ) + , scale (`div` 3) + $ TxMintValue supported . Map.fromList + <$> listOf mints ] genNetworkMagic :: Gen NetworkMagic @@ -1600,22 +1606,25 @@ genTxCertificate era = e _ -> error "genTxCertificate: unsupported era" -genTxCertificates :: CardanoEra era -> Gen (TxCertificates BuildTx era) -genTxCertificates era = withEraWitness era $ \sbe -> +genTxCertificates + :: CardanoEra era -> Gen (TxCertificates BuildTx era) +genTxCertificates era = withEraWitness era $ \sbe -> do + let stakingCore = + (,) + <$> genStakeCredential + <*> genWitnessStake era + staking = BuildTxWith <$> oneof [pure Nothing, Just <$> stakingCore] + stakingCertificate = do + cert <- genTxCertificate era + stake <- staking + pure (cert, stake) + certificates = + scale (`div` 3) + $ TxCertificates sbe . OMap.fromList + <$> listOf stakingCertificate oneof [ pure TxCertificatesNone - , TxCertificates sbe - <$> scale (`div` 3) (listOf (genTxCertificate era)) - <*> ( BuildTxWith - <$> scale - (`div` 3) - ( listOf - ( (,) - <$> genStakeCredential - <*> genWitnessStake era - ) - ) - ) + , certificates ] genProtocolParametersUpdate :: Gen ProtocolParametersUpdate @@ -1646,7 +1655,7 @@ genProtocolParametersUpdate = do liftArbitrary genCoin protocolUpdatePoolRetireMaxEpoch <- liftArbitrary genInterval - protocolUpdateStakePoolTargetNum <- + protocolUpdateStakePoolTargetNum <- fmap fromIntegral <$> liftArbitrary genNat protocolUpdatePoolPledgeInfluence <- liftArbitrary genRational @@ -1760,19 +1769,6 @@ genVotingProcedures w = case w of , pure TxVotingProceduresNone ] -genSupplementalData - :: CardanoEra era - -> ( Gen - (BuildTxWith BuildTx (ShelleyApi.TxSupplementalDatums era2)) - ) -genSupplementalData era = fmap BuildTxWith - $ flip (inEonForEra (pure ShelleyApi.TxSupplementalDataNone)) era - $ \case - ConwayEraOnwardsConway -> oneof - [ pure ShelleyApi.TxSupplementalDataNone - , ShelleyApi.TxSupplementalDatums <$> listOf genHashableScriptData - ] - genTxBodyContent :: CardanoEra era -> Gen (TxBodyContent BuildTx era) genTxBodyContent era = withEraWitness era $ \sbe -> do txIns <- scale (`div` 3) $ do @@ -1798,7 +1794,6 @@ genTxBodyContent era = withEraWitness era $ \sbe -> do txCurrentTreasuryValue <- genMaybeFeaturedInEra (const (pure <$> genCoin)) era txTreasuryDonation <- genMaybeFeaturedInEra (const genCoin) era - txSupplementalData <- genSupplementalData era let txBody = TxBodyContent @@ -1830,7 +1825,6 @@ genTxBodyContent era = withEraWitness era $ \sbe -> do , Api.txVotingProcedures , Api.txCurrentTreasuryValue , Api.txTreasuryDonation - , Api.txSupplementalData } let witnesses = collectTxBodyScriptWitnesses sbe txBody diff --git a/lib/delta-chain/delta-chain.cabal b/lib/delta-chain/delta-chain.cabal index a3817edf2d4..028c3c8c287 100644 --- a/lib/delta-chain/delta-chain.cabal +++ b/lib/delta-chain/delta-chain.cabal @@ -50,7 +50,7 @@ library , delta-types , exceptions , generic-lens - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , monad-logger , persistent , persistent-sqlite diff --git a/lib/delta-store/delta-store.cabal b/lib/delta-store/delta-store.cabal index 5234521a10b..f4cb091aad8 100644 --- a/lib/delta-store/delta-store.cabal +++ b/lib/delta-store/delta-store.cabal @@ -32,7 +32,7 @@ library base , delta-types , fmt - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , mtl , QuickCheck , transformers diff --git a/lib/delta-table/delta-table.cabal b/lib/delta-table/delta-table.cabal index 3e6d6bf589a..7eec2fdde15 100644 --- a/lib/delta-table/delta-table.cabal +++ b/lib/delta-table/delta-table.cabal @@ -48,7 +48,7 @@ library , containers , delta-store , delta-types - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , Only == 0.1 , sqlite-simple , text diff --git a/lib/exe/cardano-wallet-exe.cabal b/lib/exe/cardano-wallet-exe.cabal index 558f355bdfb..c3f731f0b66 100644 --- a/lib/exe/cardano-wallet-exe.cabal +++ b/lib/exe/cardano-wallet-exe.cabal @@ -113,7 +113,7 @@ library , cardano-wallet-read , cardano-wallet-secrets , contra-tracer - , data-default + , data-default >= 0.8.0.0 && < 0.9 , directory , file-embed , filepath diff --git a/lib/integration/cardano-wallet-integration.cabal b/lib/integration/cardano-wallet-integration.cabal index 218c6e1342f..3846fe722ff 100644 --- a/lib/integration/cardano-wallet-integration.cabal +++ b/lib/integration/cardano-wallet-integration.cabal @@ -52,7 +52,7 @@ library framework , bech32-th , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-wallet , cardano-wallet-api , cardano-wallet-application-extras @@ -136,11 +136,11 @@ library scenarios , bech32-th , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 , cardano-wallet , cardano-wallet-api , cardano-wallet-exe diff --git a/lib/integration/configs/cardano/preprod/config.json b/lib/integration/configs/cardano/preprod/config.json index ab3b5dfcc57..bc3c0b864e3 100644 --- a/lib/integration/configs/cardano/preprod/config.json +++ b/lib/integration/configs/cardano/preprod/config.json @@ -9,14 +9,14 @@ "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 2, "LastKnownBlockVersion-Minor": 0, - "MinNodeVersion": "8.12.0", + "MinNodeVersion": "10.1.4", "PeerSharing": true, "Protocol": "Cardano", "RequiresNetworkMagic": "RequiresMagic", "ShelleyGenesisFile": "shelley-genesis.json", "ShelleyGenesisHash": "162d29c4e1cf6b8a84f2d692e67a3ac6bc7851bc3e6e4afe64d15778bed8bd86", "TargetNumberOfActivePeers": 20, - "TargetNumberOfEstablishedPeers": 50, + "TargetNumberOfEstablishedPeers": 40, "TargetNumberOfKnownPeers": 150, "TargetNumberOfRootPeers": 60, "TraceAcceptPolicy": true, @@ -59,6 +59,7 @@ "TracingVerbosity": "NormalVerbosity", "TurnOnLogMetrics": true, "TurnOnLogging": true, + "UseTraceDispatcher": false, "defaultBackends": [ "KatipBK" ], @@ -68,6 +69,11 @@ "stdout" ] ], + "hasEKG": 12788, + "hasPrometheus": [ + "127.0.0.1", + 12798 + ], "minSeverity": "Info", "options": { "mapBackends": { diff --git a/lib/integration/scenarios/Test/Integration/Scenario/API/Shared/Transactions.hs b/lib/integration/scenarios/Test/Integration/Scenario/API/Shared/Transactions.hs index 21682126353..dc4881cb7c4 100644 --- a/lib/integration/scenarios/Test/Integration/Scenario/API/Shared/Transactions.hs +++ b/lib/integration/scenarios/Test/Integration/Scenario/API/Shared/Transactions.hs @@ -468,8 +468,8 @@ spec = describe "SHARED_TRANSACTIONS" $ do -- checking metadata before signing via directly inspecting serialized -- tx let getMetadata (Cardano.InAnyCardanoEra _ tx) = Cardano.getTxBody tx & - \(Cardano.TxBody bodyContent) -> - Cardano.txMetadata bodyContent & \case + \body -> + Cardano.txMetadata (Cardano.getTxBodyContent body) & \case Cardano.TxMetadataNone -> Nothing Cardano.TxMetadataInEra _ (Cardano.TxMetadata m) -> diff --git a/lib/integration/scenarios/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs b/lib/integration/scenarios/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs index 18f10dad8be..8f5d86a8bb2 100644 --- a/lib/integration/scenarios/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs +++ b/lib/integration/scenarios/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs @@ -5310,13 +5310,14 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do getMetadataFromTx :: InAnyCardanoEra Cardano.Tx -> Maybe (Map.Map Word64 TxMetadataValue) - getMetadataFromTx (InAnyCardanoEra _ tx) = Cardano.getTxBody tx & - \(Cardano.TxBody bodyContent) -> - Cardano.txMetadata bodyContent & \case - Cardano.TxMetadataNone -> - Nothing - Cardano.TxMetadataInEra _ (Cardano.TxMetadata m) -> - Just m + getMetadataFromTx (InAnyCardanoEra _ tx) = + Cardano.getTxBody tx + & \body -> + Cardano.txMetadata (Cardano.getTxBodyContent body) & \case + Cardano.TxMetadataNone -> + Nothing + Cardano.TxMetadataInEra _ (Cardano.TxMetadata m) -> + Just m -- Construct a JSON payment request for the given quantity of lovelace. mkTxPayload diff --git a/lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/ConfiguredPool.hs b/lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/ConfiguredPool.hs index 127e3ef2841..33f43a1d186 100644 --- a/lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/ConfiguredPool.hs +++ b/lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/ConfiguredPool.hs @@ -27,6 +27,9 @@ import Cardano.Api , SerialiseAsCBOR (..) , runExceptT ) +import Cardano.Api.Ledger + ( toVRFVerKeyHash + ) import Cardano.Binary ( FromCBOR (..) ) @@ -476,7 +479,7 @@ configurePool metadataServer recipe = do let params = Ledger.PoolParams { ppId = poolId - , ppVrf = vrf + , ppVrf = toVRFVerKeyHash vrf , ppPledge = Ledger.Coin $ intCast pledgeAmt , ppCost = Ledger.Coin 0 , ppMargin = unsafeUnitInterval 0.1 diff --git a/lib/local-cluster/local-cluster.cabal b/lib/local-cluster/local-cluster.cabal index 14f57487e2d..3f12d707f19 100644 --- a/lib/local-cluster/local-cluster.cabal +++ b/lib/local-cluster/local-cluster.cabal @@ -104,13 +104,13 @@ library , base58-bytestring >= 0.1 && < 0.2 , bytestring >= 0.10.6 && < 0.13 , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-binary >= 1.7.1.0 && < 1.8 - , cardano-cli >= 10.1 && < 10.2 + , cardano-cli >= 10.4.0.0 && < 10.5 , cardano-data >= 1.2.3.1 && < 1.3 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-wallet-application-extras , cardano-wallet-launcher , cardano-wallet-primitive @@ -132,7 +132,7 @@ library -- insert-ordered-containers is used by openapi3 , insert-ordered-containers >=0.2.3 && < 0.3 , int-cast >= 0.2.0.0 && < 0.3 - , io-classes >= 1.0 && < 1.8 + , io-classes >= 1.5.0.0 && < 1.6 , iohk-monitoring >= 0.2.0.0 && < 0.3 , iohk-monitoring-extra , lens >= 5.2.3 && < 5.4 @@ -146,8 +146,8 @@ library -- commit f22c31611c295637a3e72b341cd1c56d1d87b993 , openapi3 >= 3.2.3 && < 3.3 , optparse-applicative >= 0.18.1.0 && < 0.19 - , ouroboros-network >= 0.17.1.2 && < 0.18 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ouroboros-network >= 0.19.0.3 && < 0.20 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , pathtype >= 0.8.1.3 && < 0.9 , profunctors >= 5.6.2 && < 5.7 , QuickCheck >= 2.14 && < 2.16 @@ -230,12 +230,12 @@ common test-common , bytestring , cardano-addresses >= 3.12.0 && < 3.13 , cardano-binary >= 1.7.1.0 && < 1.8 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-babbage >= 1.10.0.0 && < 1.11 - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-mary >= 1.7.0.1 && < 1.8 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-babbage >= 1.10.1.0 && < 1.11 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-mary >= 1.7.1.0 && < 1.8 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-wallet-launcher , cardano-wallet-network-layer , cardano-wallet-primitive @@ -252,8 +252,8 @@ common test-common , local-cluster:local-cluster-process , mtl , openapi3 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-network >= 0.17.1.2 && < 0.18 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-network >= 0.19.0.3 && < 0.20 , pathtype , QuickCheck , streaming >= 0.2.4 && < 0.3 diff --git a/lib/local-cluster/test/data/cluster-configs/node-config.json b/lib/local-cluster/test/data/cluster-configs/node-config.json index 7008f78c4b5..e6da43ac5dd 100644 --- a/lib/local-cluster/test/data/cluster-configs/node-config.json +++ b/lib/local-cluster/test/data/cluster-configs/node-config.json @@ -63,6 +63,7 @@ "TracingVerbosity": "NormalVerbosity", "TurnOnLogMetrics": false, "TurnOnLogging": true, + "UseTraceDispatcher": false, "defaultBackends": [ "KatipBK" ], diff --git a/lib/local-cluster/test/data/cluster-configs/template/config.json b/lib/local-cluster/test/data/cluster-configs/template/config.json index be0ae270738..7b0e3b1f45f 100644 --- a/lib/local-cluster/test/data/cluster-configs/template/config.json +++ b/lib/local-cluster/test/data/cluster-configs/template/config.json @@ -1,95 +1,108 @@ { - "ByronGenesisFile": "byron-genesis.json", - "ShelleyGenesisFile": "shelley-genesis.json", - "AlonzoGenesisFile": "alonzo-genesis.json", - "ConwayGenesisFile": "conway-genesis.json", - "ApplicationName": "cardano-sl", - "ApplicationVersion": 0, - "LastKnownBlockVersion-Alt": 0, - "LastKnownBlockVersion-Major": 3, - "LastKnownBlockVersion-Minor": 1, - "MaxConcurrencyDeadline": 4, - "MaxKnownMajorProtocolVersion": 2, - "PBftSignatureThreshold": 1.1, - "Protocol": "Cardano", - "RequiresNetworkMagic": "RequiresMagic", - "TestShelleyHardForkAtEpoch": 0, - "TestAllegraHardForkAtEpoch": 0, - "TestMaryHardForkAtEpoch": 0, - "TestAlonzoHardForkAtEpoch": 0, - "EnableP2P": true, - "ExperimentalProtocolsEnabled": true, - "ExperimentalHardForksEnabled": true, - "TargetNumberOfActivePeers": 20, - "TargetNumberOfEstablishedPeers": 50, - "TargetNumberOfKnownPeers": 100, - "TargetNumberOfRootPeers": 100, - "TraceAcceptPolicy": true, - "TraceBlockFetchClient": false, - "TraceBlockFetchDecisions": false, - "TraceBlockFetchProtocol": false, - "TraceBlockFetchProtocolSerialised": false, - "TraceBlockFetchServer": false, - "TraceChainDb": true, - "TraceChainSyncBlockServer": false, - "TraceChainSyncClient": false, - "TraceChainSyncHeaderServer": false, - "TraceChainSyncProtocol": false, - "TraceConnectionManager": true, - "TraceDNSResolver": true, - "TraceDNSSubscription": true, - "TraceDiffusionInitialization": true, - "TraceErrorPolicy": true, - "TraceForge": true, - "TraceHandshake": false, - "TraceInboundGovernor": true, - "TraceIpSubscription": true, - "TraceLedgerPeers": true, - "TraceLocalChainSyncProtocol": false, - "TraceLocalErrorPolicy": true, - "TraceLocalHandshake": false, - "TraceLocalRootPeers": true, - "TraceLocalTxSubmissionProtocol": false, - "TraceLocalTxSubmissionServer": false, - "TraceMempool": false, - "TraceMux": false, - "TracePeerSelection": true, - "TracePeerSelectionActions": true, - "TracePublicRootPeers": true, - "TraceServer": true, - "TraceTxInbound": false, - "TraceTxOutbound": false, - "TraceTxSubmissionProtocol": false, - "TracingVerbosity": "NormalVerbosity", - "TurnOnLogMetrics": true, - "TurnOnLogging": true, - "defaultBackends": ["KatipBK"], - "defaultScribes": [["StdoutSK", "cardano"]], - "hasEKG": 12788, - "hasPrometheus": ["0.0.0.0", 12798], - "minSeverity": "Debug", - "options": { - "mapBackends": { - "cardano.node.metrics": ["EKGViewBK"], - "cardano.node.resources": ["EKGViewBK"] + "AlonzoGenesisFile": "alonzo-genesis.json", + "ApplicationName": "cardano-sl", + "ApplicationVersion": 0, + "ByronGenesisFile": "byron-genesis.json", + "ConwayGenesisFile": "conway-genesis.json", + "defaultBackends": [ + "KatipBK" + ], + "defaultScribes": [ + [ + "StdoutSK", + "stdout" + ] + ], + "EnableP2P": true, + "ExperimentalHardForksEnabled": true, + "ExperimentalProtocolsEnabled": true, + "hasEKG": 12788, + "hasPrometheus": [ + "0.0.0.0", + 12798 + ], + "LastKnownBlockVersion-Alt": 0, + "LastKnownBlockVersion-Major": 3, + "LastKnownBlockVersion-Minor": 1, + "MaxConcurrencyDeadline": 4, + "MaxKnownMajorProtocolVersion": 2, + "minSeverity": "Debug", + "options": { + "mapBackends": { + "cardano.node.metrics": [ + "EKGViewBK" + ], + "cardano.node.resources": [ + "EKGViewBK" + ] + }, + "mapSubtrace": { + "cardano.node.metrics": { + "subtrace": "Neutral" + } + } }, - "mapSubtrace": { - "cardano.node.metrics": { - "subtrace": "Neutral" - } - } - }, - "rotation": { - "rpKeepFilesNum": 10, - "rpLogLimitBytes": 5000000, - "rpMaxAgeHours": 24 - }, - "setupBackends": ["KatipBK"], - "setupScribes": [ - { - "scFormat": "ScText", - "scKind": "StdoutSK", - "scName": "cardano" - } - ] -} + "PBftSignatureThreshold": 1.1, + "Protocol": "Cardano", + "RequiresNetworkMagic": "RequiresMagic", + "rotation": { + "rpKeepFilesNum": 10, + "rpLogLimitBytes": 5000000, + "rpMaxAgeHours": 24 + }, + "setupBackends": [ + "KatipBK" + ], + "setupScribes": [ + { + "scFormat": "ScText", + "scKind": "StdoutSK", + "scName": "stdout" + } + ], + "ShelleyGenesisFile": "shelley-genesis.json", + "TargetNumberOfActivePeers": 20, + "TargetNumberOfEstablishedPeers": 40, + "TargetNumberOfKnownPeers": 150, + "TargetNumberOfRootPeers": 60, + "TraceAcceptPolicy": true, + "TraceBlockFetchClient": false, + "TraceBlockFetchDecisions": false, + "TraceBlockFetchProtocol": false, + "TraceBlockFetchProtocolSerialised": false, + "TraceBlockFetchServer": false, + "TraceChainDb": true, + "TraceChainSyncBlockServer": false, + "TraceChainSyncClient": false, + "TraceChainSyncHeaderServer": false, + "TraceChainSyncProtocol": false, + "TraceConnectionManager": true, + "TraceDiffusionInitialization": true, + "TraceDNSResolver": true, + "TraceDNSSubscription": true, + "TraceErrorPolicy": true, + "TraceForge": true, + "TraceHandshake": false, + "TraceInboundGovernor": true, + "TraceIpSubscription": true, + "TraceLedgerPeers": true, + "TraceLocalChainSyncProtocol": false, + "TraceLocalErrorPolicy": true, + "TraceLocalHandshake": false, + "TraceLocalRootPeers": true, + "TraceLocalTxSubmissionProtocol": false, + "TraceLocalTxSubmissionServer": false, + "TraceMempool": false, + "TraceMux": false, + "TracePeerSelection": true, + "TracePeerSelectionActions": true, + "TracePublicRootPeers": true, + "TraceServer": true, + "TraceTxInbound": false, + "TraceTxOutbound": false, + "TraceTxSubmissionProtocol": false, + "TracingVerbosity": "NormalVerbosity", + "TurnOnLogging": true, + "TurnOnLogMetrics": true, + "UseTraceDispatcher": false +} \ No newline at end of file diff --git a/lib/network-layer/cardano-wallet-network-layer.cabal b/lib/network-layer/cardano-wallet-network-layer.cabal index 3b899bb590c..9fecbb8cd37 100644 --- a/lib/network-layer/cardano-wallet-network-layer.cabal +++ b/lib/network-layer/cardano-wallet-network-layer.cabal @@ -69,18 +69,18 @@ library build-depends: , base >= 4.14 && < 5 , bytestring >= 0.10.6 && < 0.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-balance-tx , cardano-balance-tx:internal , cardano-binary >= 1.7.1.0 && < 1.8 , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-babbage >= 1.10.0.0 && < 1.11 - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-mary >= 1.7.0.1 && < 1.8 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-babbage >= 1.10.1.0 && < 1.11 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-mary >= 1.7.1.0 && < 1.8 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-wallet-launcher , cardano-wallet-primitive @@ -90,19 +90,19 @@ library , contra-tracer >= 0.1 && < 0.3 , exceptions >= 0.10.7 && < 0.11 , fmt >= 0.6.3 && < 0.7 - , io-classes >= 1.0 && < 1.8 + , io-classes >= 1.5.0.0 && < 1.6 , iohk-monitoring >= 0.2.0.0 && < 0.3 , iohk-monitoring-extra - , network-mux >= 0.4.5 && < 0.5 + , network-mux >= 0.6 && < 0.7 , nothunks >= 0.1.5 && < 0.4 - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-consensus-diffusion >= 0.18.0.0 && < 0.19 - , ouroboros-consensus-protocol >= 0.9.0.2 && < 0.10 - , ouroboros-network >= 0.17.1.2 && < 0.18 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 - , ouroboros-network-framework >= 0.13.2.5 && < 0.14 - , ouroboros-network-protocols >= 0.11.0.0 && < 0.12 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-consensus-diffusion >= 0.20.0.0 && < 0.21 + , ouroboros-consensus-protocol >= 0.10.0.0 && < 0.11 + , ouroboros-network >= 0.19.0.3 && < 0.20 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 + , ouroboros-network-framework >= 0.16.0.0 && < 0.17 + , ouroboros-network-protocols >= 0.13.0.0 && < 0.14 , parallel >= 3.2.2 && < 3.3 , retry >= 0.9.3 && < 0.10 , safe >= 0.3.19 && < 0.4 @@ -112,7 +112,8 @@ library , text-class , time >= 1.12.2 && < 1.15 , transformers >= 0.6.1.0 && < 0.7 - , typed-protocols >= 0.1.1 && < 0.2 + , typed-protocols >= 0.3.0.0 && < 0.4 + , typed-protocols-stateful , unliftio >= 0.2.25 && < 0.3 , unliftio-core >= 0.1.1 && < 0.3 @@ -129,7 +130,7 @@ test-suite unit , containers , contra-tracer , hspec >= 2.11.0 && < 2.12 - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , QuickCheck >= 2.14 && < 2.16 , text , transformers diff --git a/lib/network-layer/src/Cardano/Wallet/Network/Implementation.hs b/lib/network-layer/src/Cardano/Wallet/Network/Implementation.hs index e344d497bb3..b1e9dbef0ef 100644 --- a/lib/network-layer/src/Cardano/Wallet/Network/Implementation.hs +++ b/lib/network-layer/src/Cardano/Wallet/Network/Implementation.hs @@ -178,7 +178,8 @@ import Control.Monad.Class.MonadST ( MonadST ) import Control.Monad.Class.MonadThrow - ( MonadThrow + ( MonadMask + , MonadThrow ) import Control.Monad.Class.MonadTimer ( MonadTimer @@ -266,9 +267,9 @@ import GHC.Stack ( HasCallStack ) import Network.Mux - ( MuxError (..) - , MuxErrorType (..) - , WithMuxBearer (..) + ( Error (..) + , Mode (..) + , WithBearer (..) ) import Ouroboros.Consensus.Cardano ( CardanoBlock @@ -322,7 +323,6 @@ import Ouroboros.Network.Driver.Simple ) import Ouroboros.Network.Mux ( MiniProtocolCb (..) - , MuxMode (..) , OuroborosApplicationWithMinimalCtx , RunMiniProtocol (..) , RunMiniProtocolWithMinimalCtx @@ -354,6 +354,7 @@ import Ouroboros.Network.Protocol.LocalStateQuery.Client ) import Ouroboros.Network.Protocol.LocalStateQuery.Type ( LocalStateQuery + , State (..) ) import Ouroboros.Network.Protocol.LocalTxSubmission.Client ( localTxSubmissionClientPeer @@ -392,6 +393,7 @@ import qualified Data.Set as Set import qualified Data.Text as T import qualified Ouroboros.Consensus.Cardano.Block as Consensus import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Consensus +import qualified Ouroboros.Network.Driver.Stateful as Stateful {- HLINT ignore "Use readTVarIO" -} {- HLINT ignore "Use newTVarIO" -} @@ -574,7 +576,10 @@ withNodeNetworkLayerBase (atomically . repsertTMVar eraVar) txSubmissionQ let trNodeTip = MsgConnectionStatus ClientNodeTip >$< tr - ouroborosApp :: NodeToClientVersion -> WalletOuroborosApplication IO + ouroborosApp + :: NodeToClientVersion + -> NodeToClientVersionData + -> WalletOuroborosApplication IO ouroborosApp = nodeToClientProtocols =<< mkProtocols link =<< async @@ -603,7 +608,9 @@ withNodeNetworkLayerBase -> IO () runFetchBlockClient retryHandlers blockQ = do let ouroborosApp - :: NodeToClientVersion -> WalletOuroborosApplication IO + :: NodeToClientVersion + -> NodeToClientVersionData + -> WalletOuroborosApplication IO ouroborosApp = mkFetchBlockClient cfg blockQ connectClient nullTracer retryHandlers ouroborosApp versionData conn @@ -821,6 +828,7 @@ mkWalletClient -> ChainFollower m (Point block) (Tip block) (NonEmpty block) -> CodecConfig block -> NodeToClientVersion + -> NodeToClientVersionData -> WalletOuroborosApplication m mkWalletClient tr pipeliningStrategy follower cfg nodeToClientVer = nodeToClientProtocols protocols nodeToClientVer @@ -852,6 +860,7 @@ mkFetchBlockClient => CodecConfig block -> TQueue m (FetchBlockCmd m block (Point block)) -> NodeToClientVersion + -> NodeToClientVersionData -> WalletOuroborosApplication m mkFetchBlockClient cfg blockQ nodeToClientVer = nodeToClientProtocols protocols nodeToClientVer @@ -875,16 +884,17 @@ mkFetchBlockClient cfg blockQ nodeToClientVer = -- purposes of querying delegations and rewards. mkDelegationRewardsClient :: forall m - . (MonadThrow m, MonadST m, MonadTimer m, MonadIO m) + . (MonadST m, MonadTimer m, MonadIO m, MonadAsync m, MonadMask m) => Tracer m Log -- ^ Base trace for underlying protocols -> CodecConfig (CardanoBlock StandardCrypto) -> TQueue m (LocalStateQueryCmd (CardanoBlock StandardCrypto) m) -- ^ Communication channel with the LocalStateQuery client -> NodeToClientVersion + -> NodeToClientVersionData -> WalletOuroborosApplication m -mkDelegationRewardsClient tr cfg queryRewardQ nodeToClientVer = - nodeToClientProtocols protocols nodeToClientVer +mkDelegationRewardsClient tr cfg queryRewardQ nodeToClientVer nodeToClientVerData = + nodeToClientProtocols protocols nodeToClientVer nodeToClientVerData where protocols = NodeToClientProtocols @@ -896,13 +906,12 @@ mkDelegationRewardsClient tr cfg queryRewardQ nodeToClientVer = let tr' = MsgLocalStateQuery DelegationRewardsClient >$< tr codecs' = serialisedCodecs nodeToClientVer cfg codec = cStateQueryCodec codecs' - runPeer tr' codec channel + Stateful.runPeer tr' codec channel StateIdle $ localStateQueryClientPeer $ localStateQuery queryRewardQ } type CardanoInterpreter sc = Interpreter (CardanoEras sc) - -- | Construct node protocols with the given communication channels, -- for the purpose of: -- @@ -912,7 +921,13 @@ type CardanoInterpreter sc = Interpreter (CardanoEras sc) -- * Submitting transactions mkWalletToNodeProtocols :: forall m - . (HasCallStack, MonadUnliftIO m, MonadThrow m, MonadST m, MonadTimer m) + . ( HasCallStack + , MonadUnliftIO m + , MonadST m + , MonadTimer m + , MonadAsync m + , MonadMask m + ) => Tracer m Log -- ^ Base trace for underlying protocols -> NetworkParameters @@ -997,7 +1012,8 @@ mkWalletToNodeProtocols client = localStateQuery localStateQueryQ peer = localStateQueryClientPeer client tr' = MsgLocalStateQuery TipSyncClient >$< tr - runPeer tr' codec channel peer + Stateful.runPeer tr' codec channel StateIdle + peer , localTxSubmissionProtocol = InitiatorProtocolOnly $ MiniProtocolCb $ \_ channel -> do @@ -1176,13 +1192,16 @@ serialisedCodecs nodeToClientVersion cfg = connectClient :: Tracer IO ConnectionStatusLog -> RetryHandlers - -> (NodeToClientVersion -> WalletOuroborosApplication IO) + -> ( NodeToClientVersion + -> NodeToClientVersionData + -> WalletOuroborosApplication IO + ) -> NodeToClientVersionData -> CardanoNodeConn -> IO () connectClient tr handlers client vData conn = withIOManager $ \manager -> connectTo (localSnocket manager) tracers versions (nodeSocketFile conn) - & recoveringNodeConnection tr handlers + & void . recoveringNodeConnection tr handlers where versions = combineVersions @@ -1243,25 +1262,24 @@ handleIOException tr e = traceWith tr e $> retryAction | "resource exhausted" `isInfixOf` show e = ConsultPolicy | otherwise = DontRetry -handleMuxError :: Tracer IO ReasonConnectionLost -> MuxError -> IO RetryAction +handleMuxError :: Tracer IO ReasonConnectionLost -> Error -> IO RetryAction handleMuxError tr muxErr = do traceWith tr (ReasonMuxError muxErr) - case errorType muxErr of - MuxUnknownMiniProtocol -> pure DontRetry - MuxDecodeError -> pure DontRetry - MuxIngressQueueOverRun -> pure DontRetry - MuxInitiatorOnly -> pure DontRetry - MuxShutdown _ -> pure DontRetry -- fixme: #2212 consider cases - MuxCleanShutdown -> pure DontRetry - MuxIOException e -> handleIOException (ReasonException >$< tr) e - MuxBearerClosed -> pure ConsultPolicy + case muxErr of + UnknownMiniProtocol _ -> pure DontRetry + SDUDecodeError _ -> pure DontRetry + IngressQueueOverRun _ _ -> pure DontRetry + InitiatorOnly _ -> pure DontRetry + Shutdown _ _ -> pure DontRetry -- fixme: #2212 consider cases + IOException e _ -> handleIOException (ReasonException >$< tr) e + BearerClosed _ -> pure ConsultPolicy -- MuxSDU*Timeout errors arise because the bandwidth of the -- interprocess communication socket dropped unexpectedly, -- and the socket library decided to cut off the connection -- after ~ 30 seconds. -- Chances are that the system is overloaded, let's retry in 30 seconds. - MuxSDUReadTimeout -> pure $ ConsultPolicyOverrideDelay 30_000_000 - MuxSDUWriteTimeout -> pure $ ConsultPolicyOverrideDelay 30_000_000 + SDUReadTimeout -> pure $ ConsultPolicyOverrideDelay 30_000_000 + SDUWriteTimeout -> pure $ ConsultPolicyOverrideDelay 30_000_000 {------------------------------------------------------------------------------- Helper functions of the Control.* and STM variety @@ -1329,7 +1347,7 @@ isSlowQuery :: String -> DiffTime -> Bool isSlowQuery _label = (>= 0.2) data ReasonConnectionLost - = ReasonMuxError MuxError + = ReasonMuxError Error | ReasonException IOException data ConnectionStatusLog where @@ -1338,7 +1356,7 @@ data ConnectionStatusLog where MsgConnectionLost :: ReasonConnectionLost -> ConnectionStatusLog MsgHandshakeTracer - :: WithMuxBearer (ConnectionId LocalAddress) HandshakeTrace + :: WithBearer (ConnectionId LocalAddress) (HandshakeTrace) -> ConnectionStatusLog instance ToText ConnectionStatusLog where @@ -1350,15 +1368,13 @@ instance ToText ConnectionStatusLog where , "). Retrying in a bit..." ] MsgConnectionLost reason -> case reason of - ReasonMuxError MuxError{errorType, errorMsg} -> + ReasonMuxError muxError -> "Node connection lost because of the mux error (" - <> T.pack (show errorType) - <> "): " - <> T.pack errorMsg + <> T.pack (show muxError) ReasonException e -> "Node connection lost because of the exception: " <> T.pack (show e) - MsgHandshakeTracer (WithMuxBearer conn h) -> + MsgHandshakeTracer (WithBearer conn h) -> pretty conn <> " " <> T.pack (show h) instance HasPrivacyAnnotation ConnectionStatusLog @@ -1372,17 +1388,16 @@ instance HasSeverityAnnotation ConnectionStatusLog where ReasonException ie | isResourceVanishedError ie -> Warning ReasonException _ie -> Debug ReasonMuxError muxError -> - case errorType muxError of - MuxUnknownMiniProtocol -> Debug - MuxDecodeError -> Debug - MuxIngressQueueOverRun -> Debug - MuxInitiatorOnly -> Debug - MuxIOException _ -> Debug - MuxSDUReadTimeout -> Debug - MuxSDUWriteTimeout -> Debug - MuxShutdown _ -> Debug - MuxCleanShutdown -> Debug - MuxBearerClosed -> Warning + case muxError of + UnknownMiniProtocol _ -> Debug + SDUDecodeError _ -> Debug + IngressQueueOverRun _ _ -> Debug + InitiatorOnly _ -> Debug + IOException _ _ -> Debug + SDUReadTimeout -> Debug + SDUWriteTimeout -> Debug + Shutdown _ _ -> Debug + BearerClosed _ -> Warning data Client = ClientChainSync @@ -1407,12 +1422,13 @@ data Log where -> Log MsgLocalStateQuery :: QueryClientName - -> ( TraceSendRecv + -> ( Stateful.TraceSendRecv ( LocalStateQuery (CardanoBlock StandardCrypto) (Point (CardanoBlock StandardCrypto)) (Query (CardanoBlock StandardCrypto)) ) + State ) -> Log MsgPostTx :: ByteString -> Log diff --git a/lib/network-layer/src/Cardano/Wallet/Network/Implementation/Ouroboros.hs b/lib/network-layer/src/Cardano/Wallet/Network/Implementation/Ouroboros.hs index 115fefca1d6..9adf5790511 100644 --- a/lib/network-layer/src/Cardano/Wallet/Network/Implementation/Ouroboros.hs +++ b/lib/network-layer/src/Cardano/Wallet/Network/Implementation/Ouroboros.hs @@ -109,10 +109,13 @@ import Data.Text import Data.Void ( Void ) -import Network.TypedProtocol.Pipelined +import Network.TypedProtocol + ( natToInt + ) + +import Network.TypedProtocol.Core ( N (..) , Nat (..) - , natToInt ) import Numeric.Natural ( Natural diff --git a/lib/primitive/cardano-wallet-primitive.cabal b/lib/primitive/cardano-wallet-primitive.cabal index 8e6d41b900b..1c3b74d4f82 100644 --- a/lib/primitive/cardano-wallet-primitive.cabal +++ b/lib/primitive/cardano-wallet-primitive.cabal @@ -46,22 +46,22 @@ library , binary , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api:{cardano-api, internal} >= 10.1.0.0 && < 10.2 + , cardano-api:{cardano-api, internal} >= 10.8.0.0 && < 10.9 , cardano-binary >= 1.7.1.0 && < 1.8 , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 , cardano-crypto-wrapper , cardano-data >= 1.2.3.1 && < 1.3 - , cardano-ledger-allegra >= 1.6.0.1 && < 1.7 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-babbage >= 1.10.0.0 && < 1.11 + , cardano-ledger-allegra >= 1.6.1.0 && < 1.7 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-babbage >= 1.10.1.0 && < 1.11 , cardano-ledger-binary - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-conway >= 1.17.3.0 && < 1.18 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-mary >= 1.7.0.1 && < 1.8 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-conway >= 1.18.1.0 && < 1.19 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-mary >= 1.7.1.0 && < 1.8 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-numeric , cardano-protocol-tpraos , cardano-slotting >= 0.2.0.0 && < 0.3 @@ -94,11 +94,11 @@ library , network-uri , nothunks , OddWord - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-consensus-protocol >= 0.9.0.2 && < 0.10 - , ouroboros-network >= 0.17.1.2 && < 0.18 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-consensus-protocol >= 0.10.0.0 && < 0.11 + , ouroboros-network >= 0.19.0.3 && < 0.20 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , pretty-simple , QuickCheck , quiet @@ -229,12 +229,12 @@ test-suite test , binary , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-allegra:{testlib} >= 1.6.0.1 && < 1.7 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.15.0.0 && < 1.16 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-allegra:{testlib} >= 1.6.1.0 && < 1.7 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.16.0.0 && < 1.17 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-numeric , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-wallet-primitive:cardano-wallet-primitive @@ -253,9 +253,9 @@ test-suite test , iohk-monitoring >= 0.2.0.0 && < 0.3 , lens , memory - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , QuickCheck , quickcheck-classes , quickcheck-instances diff --git a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs index 1cea5402504..dd6ca42c988 100644 --- a/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs +++ b/lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs @@ -70,6 +70,8 @@ module Cardano.Wallet.Primitive.Ledger.Shelley , fromShelleyTxIn , toCardanoPolicyId , toCardanoSimpleScript + , toCardanoAssetId + , toCardanoAssetName -- ** Stake pools , fromPoolId @@ -142,7 +144,7 @@ import Cardano.Ledger.BaseTypes import Cardano.Ledger.Binary ( EncCBORGroup ) -import Cardano.Ledger.Era +import Cardano.Ledger.Core ( Era (..) , TxSeq ) @@ -340,6 +342,7 @@ import qualified Data.Map.Strict as Map import qualified Data.Percentage as Percentage import qualified Data.Set as Set import qualified GHC.IsList as GHC +import qualified GHC.IsList as IsList import qualified Ouroboros.Consensus.Protocol.Praos as Consensus import qualified Ouroboros.Consensus.Protocol.Praos.Header as Consensus import qualified Ouroboros.Consensus.Protocol.TPraos as Consensus @@ -381,7 +384,8 @@ emptyGenesis gp = W.Block -- | The protocol client version. Distinct from the codecs version. nodeToClientVersions :: [NodeToClientVersion] -nodeToClientVersions = [NodeToClientV_15, NodeToClientV_16] +nodeToClientVersions = + [NodeToClientV_16, NodeToClientV_17] -------------------------------------------------------------------------------- -- @@ -786,10 +790,11 @@ cardanoCertKeysForWitnesses -> [W.RewardAccount] cardanoCertKeysForWitnesses = \case Cardano.TxCertificatesNone -> [] - Cardano.TxCertificates _era certs _witsMap -> + Cardano.TxCertificates _era certs -> map toRewardAccount - $ mapMaybe Cardano.selectStakeCredentialWitness certs - where + $ mapMaybe (Cardano.selectStakeCredentialWitness . fst) + $ IsList.toList certs + where toRewardAccount = fromStakeCredential . Cardano.toShelleyStakeCredential toShelleyCoin :: W.Coin -> SL.Coin @@ -898,10 +903,10 @@ toCardanoTxOut era refScriptM = case era of [ Cardano.AddressInEra (Cardano.ShelleyAddressInEra Cardano.ShelleyBasedEraBabbage) <$> eitherToMaybe - (Cardano.deserialiseFromRawBytes AsShelleyAddress addr) + (Cardano.deserialiseFromRawBytes (AsAddress AsShelleyAddr) addr) , Cardano.AddressInEra Cardano.ByronAddressInAnyEra <$> eitherToMaybe - (Cardano.deserialiseFromRawBytes AsByronAddress addr) + (Cardano.deserialiseFromRawBytes (AsAddress AsByronAddr) addr) ] toConwayTxOut :: HasCallStack => W.TxOut -> Cardano.TxOut ctx ConwayEra @@ -928,27 +933,32 @@ toCardanoTxOut era refScriptM = case era of [ Cardano.AddressInEra (Cardano.ShelleyAddressInEra Cardano.ShelleyBasedEraConway) <$> eitherToMaybe - (Cardano.deserialiseFromRawBytes AsShelleyAddress addr) + (Cardano.deserialiseFromRawBytes (AsAddress AsShelleyAddr) addr) , Cardano.AddressInEra Cardano.ByronAddressInAnyEra <$> eitherToMaybe - (Cardano.deserialiseFromRawBytes AsByronAddress addr) + (Cardano.deserialiseFromRawBytes (AsAddress AsByronAddr) addr) ] +toCardanoAssetId :: W.AssetId -> Cardano.AssetId +toCardanoAssetId (W.AssetId pid name) = + Cardano.AssetId (toCardanoPolicyId pid) (toCardanoAssetName name) + +toCardanoAssetName :: W.AssetName -> Cardano.AssetName +toCardanoAssetName (W.UnsafeAssetName name) = + just + "toCardanoValue" + "AssetName" + [ eitherToMaybe + $ Cardano.deserialiseFromRawBytes Cardano.AsAssetName name + ] + toCardanoValue :: TokenBundle.TokenBundle -> Cardano.Value toCardanoValue tb = GHC.fromList $ (Cardano.AdaAssetId, coinToQuantity coin) : map (bimap toCardanoAssetId toQuantity) bundle where (coin, bundle) = TokenBundle.toFlatList tb - toCardanoAssetId (W.AssetId pid name) = - Cardano.AssetId (toCardanoPolicyId pid) (toCardanoAssetName name) - - toCardanoAssetName (W.UnsafeAssetName name) = - just "toCardanoValue" "AssetName" - [ eitherToMaybe - $ Cardano.deserialiseFromRawBytes Cardano.AsAssetName name - ] coinToQuantity = fromIntegral . W.unCoin toQuantity = fromIntegral . W.unTokenQuantity @@ -1013,7 +1023,7 @@ rewardAccountFromAddress :: W.Address -> Maybe W.RewardAccount rewardAccountFromAddress (W.Address bytes) = refToAccount . ref =<< parseAddr bytes where parseAddr :: ByteString -> Maybe (Cardano.Address Cardano.ShelleyAddr) - parseAddr = eitherToMaybe . Cardano.deserialiseFromRawBytes AsShelleyAddress + parseAddr = eitherToMaybe . Cardano.deserialiseFromRawBytes (AsAddress AsShelleyAddr) ref :: Cardano.Address Cardano.ShelleyAddr -> SL.StakeReference StandardCrypto ref (Cardano.ShelleyAddress _n _paymentKey stakeRef) = stakeRef diff --git a/lib/unit/cardano-wallet-unit.cabal b/lib/unit/cardano-wallet-unit.cabal index 91e87d0f1a6..12f799fdd0e 100644 --- a/lib/unit/cardano-wallet-unit.cabal +++ b/lib/unit/cardano-wallet-unit.cabal @@ -44,7 +44,7 @@ library test-common build-depends: , base , bytestring - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-balance-tx , cardano-balance-tx:internal , cardano-wallet @@ -74,17 +74,17 @@ test-suite unit , bech32-th , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api >= 10.1.0.0 && < 10.2 + , cardano-api >= 10.8.0.0 && < 10.9 , cardano-api-extra - , cardano-api:internal >= 10.1.0.0 && < 10.2 + , cardano-api:internal >= 10.8.0.0 && < 10.9 , cardano-balance-tx , cardano-balance-tx:internal , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 - , cardano-ledger-alonzo >= 1.11.0.0 && < 1.12 - , cardano-ledger-babbage >= 1.10.0.0 && < 1.11 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 - , cardano-ledger-shelley >= 1.14.1.0 && < 1.15 + , cardano-ledger-alonzo >= 1.12.0.0 && < 1.13 + , cardano-ledger-babbage >= 1.10.1.0 && < 1.11 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 + , cardano-ledger-shelley >= 1.15.0.0 && < 1.16 , cardano-sl-x509 , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-wallet @@ -104,7 +104,7 @@ test-suite unit , containers , contra-tracer , crypto-primitives - , data-default + , data-default >= 0.8.0.0 && < 0.9 , data-interval , deepseq , delta-store @@ -128,7 +128,7 @@ test-suite unit , http-media , http-types , int-cast - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , io-sim , iohk-monitoring >= 0.2.0.0 && < 0.3 , iohk-monitoring-extra @@ -146,9 +146,9 @@ test-suite unit , OddWord , openapi3 , optparse-applicative - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-network >= 0.17.1.2 && < 0.18 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-network >= 0.19.0.3 && < 0.20 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , pathtype , persistent , persistent-sqlite diff --git a/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs b/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs index eea920322e1..f59aee0f81f 100644 --- a/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs +++ b/lib/unit/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs @@ -880,10 +880,8 @@ prop_signTransaction_neverChangesTxBody :: InAnyCardanoEra Cardano.Tx -> InAnyCardanoEra (Cardano.TxBodyContent Cardano.ViewTx) txBodyContent - (InAnyCardanoEra e - (Cardano.Tx (Cardano.TxBody bodyContent) _wits) - ) = - InAnyCardanoEra e bodyContent + (InAnyCardanoEra e (Cardano.Tx body _wits)) = + InAnyCardanoEra e $ Cardano.getTxBodyContent body bodyContentBefore = txBodyContent $ cardanoTx sealedTx bodyContentAfter = txBodyContent $ cardanoTx sealedTx' diff --git a/lib/wallet/cardano-wallet.cabal b/lib/wallet/cardano-wallet.cabal index 154694f429b..c50c0a1d430 100644 --- a/lib/wallet/cardano-wallet.cabal +++ b/lib/wallet/cardano-wallet.cabal @@ -41,6 +41,7 @@ library import: language, opts-lib hs-source-dirs: src ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates + build-tool-depends: alex:alex build-depends: , address-derivation-discovery , aeson @@ -48,16 +49,16 @@ library , base , bytestring , cardano-addresses >= 3.12.0 && < 3.13 - , cardano-api:{cardano-api, internal} >= 10.1.0.0 && < 10.2 + , cardano-api:{cardano-api, internal} >= 10.8.0.0 && < 10.9 , cardano-balance-tx:{cardano-balance-tx, internal} , cardano-binary >= 1.7.1.0 && < 1.8 , cardano-crypto >= 1.1.2 && < 1.2 , cardano-crypto-class >= 2.1.5.0 && < 2.2 , cardano-crypto-wrapper - , cardano-ledger-allegra >= 1.6.0.1 && < 1.7 - , cardano-ledger-api >= 1.9.4.0 && < 1.10 - , cardano-ledger-byron >= 1.0.1.0 && < 1.1 - , cardano-ledger-core >= 1.15.0.0 && < 1.16 + , cardano-ledger-allegra >= 1.6.1.0 && < 1.7 + , cardano-ledger-api >= 1.10.0.0 && < 1.11 + , cardano-ledger-byron >= 1.0.2.0 && < 1.1 + , cardano-ledger-core >= 1.16.0.0 && < 1.17 , cardano-slotting >= 0.2.0.0 && < 0.3 , cardano-strict-containers >= 0.1.3.0 && < 0.2 , cardano-wallet-launcher @@ -89,7 +90,7 @@ library , http-client-tls , http-types , int-cast - , io-classes + , io-classes >= 1.5.0.0 && < 1.6 , iohk-monitoring >= 0.2.0.0 && < 0.3 , iohk-monitoring-extra , lens @@ -104,10 +105,11 @@ library , ntp-client , OddWord , optparse-applicative - , ouroboros-consensus >= 0.21.0.0 && < 0.22 - , ouroboros-consensus-cardano >= 0.20.0.0 && < 0.21 - , ouroboros-network >= 0.17.1.2 && < 0.18 - , ouroboros-network-api >= 0.10.0.0 && < 0.11 + , ordered-containers + , ouroboros-consensus >= 0.22.0.0 && < 0.23 + , ouroboros-consensus-cardano >= 0.21.0.1 && < 0.22 + , ouroboros-network >= 0.19.0.3 && < 0.20 + , ouroboros-network-api >= 0.12.0.0 && < 0.13 , path-pieces , persistent , persistent-sqlite diff --git a/lib/wallet/src/Cardano/Wallet.hs b/lib/wallet/src/Cardano/Wallet.hs index efef7275eb4..369a9a339c3 100644 --- a/lib/wallet/src/Cardano/Wallet.hs +++ b/lib/wallet/src/Cardano/Wallet.hs @@ -25,6 +25,8 @@ -- suppress false warning {-# OPTIONS_GHC -Wno-redundant-constraints #-} {-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} +{-# HLINT ignore "Avoid NonEmpty.unzip" #-} -- | -- Copyright: © 2018-2020 IOHK @@ -2028,9 +2030,15 @@ buildCoinSelectionForTransaction _ -> Nothing } where - Cardano.TxBody Cardano.TxBodyContent - { txIns, txOuts, txInsCollateral, txWithdrawals } = - Cardano.getTxBody $ Write.toCardanoApiTx tx + Cardano.TxBodyContent + { txIns + , txOuts + , txInsCollateral + , txWithdrawals + } = + Cardano.getTxBodyContent + $ Cardano.getTxBody + $ Write.toCardanoApiTx tx resolveInput txIn = do (txOut, derivationPath) <- maybeToList (lookupTxIn wallet txIn) diff --git a/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs b/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs index 8d30f270a57..4a71351a0d5 100644 --- a/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs +++ b/lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs @@ -12,6 +12,7 @@ {-# LANGUAGE NumericUnderscores #-} {-# LANGUAGE OverloadedLabels #-} {-# LANGUAGE Rank2Types #-} +{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} @@ -19,11 +20,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-unused-imports #-} -{-# OPTIONS_GHC -Wno-unused-matches #-} -{-# OPTIONS_GHC -Wno-redundant-constraints #-} -{-# OPTIONS_GHC -Wno-unused-local-binds #-} -{-# LANGUAGE RecordWildCards #-} {- HLINT ignore "Use <$>" -} {- HLINT ignore "Use camelCase" -} @@ -71,7 +67,6 @@ import Cardano.Api ( AnyCardanoEra (..) , InAnyCardanoEra (..) , NetworkId - , ShelleyBasedEra (..) ) import Cardano.Binary ( serialize' @@ -111,20 +106,17 @@ import Cardano.Wallet.Primitive.Ledger.Shelley ( cardanoCertKeysForWitnesses , fromCardanoAddress , fromCardanoWdrls + , toCardanoAssetName , toCardanoLovelace , toCardanoPolicyId , toCardanoSimpleScript , toCardanoStakeCredential , toCardanoTxIn , toCardanoTxOut - , toCardanoValue ) import Cardano.Wallet.Primitive.Passphrase ( Passphrase (..) ) -import Cardano.Wallet.Primitive.Types - ( Certificate - ) import Cardano.Wallet.Primitive.Types.Address ( Address (..) ) @@ -171,7 +163,6 @@ import Cardano.Wallet.Primitive.Types.Tx.TxOut import Cardano.Wallet.Transaction ( AnyExplicitScript (..) , AnyScript (..) - , DelegationAction (..) , ErrMkTransaction (..) , ErrMkTransactionOutputTokenQuantityExceedsLimitError (..) , PreSelection (..) @@ -181,7 +172,6 @@ import Cardano.Wallet.Transaction , TokenMapWithScripts , TransactionCtx (..) , TransactionLayer (..) - , ValidityIntervalExplicit , Withdrawal (..) , WitnessCount (..) , WitnessCountCtx (..) @@ -193,9 +183,6 @@ import Cardano.Wallet.Transaction.Delegation import Cardano.Wallet.Transaction.Voting ( certificateFromVotingAction ) -import Cardano.Wallet.Util - ( HasCallStack - ) import Cardano.Write.Eras ( CardanoApiEra , RecentEra (..) @@ -212,11 +199,9 @@ import Control.Monad , guard , when ) -import Data.Bifunctor - ( bimap - ) import Data.Functor ( ($>) + , (<&>) ) import Data.Generics.Internal.VL.Lens ( view @@ -257,12 +242,10 @@ import qualified Cardano.Api as Cardano import qualified Cardano.Api.Byron as Byron import qualified Cardano.Api.Error as Cardano import qualified Cardano.Api.Shelley as Cardano -import qualified Cardano.Chain.Common as Byron import qualified Cardano.Crypto as CC import qualified Cardano.Crypto.Hash.Class as Crypto import qualified Cardano.Crypto.Wallet as Crypto.HD import qualified Cardano.Ledger.Api as Ledger -import qualified Cardano.Ledger.Coin as Ledger import qualified Cardano.Ledger.Keys.Bootstrap as SL import qualified Cardano.Wallet.Primitive.Ledger.Convert as Convert import qualified Cardano.Wallet.Primitive.Ledger.Shelley as Compatibility @@ -278,6 +261,7 @@ import qualified Data.ByteString as BS import qualified Data.Foldable as F import qualified Data.List as L import qualified Data.Map as Map +import qualified Data.Map.Ordered.Strict as OMap import qualified Data.Set as Set import qualified Data.Text as T import qualified Internal.Cardano.Write.Tx as Write @@ -486,8 +470,7 @@ signTransaction , mapMaybe mkStakingScriptWitness stakingScriptsKeyHashes ] where - Cardano.TxBody bodyContent = body - + bodyContent = Cardano.getTxBodyContent body inputs = [ Compatibility.fromCardanoTxIn i | (i, _) <- Cardano.txIns bodyContent @@ -893,10 +876,9 @@ mkUnsignedTx , Cardano.txCertificates = case stakingScriptM of Nothing -> let - witPair = [] - ctx = Cardano.BuildTxWith witPair - in - Cardano.TxCertificates shelleyEra certs ctx + ctx = Cardano.BuildTxWith Nothing + in Cardano.TxCertificates shelleyEra $ OMap.fromList $ + certs <&> (, ctx) Just stakingScript -> let buildKey = @@ -908,10 +890,11 @@ mkUnsignedTx Cardano.ScriptWitness Cardano.ScriptWitnessForStakeAddr (toScriptWitness stakingScript) - witPair = [(buildKey, buildVal)] + witPair = Just (buildKey, buildVal) ctx = Cardano.BuildTxWith witPair in - Cardano.TxCertificates shelleyEra certs ctx + Cardano.TxCertificates shelleyEra $ OMap.fromList $ + certs <&> (, ctx) , Cardano.txFee = Cardano.TxFeeExplicit shelleyEra fees @@ -937,25 +920,29 @@ mkUnsignedTx Cardano.TxUpdateProposalNone , Cardano.txMintValue = - let mintValue = toCardanoValue (TokenBundle (Coin 0) mintData) - burnValue = - Cardano.negateValue $ - toCardanoValue (TokenBundle (Coin 0) burnData) - toScriptWitnessGeneral = \case + let toScriptWitnessGeneral = \case Left script -> toScriptWitness script Right (ReferenceInput txin) -> - Cardano.SimpleScriptWitness - scriptWitsSupported $ - Cardano.SReferenceScript - (toCardanoTxIn txin) - Nothing - witMap = - Map.map toScriptWitnessGeneral $ - Map.mapKeys - (toCardanoPolicyId . AssetId.policyId) - mintingSource - ctx = Cardano.BuildTxWith witMap - in Cardano.TxMintValue maryOnwards (mintValue <> burnValue) ctx + Cardano.SimpleScriptWitness scriptWitsSupported + $ Cardano.SReferenceScript + $ toCardanoTxIn txin + collect burn (assetId, TokenQuantity q) = do + scriptSource <- case Map.lookup assetId mintingSource of + Just script -> pure + $ Cardano.BuildTxWith + $ toScriptWitnessGeneral script + Nothing -> [] + pure $ Map.singleton + ( toCardanoPolicyId . AssetId.policyId $ assetId) + [ (toCardanoAssetName $ assetName assetId + , (if burn then negate else id) $ fromIntegral q + , scriptSource + ) + ] + in Cardano.TxMintValue maryOnwards + $ Map.unionsWith (<>) + $ (TokenMap.toFlatList mintData >>= collect False) + <> (TokenMap.toFlatList burnData >>= collect True) , Cardano.txProposalProcedures = Nothing @@ -963,7 +950,6 @@ mkUnsignedTx Nothing , txCurrentTreasuryValue = Nothing , txTreasuryDonation = Nothing - , txSupplementalData = Cardano.BuildTxWith Cardano.TxSupplementalDataNone } where era = Write.recentEra @era @@ -1266,8 +1252,7 @@ txConstraints protocolParams witnessTag = TxConstraints nullByte = 0 mkLedgerTxOut - :: HasCallStack - => Address + :: Address -> TokenBundle -> Write.TxOut era mkLedgerTxOut address bundle = diff --git a/nix/haskell.nix b/nix/haskell.nix index d905f94aa7d..ac0da64cd09 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -98,7 +98,7 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: mithrilPkgs: haskell-nix.cabalProje # this is a local variable, it controls only the index-state of the # tools - indexState = "2024-08-20T21:35:22Z"; + indexState = "2025-01-01T23:24:19Z"; localClusterConfigs = config.src + /lib/local-cluster/test/data/cluster-configs; diff --git a/run/common/docker/run.sh b/run/common/docker/run.sh index af5f74de6b9..b37f05fbc1f 100755 --- a/run/common/docker/run.sh +++ b/run/common/docker/run.sh @@ -29,7 +29,7 @@ RELEASE_WALLET_TAG=2025.3.4 WALLET_TAG=${WALLET_TAG:=$RELEASE_WALLET_TAG} export WALLET_TAG -NODE_TAG=10.1.4 +NODE_TAG=10.2.1 export NODE_TAG # Generate a random port for the wallet service and export it diff --git a/scripts/bump-constraints.sh b/scripts/bump-constraints.sh index df02dedb68a..86d0bcb6650 100755 --- a/scripts/bump-constraints.sh +++ b/scripts/bump-constraints.sh @@ -7,6 +7,7 @@ updates=( "cardano-addresses" "cardano-api" "cardano-binary" + "cardano-cli" "cardano-crypto-class" "cardano-crypto-test" "cardano-crypto" @@ -25,8 +26,12 @@ updates=( "cardano-ledger-shelley" "cardano-slotting" "cardano-strict-containers" + "data-default" + "io-classes" "iohk-monitoring" + "katip" "lobemo-backend-ekg" + "network-mux" "ouroboros-consensus-cardano" "ouroboros-consensus-diffusion" "ouroboros-consensus-protocol" @@ -35,6 +40,7 @@ updates=( "ouroboros-network-framework" "ouroboros-network-protocols" "ouroboros-network" + "typed-protocols" ) freeze_file="$1" @@ -63,6 +69,10 @@ generate_constraint() { for update in "${updates[@]}"; do version=$(sed -n "s/.*any\.$update ==\([0-9.]*\),.*/\1/p" "$freeze_file") constraint=$(generate_constraint "$version") - echo "$update $constraint" - update_cabal_files "$update" "$constraint" + if [ -z "$version" ]; then + echo "Version for $update not found in $freeze_file" + else + echo "$update $constraint" + update_cabal_files "$update" "$constraint" + fi done diff --git a/scripts/release-candidate.sh b/scripts/release-candidate.sh index ded55d1f877..ab149b9aca5 100755 --- a/scripts/release-candidate.sh +++ b/scripts/release-candidate.sh @@ -34,7 +34,7 @@ echo "OLD_GIT_TAG=$OLD_GIT_TAG" OLD_CABAL_VERSION=$(tag_cabal_ver "$OLD_GIT_TAG") echo "OLD_CABAL_VERSION=$OLD_CABAL_VERSION" -CARDANO_NODE_TAG="10.1.4" +CARDANO_NODE_TAG="10.2.1" echo "CARDANO_NODE_TAG=$CARDANO_NODE_TAG" git checkout "$BASE_COMMIT" diff --git a/scripts/start-10.2.1.sh b/scripts/start-10.2.1.sh new file mode 100644 index 00000000000..586ed16d601 --- /dev/null +++ b/scripts/start-10.2.1.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -euo pipefail + +current_dir=$(pwd) +tmp=$(mktemp -d) + +cleanup() { + echo "Cleaning up..." + cd "$current_dir" || exit + rm -rf "$tmp" +} + +trap cleanup EXIT +cd "$tmp" || exit + +base_url="https://book.play.dev.cardano.org/environments-pre/preprod" + +curl "$base_url/config.json" >config.json +curl "$base_url/conway-genesis.json" >conway-genesis.json +curl "$base_url/topology.json" >topology.json +curl "$base_url/byron-genesis.json" >byron-genesis.json +curl "$base_url/shelley-genesis.json" >shelley-genesis.json +curl "$base_url/alonzo-genesis.json" >alonzo-genesis.json + +cat config.json + +# cp "$current_dir"/configs/cardano/pre-preprod/config.json . +# cp "$current_dir"/lib/local-cluster/test/data/cluster-configs/template/config.json . + +# diff "$current_dir"/configs/cardano/pre-preprod/config.json config.json + + +mkdir -p node-db +nix shell "github:IntersectMBO/cardano-node?ref=10.2.1" -c \ + cardano-node version +nix shell "github:IntersectMBO/cardano-node?ref=10.2.1" -c \ + cardano-node run \ + --config config.json \ + --topology topology.json \ + --database-path node-db \ + --socket-path node-socket