From af566dd13e961d0bdf0b80642b2083cdb826cf17 Mon Sep 17 00:00:00 2001 From: koslambrou Date: Fri, 12 Aug 2022 06:12:22 -0400 Subject: [PATCH] Upgraded to a cardano-wallet compatible with node 1.35.3-rc1 (#657) * Reorganized dependencies based on cardano-wallet's cabal.project * Added the new 'protocolParamUTxOCostPerByte' in 'Ledger.Params' which replaces 'protocolParamUTxOCostPerWord' * Fixed the `Plutus.Contract.Wallet.mkMintingRedeemers` which triggered an error if the redeemers in the tx contained spending redeemers. --- cabal.project | 392 +++++++++--------- nix/pkgs/haskell/sha256map.nix | 15 +- plutus-contract/src/Plutus/Contract/Wallet.hs | 11 +- .../Direct/CertifyingAndWithdrawingPlutus.hs | 3 +- .../Direct/ScriptContextEquality.hs | 5 +- .../Direct/ScriptContextEqualityMint.hs | 5 +- .../PlutusExample/Direct/TxInLockingPlutus.hs | 1 + .../PlutusExample/Script/TxInLockingPlutus.hs | 1 + .../SubmitApi/TxInLockingPlutus.hs | 5 +- plutus-ledger/src/Ledger/Params.hs | 6 +- plutus-pab/src/Plutus/PAB/LocalCluster/Run.hs | 3 +- .../scripts/protocol-parameters.json | 5 +- 12 files changed, 234 insertions(+), 218 deletions(-) diff --git a/cabal.project b/cabal.project index a5253beee5..2d20c78f6e 100644 --- a/cabal.project +++ b/cabal.project @@ -8,7 +8,7 @@ packages: doc plutus-chain-index-core plutus-contract plutus-example - plutus-hysterical-screams + plutus-hysterical-screams plutus-contract-certification plutus-ledger plutus-ledger-constraints @@ -82,27 +82,106 @@ package cardano-wallet-core-integration optimization: False -- Direct dependency. --- Are you thinking of updating this tag to some other commit? --- Please ensure that the commit you are about to use is the latest one from --- the *develop* branch of this repo: --- * --- (not master!) +-- 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. -- --- In particular we rely on the code from this PR: --- * --- being merged. +-- The current version is dated 2022/08/10 +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-wallet + tag: 18a931648550246695c790578d4a55ee2f10463e + 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/text-class + +-- Direct dependency. +source-repository-package + type: git + location: https://github.com/input-output-hk/servant-purescript + tag: 44e7cacf109f84984cd99cd3faf185d161826963 + +-- Direct dependency. +source-repository-package + type: git + location: https://github.com/input-output-hk/purescript-bridge + tag: 47a1f11825a0f9445e0f98792f79172efef66c00 + +-- Direct dependency. +-- Temporary indexing +source-repository-package + type: git + location: https://github.com/raduom/hysterical-screams + tag: 4c523469e9efd3f0d10d17da3304923b7b0e0674 + +-- Direct dependency. +source-repository-package + type: git + location: https://github.com/input-output-hk/quickcheck-dynamic + tag: c272906361471d684440f76c297e29ab760f6a1e + +-- TODO This is a compatibility shim to make it easier for our library dependencies to +-- be compatible with both aeson 1 & 2. Once downstream projects are all upgraded to +-- work with aeson-2, library dependencies will need to be updated to no longer use +-- this compatibility shim and have bounds to indicate they work with aeson-2 only. +-- After this, the dependency to hw-aeson can be dropped. +source-repository-package + type: git + location: https://github.com/sevanspowell/hw-aeson + tag: b5ef03a7d7443fcd6217ed88c335f0c411a05408 + +-- Using a fork until our patches can be merged upstream source-repository-package type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - tag: 066f7002aac5a0efc20e49643fea45454f226caa - subdir: - contra-tracer - iohk-monitoring - tracer-transformers - plugins/backend-ekg - plugins/backend-aggregation - plugins/backend-monitoring - plugins/backend-trace-forwarder + location: https://github.com/input-output-hk/optparse-applicative + tag: 7497a29cb998721a9068d5725d49461f2bba0e7a + +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/Win32-network + tag: 3825d3abf75f83f406c1f7161883c438dac7277d + +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-addresses + tag: b7273a5d3c21f1a003595ebf1e1f79c28cd72513 + subdir: command-line + core + +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-base + tag: 0f3a867493059e650cda69e20a5cbf1ace289a57 + subdir: + base-deriving-via + binary + binary/test + cardano-crypto-class + cardano-crypto-praos + cardano-crypto-tests + orphans-deriving-via + measures + strict-containers + slotting + +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-crypto + tag: f73079303f663e028288f9f4a9e08bcca39a923e -- Should follow cardano-node. -- But in case there are failures with the plutus version, update to the latest @@ -126,130 +205,114 @@ source-repository-package location: https://github.com/input-output-hk/ekg-forward tag: 297cd9db5074339a2fb2e5ae7d0780debb670c63 --- Should follow plutus. -source-repository-package - type: git - location: https://github.com/Quid2/flat - tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 - --- Direct dependency. -source-repository-package - type: git - location: https://github.com/input-output-hk/servant-purescript - tag: 44e7cacf109f84984cd99cd3faf185d161826963 - --- Direct dependency. +-- Should follow cardano-node source-repository-package type: git - location: https://github.com/input-output-hk/purescript-bridge - tag: 47a1f11825a0f9445e0f98792f79172efef66c00 + location: https://github.com/input-output-hk/cardano-config + tag: 1646e9167fab36c0bff82317743b96efa2d3adaa --- 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/07/11 +-- Should follow cardano-wallet. source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-wallet - tag: 5c77b286a412fb3795bdf8755888d0c4236d648c - 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/text-class + type: git + location: https://github.com/input-output-hk/cardano-ledger + tag: c7c63dabdb215ebdaed8b63274965966f2bf408f + 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 -- Should follow cardano-wallet. -- More precisally, this should be a version compatible with the current -- Cardano mainnet (>=1.35). --- Current version is dated to 2022/06/25. -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-node - tag: 1.35.3-rc1 - subdir: - cardano-api - cardano-cli - cardano-git-rev - cardano-node - cardano-submit-api - cardano-testnet - trace-dispatcher - trace-forward - trace-resources - source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-config - tag: 1646e9167fab36c0bff82317743b96efa2d3adaa + type: git + location: https://github.com/input-output-hk/cardano-node + tag: 1.35.3-rc1 + subdir: + cardano-api + cardano-git-rev + cardano-cli + cardano-node + cardano-submit-api + cardano-testnet + trace-dispatcher + trace-resources + trace-forward --- Using a fork until our patches can be merged upstream +-- Should follow cardano-wallet. source-repository-package - type: git - location: https://github.com/input-output-hk/optparse-applicative - tag: 7497a29cb998721a9068d5725d49461f2bba0e7a + type: git + location: https://github.com/input-output-hk/cardano-prelude + tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555 + subdir: cardano-prelude + cardano-prelude-test +-- Should follow cardano-wallet. source-repository-package - type: git - location: https://github.com/input-output-hk/hedgehog-extras - tag: 967d79533c21e33387d0227a5f6cc185203fe658 + type: git + location: https://github.com/input-output-hk/goblins + tag: cde90a2b27f79187ca8310b6549331e59595e7ba --- Should follow cardano-wallet. +-- Direct dependency. +-- Are you thinking of updating this tag to some other commit? +-- Please ensure that the commit you are about to use is the latest one from +-- the *develop* branch of this repo: +-- * +-- (not master!) +-- +-- In particular we rely on the code from this PR: +-- * +-- being merged. source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-ledger - tag: c7c63dabdb215ebdaed8b63274965966f2bf408f - 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 + type: git + location: https://github.com/input-output-hk/iohk-monitoring-framework + tag: 066f7002aac5a0efc20e49643fea45454f226caa + subdir: contra-tracer + iohk-monitoring + plugins/backend-aggregation + plugins/backend-ekg + plugins/backend-monitoring + plugins/backend-trace-forwarder + plugins/scribe-systemd + tracer-transformers -- Should follow cardano-wallet. source-repository-package - type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: cb9eba406ceb2df338d8384b35c8addfe2067201 - subdir: - monoidal-synchronisation - network-mux - ntp-client - ouroboros-consensus - ouroboros-consensus-byron - ouroboros-consensus-cardano - ouroboros-consensus-protocol - ouroboros-consensus-shelley - ouroboros-network - ouroboros-network-framework - ouroboros-network-testing + type: git + location: https://github.com/input-output-hk/ouroboros-network + tag: cb9eba406ceb2df338d8384b35c8addfe2067201 + subdir: + monoidal-synchronisation + network-mux + ouroboros-consensus + ouroboros-consensus-byron + ouroboros-consensus-cardano + ouroboros-consensus-protocol + ouroboros-consensus-shelley + ouroboros-network + ouroboros-network-framework + ouroboros-network-testing + ntp-client -- Should follow cardano-node. source-repository-package @@ -271,84 +334,23 @@ source-repository-package typed-protocols-cborg typed-protocols-examples --- Should follow cardano-wallet. -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-base - tag: 0f3a867493059e650cda69e20a5cbf1ace289a57 - subdir: - base-deriving-via - binary - binary/test - cardano-crypto-class - cardano-crypto-praos - cardano-crypto-tests - measures - orphans-deriving-via - slotting - strict-containers - --- Should follow cardano-wallet. -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555 - subdir: - cardano-prelude - cardano-prelude-test - --- Should follow cardano-wallet. -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-crypto - tag: f73079303f663e028288f9f4a9e08bcca39a923e - --- Should follow cardano-wallet. -source-repository-package - type: git - location: https://github.com/input-output-hk/cardano-addresses - tag: b6f2f3cef01a399376064194fd96711a5bdba4a7 - subdir: - command-line - core - --- Should follow cardano-wallet. +-- Should follow plutus. +-- https://github.com/Quid2/flat/pull/22 fixes a potential exception +-- when decoding invalid (e.g. malicious) text literals. source-repository-package - type: git - location: https://github.com/input-output-hk/goblins - tag: cde90a2b27f79187ca8310b6549331e59595e7ba + type: git + location: https://github.com/Quid2/flat + tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 -- Should follow cardano-wallet. -source-repository-package - type: git - location: https://github.com/input-output-hk/Win32-network - tag: 3825d3abf75f83f406c1f7161883c438dac7277d - -- Until https://github.com/tibbe/ekg-json/pull/12 gets merged with aeson2 support source-repository-package type: git location: https://github.com/vshabanov/ekg-json tag: 00ebe7211c981686e65730b7144fbf5350462608 --- TODO This is a compatibility shim to make it easier for our library dependencies to --- be compatible with both aeson 1 & 2. Once downstream projects are all upgraded to --- work with aeson-2, library dependencies will need to be updated to no longer use --- this compatibility shim and have bounds to indicate they work with aeson-2 only. --- After this, the dependency to hw-aeson can be dropped. -source-repository-package - type: git - location: https://github.com/haskell-works/hw-aeson - tag: d99d2f3e39a287607418ae605b132a3deb2b753f - --sha256: 1vxqcwjg9q37wbwi27y9ba5163lzfz51f1swbi0rp681yg63zvn4 - --- Temporary indexing +-- Should follow cardano-wallet source-repository-package type: git - location: https://github.com/raduom/hysterical-screams - tag: 4c523469e9efd3f0d10d17da3304923b7b0e0674 - -source-repository-package - type: git - location: https://github.com/input-output-hk/quickcheck-dynamic - tag: c272906361471d684440f76c297e29ab760f6a1e - + location: https://github.com/input-output-hk/hedgehog-extras + tag: 714ee03a5a786a05fc57ac5d2f1c2edce4660d85 diff --git a/nix/pkgs/haskell/sha256map.nix b/nix/pkgs/haskell/sha256map.nix index fabf26be62..f484bf5b6c 100644 --- a/nix/pkgs/haskell/sha256map.nix +++ b/nix/pkgs/haskell/sha256map.nix @@ -1,26 +1,27 @@ { + "https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm"; "https://github.com/input-output-hk/ekg-forward"."297cd9db5074339a2fb2e5ae7d0780debb670c63" = "1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g"; - "https://github.com/input-output-hk/cardano-addresses"."b6f2f3cef01a399376064194fd96711a5bdba4a7" = "10yj47gay72kx6v564qlfiigggcpqfdzrg61ii8p25m5n8ijz045"; + "https://github.com/input-output-hk/cardano-addresses"."b7273a5d3c21f1a003595ebf1e1f79c28cd72513" = "129r5kyiw10n2021bkdvnr270aiiwyq58h472d151ph0r7wpslgp"; "https://github.com/input-output-hk/cardano-base"."0f3a867493059e650cda69e20a5cbf1ace289a57" = "0p0az3sbkhb7njji8xxdrfb0yx2gc8fmrh872ffm8sfip1w29gg1"; "https://github.com/input-output-hk/cardano-config"."1646e9167fab36c0bff82317743b96efa2d3adaa" = "sha256-TNbpnR7llUgBN2WY7CryMxNVupBIUH01h1hRNHoxboY="; "https://github.com/input-output-hk/cardano-crypto"."f73079303f663e028288f9f4a9e08bcca39a923e" = "1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q"; "https://github.com/input-output-hk/cardano-ledger"."c7c63dabdb215ebdaed8b63274965966f2bf408f" = "sha256-zTQbMOGPD1Oodv6VUsfF6NUiXkbN8SWI98W3Atv4wbI="; - "https://github.com/input-output-hk/cardano-node"."1.35.3-rc1" = "01a5qdrmsag18s2mlf8axfbrag59j2fp6xyc89pwmzgs7x77ldsr"; + "https://github.com/input-output-hk/cardano-node"."1.35.3-rc1" = "020fwimsm24yblr1fmnwx240wj8r3x715p89cpjgnnd8axwf32p0"; "https://github.com/input-output-hk/cardano-prelude"."bb4ed71ba8e587f672d06edf9d2e376f4b055555" = "00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj"; - "https://github.com/input-output-hk/cardano-wallet"."5c77b286a412fb3795bdf8755888d0c4236d648c" = "sha256-lxpPV7TG40ilCaQzKBc+DqXPABTjkHJGxAo+TCLmNLk="; + "https://github.com/input-output-hk/cardano-wallet"."18a931648550246695c790578d4a55ee2f10463e" = "0i40hp1mdbljjcj4pn3n6zahblkb2jmpm8l4wnb36bya1pzf66fx"; "https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba" = "17c88rbva3iw82yg9srlxjv2ia5wjb9cyqw44hik565f5v9svnyg"; - "https://github.com/input-output-hk/hedgehog-extras"."967d79533c21e33387d0227a5f6cc185203fe658" = "0rbqb7a64aya1qizlr3im06hdydg9zr6sl3i8bvqqlf7kpa647sd"; + "https://github.com/input-output-hk/hedgehog-extras"."714ee03a5a786a05fc57ac5d2f1c2edce4660d85" = "1qa4mm36xynaf17990ijmzww0ij8hjrc0vw5nas6d0zx6q9hb978"; "https://github.com/input-output-hk/iohk-monitoring-framework"."066f7002aac5a0efc20e49643fea45454f226caa" = "0s6x4in11k5ba7nl7la896g28sznf9185xlqg9c604jqz58vj9nj"; "https://github.com/input-output-hk/io-sim"."57e888b1894829056cb00b7b5785fdf6a74c3271" = "sha256-TviSvCBEYtlKEo9qJmE8pCE25nMjDi8HeIAFniunaM8="; "https://github.com/input-output-hk/optparse-applicative"."7497a29cb998721a9068d5725d49461f2bba0e7a" = "1gvsrg925vynwgqwplgjmp53vj953qyh3wbdf34pw21c8r47w35r"; "https://github.com/input-output-hk/ouroboros-network"."cb9eba406ceb2df338d8384b35c8addfe2067201" = "066llskxzjgcs13lwlvklb28azb9kd9b77j61x8fvrj1rlf5njfw"; "https://github.com/input-output-hk/plutus"."a56c96598b4b25c9e28215214d25189331087244" = "sha256-coD/Kpl7tutwXb6ukQCH5XojBjquYkW7ob0BWZtdpok="; "https://github.com/input-output-hk/purescript-bridge"."47a1f11825a0f9445e0f98792f79172efef66c00" = "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px"; + "https://github.com/input-output-hk/quickcheck-dynamic"."c272906361471d684440f76c297e29ab760f6a1e" = "sha256-TioJQASNrQX6B3n2Cv43X2olyT67//CFQqcpvNW7N60="; "https://github.com/input-output-hk/servant-purescript"."44e7cacf109f84984cd99cd3faf185d161826963" = "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc"; "https://github.com/input-output-hk/typed-protocols"."181601bc3d9e9d21a671ce01e0b481348b3ca104" = "sha256-5Wof5yTKb12EPY6B8LfapX18xNZZpF+rvhnQ88U6KdM="; "https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx"; - "https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm"; - "https://github.com/vshabanov/ekg-json"."00ebe7211c981686e65730b7144fbf5350462608" = "sha256-VT8Ur585TCn03P2TVi6t92v2Z6tl8vKijICjse6ocv8="; "https://github.com/raduom/hysterical-screams"."4c523469e9efd3f0d10d17da3304923b7b0e0674" = "0w118v4vffrsjxfmwfv8qcn2qxmxpd1gxwcjnda91qz09jnpg0vp"; - "https://github.com/input-output-hk/quickcheck-dynamic"."c272906361471d684440f76c297e29ab760f6a1e" = "sha256-TioJQASNrQX6B3n2Cv43X2olyT67//CFQqcpvNW7N60="; + "https://github.com/sevanspowell/hw-aeson"."b5ef03a7d7443fcd6217ed88c335f0c411a05408" = "1dwx90wqavdl4d0npbzbxyh2pzi9zs1qz7nvsrb3n1cm2xbv4i5z"; + "https://github.com/vshabanov/ekg-json"."00ebe7211c981686e65730b7144fbf5350462608" = "sha256-VT8Ur585TCn03P2TVi6t92v2Z6tl8vKijICjse6ocv8="; } diff --git a/plutus-contract/src/Plutus/Contract/Wallet.hs b/plutus-contract/src/Plutus/Contract/Wallet.hs index f8ef8017a2..0a0bcf1f4e 100644 --- a/plutus-contract/src/Plutus/Contract/Wallet.hs +++ b/plutus-contract/src/Plutus/Contract/Wallet.hs @@ -39,7 +39,7 @@ import Data.Aeson.Types (Parser, parseFail) import Data.Bifunctor (first) import Data.Map (Map) import Data.Map qualified as Map -import Data.Maybe (mapMaybe) +import Data.Maybe (catMaybes, mapMaybe) import Data.OpenApi qualified as OpenApi import Data.Semigroup qualified as Semigroup import Data.Set qualified as Set @@ -288,9 +288,12 @@ mkSpendingRedeemers P.Tx{P.txInputs} = fmap join (traverse extract txInputs) whe extract _ = pure [] mkMintingRedeemers :: P.Tx -> Either CardanoAPI.ToCardanoError [ExportTxRedeemer] -mkMintingRedeemers P.Tx{P.txRedeemers, P.txMintScripts} = traverse extract $ Map.toList txRedeemers where +mkMintingRedeemers P.Tx{P.txRedeemers, P.txMintScripts} = + catMaybes <$> traverse extract (Map.toList txRedeemers) + where indexedMintScriptHashes = Map.fromList $ zip [0..] $ Map.keys txMintScripts extract (PV1.RedeemerPtr PV1.Mint idx, redeemer) = do redeemerPolicyId <- maybe (Left CardanoAPI.MissingMintingPolicy) Right (Map.lookup idx indexedMintScriptHashes) - pure MintingRedeemer{redeemer, redeemerPolicyId} - extract (PV1.RedeemerPtr tag _, _) = Left (CardanoAPI.ScriptPurposeNotSupported tag) + pure $ Just MintingRedeemer{redeemer, redeemerPolicyId} + -- Some other redeemer (like a spending redeemer) which is ignored + extract (PV1.RedeemerPtr _ _, _) = pure Nothing diff --git a/plutus-example/test/Test/PlutusExample/Direct/CertifyingAndWithdrawingPlutus.hs b/plutus-example/test/Test/PlutusExample/Direct/CertifyingAndWithdrawingPlutus.hs index 8fb9e968f0..9a3d1d4c85 100644 --- a/plutus-example/test/Test/PlutusExample/Direct/CertifyingAndWithdrawingPlutus.hs +++ b/plutus-example/test/Test/PlutusExample/Direct/CertifyingAndWithdrawingPlutus.hs @@ -40,6 +40,7 @@ import Hedgehog.Extras.Test.Process qualified as H import System.Info qualified as SYS import Test.Base qualified as H import Test.Process qualified as H +import Test.Runtime qualified as H import Testnet.Cardano (TestnetOptions (..), TestnetRuntime (..), defaultTestnetOptions, testnet) import Testnet.Cardano qualified as TC import Testnet.Conf qualified as H @@ -77,7 +78,7 @@ hprop_plutus_certifying_withdrawing = H.integration . H.runFinallies . H.workspa execConfig <- H.noteShow H.ExecConfig { H.execConfigEnv = Last $ Just $ - [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ TC.bftSprockets tr) + [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ H.bftSprockets tr) ] -- The environment must be passed onto child process on Windows in order to -- successfully start that process. diff --git a/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEquality.hs b/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEquality.hs index fe4fb327bd..a79540ea00 100644 --- a/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEquality.hs +++ b/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEquality.hs @@ -39,7 +39,8 @@ import Hedgehog.Extras.Test.Process qualified as H import System.Directory qualified as IO import Test.Base qualified as H import Test.Process qualified as H -import Testnet.Cardano (TestnetRuntime (..), bftSprockets, defaultTestnetOptions, testnet) +import Test.Runtime qualified as H +import Testnet.Cardano (TestnetRuntime (..), defaultTestnetOptions, testnet) import Testnet.Conf qualified as H {- HLINT ignore "Redundant <&>" -} @@ -69,7 +70,7 @@ hprop_plutus_script_context_equality = H.integration . H.runFinallies . H.worksp execConfig <- H.noteShow H.ExecConfig { H.execConfigEnv = Last $ Just $ - [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ bftSprockets tr) + [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ H.bftSprockets tr) ] -- The environment must be passed onto child process on Windows in order to -- successfully start that process. diff --git a/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEqualityMint.hs b/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEqualityMint.hs index 8442a88011..c763f0807d 100644 --- a/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEqualityMint.hs +++ b/plutus-example/test/Test/PlutusExample/Direct/ScriptContextEqualityMint.hs @@ -35,7 +35,8 @@ import System.FilePath (()) import Test.Base qualified as H import Test.Process (execCreateScriptContext, execCreateScriptContext') import Test.Process qualified as H -import Testnet.Cardano (bftSprockets, defaultTestnetOptions, testnet) +import Test.Runtime qualified as H +import Testnet.Cardano (defaultTestnetOptions, testnet) import Testnet.Cardano qualified as TC import Testnet.Conf qualified as H @@ -59,7 +60,7 @@ hprop_plutus_script_context_mint_equality = H.integration . H.runFinallies . H.w execConfig <- H.noteShow H.ExecConfig { H.execConfigEnv = Last $ Just $ - [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ bftSprockets tr) + [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ H.bftSprockets tr) ] -- The environment must be passed onto child process on Windows in order to -- successfully start that process. diff --git a/plutus-example/test/Test/PlutusExample/Direct/TxInLockingPlutus.hs b/plutus-example/test/Test/PlutusExample/Direct/TxInLockingPlutus.hs index 20c2824490..b9e63b10ec 100644 --- a/plutus-example/test/Test/PlutusExample/Direct/TxInLockingPlutus.hs +++ b/plutus-example/test/Test/PlutusExample/Direct/TxInLockingPlutus.hs @@ -42,6 +42,7 @@ import System.Directory qualified as IO import System.Environment qualified as IO import Test.Base qualified as H import Test.Process qualified as H +import Test.Runtime qualified as H import Testnet.Cardano qualified as H import Testnet.Conf qualified as H diff --git a/plutus-example/test/Test/PlutusExample/Script/TxInLockingPlutus.hs b/plutus-example/test/Test/PlutusExample/Script/TxInLockingPlutus.hs index 4019b361cd..472fe15eed 100644 --- a/plutus-example/test/Test/PlutusExample/Script/TxInLockingPlutus.hs +++ b/plutus-example/test/Test/PlutusExample/Script/TxInLockingPlutus.hs @@ -31,6 +31,7 @@ import System.Directory qualified as IO import System.Environment qualified as IO import Test.Base qualified as H import Test.Process qualified as H +import Test.Runtime qualified as H import Testnet.Cardano qualified as H import Testnet.Conf qualified as H diff --git a/plutus-example/test/Test/PlutusExample/SubmitApi/TxInLockingPlutus.hs b/plutus-example/test/Test/PlutusExample/SubmitApi/TxInLockingPlutus.hs index d1406f636a..9025fdcc50 100644 --- a/plutus-example/test/Test/PlutusExample/SubmitApi/TxInLockingPlutus.hs +++ b/plutus-example/test/Test/PlutusExample/SubmitApi/TxInLockingPlutus.hs @@ -42,6 +42,7 @@ import System.Environment qualified as IO import Test.Base qualified as Test import Test.Process qualified as H import Test.Process qualified as Test +import Test.Runtime qualified as H import Testnet.Cardano qualified as TN import Testnet.Conf qualified as TN import Testnet.SubmitApi qualified as TN @@ -73,7 +74,7 @@ prop_submit_api_spending_plutus_script = Test.integration . HE.runFinallies . HE execConfig <- H.noteShow H.ExecConfig { H.execConfigEnv = Last $ Just $ - [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ TN.bftSprockets tr) + [ ("CARDANO_NODE_SOCKET_PATH", IO.sprocketArgumentName $ head $ H.bftSprockets tr) ] -- The environment must be passed onto child process on Windows in order to -- successfully start that process. @@ -96,7 +97,7 @@ prop_submit_api_spending_plutus_script = Test.integration . HE.runFinallies . HE { TN.tempBaseAbsPath , TN.base , TN.configFile = submitApiConfigFile - , TN.sprocket = head $ TN.bftSprockets tr + , TN.sprocket = head $ H.bftSprockets tr , TN.testnetMagic , TN.stdoutFile = submitApiStdoutFile , TN.stderrFile = submitApiStderrFile diff --git a/plutus-ledger/src/Ledger/Params.hs b/plutus-ledger/src/Ledger/Params.hs index e8b3bdda66..bcfcf84b34 100644 --- a/plutus-ledger/src/Ledger/Params.hs +++ b/plutus-ledger/src/Ledger/Params.hs @@ -24,6 +24,7 @@ import Cardano.Api.Shelley (AnyPlutusScriptVersion (..), CostModel (..), EpochNo PlutusScriptVersion (..), ProtocolParameters (..), shelleyGenesisDefaults) import Cardano.Ledger.Babbage (BabbageEra) import Cardano.Ledger.Babbage.PParams (retractPP) +import Cardano.Ledger.Babbage.Translation (coinsPerUTxOWordToCoinsPerUTxOByte) import Cardano.Ledger.BaseTypes (boundRational) import Cardano.Ledger.Core (PParams) import Cardano.Ledger.Crypto (StandardCrypto) @@ -91,7 +92,7 @@ instance Default ProtocolParameters where , protocolParamPoolPledgeInfluence = 3 % 10 , protocolParamMonetaryExpansion = 3 % 1000 , protocolParamTreasuryCut = 1 % 5 - , protocolParamUTxOCostPerWord = Just (Lovelace 34482) + , protocolParamUTxOCostPerWord = Nothing -- Obsolete from babbage onwards , protocolParamCostModels = fromList [ (AnyPlutusScriptVersion PlutusScriptV1, CostModel $ fromMaybe (error "Ledger.Params: defaultCostModelParams is broken") defaultCostModelParams) , (AnyPlutusScriptVersion PlutusScriptV2, CostModel $ fromMaybe (error "Ledger.Params: defaultCostModelParams is broken") defaultCostModelParams) ] @@ -101,6 +102,9 @@ instance Default ProtocolParameters where , protocolParamMaxValueSize = Just 5000 , protocolParamCollateralPercent = Just 150 , protocolParamMaxCollateralInputs = Just 3 + , protocolParamUTxOCostPerByte = + let (Coin coinsPerUTxOByte) = coinsPerUTxOWordToCoinsPerUTxOByte $ Coin 34482 + in Just $ Lovelace coinsPerUTxOByte } diff --git a/plutus-pab/src/Plutus/PAB/LocalCluster/Run.hs b/plutus-pab/src/Plutus/PAB/LocalCluster/Run.hs index 3c5cd48468..002e7402ff 100644 --- a/plutus-pab/src/Plutus/PAB/LocalCluster/Run.hs +++ b/plutus-pab/src/Plutus/PAB/LocalCluster/Run.hs @@ -186,13 +186,12 @@ runWith userContractHandler = withLocalClusterSetup $ \dir lo@LogOutputs{loClust <$> getEKGURL void $ serveWallet - (NodeSource socketPath vData) + (NodeSource socketPath vData (SyncTolerance 10)) gp tunedForMainnetPipeliningStrategy (SomeNetworkDiscriminant $ Proxy @'Mainnet) poolCertificates tracers - (SyncTolerance 10) (Just db) Nothing (fromString walletHost) diff --git a/plutus-use-cases/scripts/protocol-parameters.json b/plutus-use-cases/scripts/protocol-parameters.json index d02f70ffbb..76464ece82 100644 --- a/plutus-use-cases/scripts/protocol-parameters.json +++ b/plutus-use-cases/scripts/protocol-parameters.json @@ -2,7 +2,8 @@ "txFeePerByte": 44, "minUTxOValue": null, "stakePoolDeposit": 500000000, - "utxoCostPerWord": 1, + "utxoCostPerWord": null, + "utxoCostPerByte": 4311, "decentralization": 0.6, "poolRetireMaxEpoch": 18, "extraPraosEntropy": null, @@ -205,4 +206,4 @@ "denominator": 1 } } -} \ No newline at end of file +}