From 6ba0aff7a3ea0493ef5031200c8f0d2249c7e3f2 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Fri, 16 Oct 2026 09:49:03 -0400 Subject: [PATCH 1/3] Pin cardano-ledger PR 6189 and adapt dependent interfaces --- .changes/20261016_cardano-cli_ledger_6189.yml | 5 ++ cabal.project | 69 ++++++++++++++++++- cardano-cli/cardano-cli.cabal | 6 +- cardano-cli/src/Cardano/CLI/Orphan.hs | 6 +- cardano-cli/src/Cardano/CLI/Type/Common.hs | 4 +- .../Test/Cli/Transaction/SubTransaction.hs | 10 +-- flake.nix | 22 ++++++ 7 files changed, 108 insertions(+), 14 deletions(-) create mode 100644 .changes/20261016_cardano-cli_ledger_6189.yml diff --git a/.changes/20261016_cardano-cli_ledger_6189.yml b/.changes/20261016_cardano-cli_ledger_6189.yml new file mode 100644 index 0000000000..6d40a3d83e --- /dev/null +++ b/.changes/20261016_cardano-cli_ledger_6189.yml @@ -0,0 +1,5 @@ +project: cardano-cli +pr: 0 +kind: + - bugfix +description: Pin cardano-ledger to PR 6189 to fix Plutus data decoding for required top-level guards. diff --git a/cabal.project b/cabal.project index cc4ec9ab5f..ab2fd6dccc 100644 --- a/cabal.project +++ b/cabal.project @@ -78,10 +78,75 @@ write-ghc-environment-files: always -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. --- Allow network-mux 0.11 from SRP (cardano-ping 0.10 on CHaP expects ^>=0.10) --- Allow grapesy deps with updated bounds (matching cardano-node) +-- Temporary pin for the Plutus data decoder fix in https://github.com/IntersectMBO/cardano-ledger/pull/6189 +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: a2041c4bd73995fb4ab3b90db03fdf8ff464e104 + --sha256: 0syndgsgzhzg1wk3k4lf4anfvv9wvvzf437wk8c890mlk4g69vjn + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/babbage/impl + eras/byron/crypto + eras/byron/ledger/impl + eras/conway/impl + eras/dijkstra/impl + eras/mary/impl + eras/shelley/impl + eras/shelley/test-suite + libs/cardano-data + libs/cardano-ledger-api + libs/cardano-ledger-binary + libs/cardano-ledger-core + libs/cardano-protocol + libs/cardano-protocol-tpraos + libs/non-integral + libs/small-steps + libs/vector-map + +-- cardano-api 11.9 uses guard and stake distribution accessors changed by the ledger SRP. +-- Keep this temporary substitution in sync with cardano-api.postPatch in flake.nix. +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api + tag: 79d1fd050d131127e3d976208d1654c8e097eee6 + --sha256: 009cbk7vjy07b1gg54rh3kxgh02s6513f51j8aa3lxmxp4rkx0j3 + subdir: cardano-api + post-checkout-command: sh -ec "sed -i.bak s/requiredTopLevelGuardsL/requiredTopLevelGuardsTxBodyL/g cardano-api/src/Cardano/Api/Experimental/Tx/Internal/BodyContent.hs cardano-api/src/Cardano/Api/Experimental/Tx/Internal/SubTransaction.hs cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs; sed -i.bak -e 's/^import Data.Aeson qualified as Aeson$/import Data.Aeson qualified as Aeson; import Lens.Micro ((^.))/' -e 's|^import Cardano.Ledger.Shelley.API qualified as Shelley$|import Cardano.Ledger.Shelley.API qualified as Shelley; import Cardano.Ledger.Shelley.LedgerState qualified as Shelley (nesStakePoolDistrG)|' -e 's/Shelley.nesPd newEpochS/newEpochS ^. Shelley.nesStakePoolDistrG/' cardano-api/src/Cardano/Api/Query/Internal/Type/DebugLedgerState.hs" + +-- Adapt the released consensus package to the ledger's new stake distribution getter. +-- Keep these substitutions in sync with ouroboros-consensus.postPatch in flake.nix. +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: 4ab9e25069c24be341fb96887a416443f822d01c + --sha256: 01rgxx962d5vmdd4l69g0z5dxi51c21mj32406x9ldclmc6i9r5r + post-checkout-command: sh -ec "sed -i.bak 's/nesPd \\./view SL.nesStakePoolDistrG ./g' ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs; sed -i.bak -e 's|^import qualified Cardano.Ledger.Shelley.API as SL$|import qualified Cardano.Ledger.Shelley.API as SL; import qualified Cardano.Ledger.Shelley.LedgerState as SL (nesStakePoolDistrG)|' -e 's/SL.NewEpochState{nesPd} = nes/nesPd = nes Lens.Micro.^. SL.nesStakePoolDistrG/' ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/SupportsProtocol.hs; sed -i.bak -e 's/seedInitialStakeSnapshots maxKeyAge trigger/seedInitialStakeSnapshots _maxKeyAge trigger/' -e 's/mkSetSnapShot (ss ^. ssStakeMarkL) maxKeyAge/mkSetSnapShot (ss ^. ssStakeMarkL)/' ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs" + allow-newer: + -- Temporary ledger SRP versions exceed the bounds in these released packages. + , cardano-api:cardano-ledger-api + , cardano-api:cardano-protocol + , cardano-config:cardano-ledger-alonzo + , cardano-config:cardano-ledger-conway + , cardano-config:cardano-ledger-core + , cardano-config:cardano-ledger-dijkstra + , cardano-config:cardano-ledger-shelley + , cardano-keys:cardano-ledger-core + , cardano-keys:cardano-ledger-shelley + , cardano-keys:cardano-protocol + , ouroboros-consensus:cardano-ledger-alonzo + , ouroboros-consensus:cardano-ledger-api + , ouroboros-consensus:cardano-ledger-conway + , ouroboros-consensus:cardano-ledger-core + , ouroboros-consensus:cardano-ledger-dijkstra + , ouroboros-consensus:cardano-ledger-mary + , ouroboros-consensus:cardano-ledger-shelley + , ouroboros-consensus:cardano-protocol + -- Allow network-mux 0.11 from SRP (cardano-ping 0.10 on CHaP expects ^>=0.10) , cardano-ping:network-mux + -- Allow grapesy deps with updated bounds (matching cardano-node) , grapesy:aeson , grapesy:crypton-x509 , grapesy:crypton-x509-store diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 9f47dcc52d..493135cb3e 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -260,9 +260,9 @@ library cardano-git-rev ^>=0.2.2, cardano-ledger-api, cardano-ledger-conway, - cardano-ledger-core, - cardano-ledger-dijkstra, - cardano-ledger-shelley, + cardano-ledger-core >=1.23, + cardano-ledger-dijkstra >=0.5, + cardano-ledger-shelley >=1.21, cardano-prelude, cardano-protocol-tpraos, cardano-slotting ^>=0.2.0.0, diff --git a/cardano-cli/src/Cardano/CLI/Orphan.hs b/cardano-cli/src/Cardano/CLI/Orphan.hs index ec8a8112c7..e40d7b5566 100644 --- a/cardano-cli/src/Cardano/CLI/Orphan.hs +++ b/cardano-cli/src/Cardano/CLI/Orphan.hs @@ -16,12 +16,14 @@ import Cardano.Api.Ledger qualified as L import Cardano.CLI.Type.Error.ScriptDecodeError import Cardano.Ledger.Conway.State qualified as L +import Cardano.Ledger.Shelley.LedgerState qualified as L import Control.Exception import Data.Aeson import Data.List qualified as List import Data.Typeable import Data.Word +import Lens.Micro ((^.)) instance Error [Bech32DecodeError] where prettyError errs = vsep $ map prettyError errs @@ -34,14 +36,14 @@ instance (L.EraTxOut ledgerera, L.EraGov ledgerera, L.EraCertState ledgerera, L.EraStake ledgerera) => ToJSON (L.NewEpochState ledgerera) where - toJSON (L.NewEpochState nesEL nesBprev nesBCur nesEs nesRu nesPd _stashedAvvm) = + toJSON nes@(L.NewEpochState nesEL nesBprev nesBCur nesEs nesRu _stashedAvvm) = object [ "currentEpoch" .= nesEL , "priorBlocks" .= nesBprev , "currentEpochBlocks" .= nesBCur , "currentEpochState" .= nesEs , "rewardUpdate" .= nesRu - , "currentStakeDistribution" .= nesPd + , "currentStakeDistribution" .= (nes ^. L.nesStakePoolDistrG) ] instance ToJSON HashableScriptData where diff --git a/cardano-cli/src/Cardano/CLI/Type/Common.hs b/cardano-cli/src/Cardano/CLI/Type/Common.hs index 922e458d19..fbf58e49d5 100644 --- a/cardano-cli/src/Cardano/CLI/Type/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Type/Common.hs @@ -402,11 +402,11 @@ mkPoolStates stakingCredentials = mempty -- QueryPoolStateResult does not provide delegators PoolParams { poolParameters = - (\deposit -> L.mkStakePoolState currentEpoch deposit stakingCredentials pp) <$> mDeposit + (\deposit -> L.mkStakePoolState currentEpoch L.SNothing deposit stakingCredentials pp) <$> mDeposit , futurePoolParameters = do futurePp <- Map.lookup kh qpsrFutureStakePoolParams -- Future parameters only take effect at the next epoch boundary. - (\deposit -> L.mkStakePoolState (succ currentEpoch) deposit stakingCredentials futurePp) + (\deposit -> L.mkStakePoolState (succ currentEpoch) L.SNothing deposit stakingCredentials futurePp) <$> mDeposit , retiringEpoch = Map.lookup kh qpsrRetiring } diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/Transaction/SubTransaction.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/Transaction/SubTransaction.hs index 7f9ee8ac0c..9ede938faa 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/Transaction/SubTransaction.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/Transaction/SubTransaction.hs @@ -1056,7 +1056,7 @@ hprop_dijkstra_sub_transaction_top_level_key_guard_forms = forM_ [keyArgs ++ scriptArgs, scriptArgs ++ keyArgs] $ \args -> do H.noteShow_ args Exp.UnsignedSubTx tx <- buildSubTransaction outFile args - tx ^. L.bodyTxL . L.requiredTopLevelGuardsL H.=== expected + tx ^. L.bodyTxL . L.requiredTopLevelGuardsTxBodyL H.=== expected tx ^. L.bodyTxL . L.guardsTxBodyL H.=== mempty tx ^. L.witsTxL H.=== mempty @@ -1089,7 +1089,7 @@ hprop_dijkstra_sub_transaction_top_level_guard_hashes = expected <- forM [('0', L.SNothing), ('1', L.SJust datum), ('2', L.SNothing)] $ \(digit, mDatum) -> do ScriptHash hash <- H.evalEither $ deserialiseFromRawBytesHex $ BSC.pack $ replicate 56 digit pure (L.ScriptHashObj hash, mDatum) - tx ^. L.bodyTxL . L.requiredTopLevelGuardsL H.=== Map.fromList expected + tx ^. L.bodyTxL . L.requiredTopLevelGuardsTxBodyL H.=== Map.fromList expected -- | Inline, JSON-file and CBOR-file datums produce the same guard entry. hprop_dijkstra_sub_transaction_top_level_guard_datum_formats :: Property @@ -1110,7 +1110,7 @@ hprop_dijkstra_sub_transaction_top_level_guard_datum_formats = inline H.=== cbor ScriptHash hash <- H.evalEither $ deserialiseFromRawBytesHex (BSC.replicate 56 '0') let Exp.UnsignedSubTx tx = inline - tx ^. L.bodyTxL . L.requiredTopLevelGuardsL + tx ^. L.bodyTxL . L.requiredTopLevelGuardsTxBodyL H.=== Map.singleton (L.ScriptHashObj hash) (L.SJust $ toAlonzoData guardDatum) -- | Script files resolve to the same guard entries as their hashes, for both @@ -1131,7 +1131,7 @@ hprop_dijkstra_sub_transaction_top_level_guard_script_files = -- A top-level requirement contributes no local guard or witness data. let Exp.UnsignedSubTx tx = fromFile ScriptHash hash <- H.evalEither $ deserialiseFromRawBytesHex (BSC.pack scriptHash) - tx ^. L.bodyTxL . L.requiredTopLevelGuardsL + tx ^. L.bodyTxL . L.requiredTopLevelGuardsTxBodyL H.=== Map.singleton (L.ScriptHashObj hash) expectedDatum tx ^. L.bodyTxL . L.guardsTxBodyL H.=== mempty tx ^. L.witsTxL H.=== mempty @@ -1164,7 +1164,7 @@ hprop_dijkstra_sub_transaction_top_level_guard_coexists_with_local_guard = , "42" ] [credential] <- pure $ toList (local ^. L.bodyTxL . L.guardsTxBodyL) - combined ^. L.bodyTxL . L.requiredTopLevelGuardsL + combined ^. L.bodyTxL . L.requiredTopLevelGuardsTxBodyL H.=== Map.singleton credential (L.SJust $ toAlonzoData guardDatum) combined ^. L.bodyTxL . L.guardsTxBodyL H.=== local ^. L.bodyTxL . L.guardsTxBodyL combined ^. L.witsTxL H.=== local ^. L.witsTxL diff --git a/flake.nix b/flake.nix index f6bad90c03..8c7cf8b952 100644 --- a/flake.nix +++ b/flake.nix @@ -202,6 +202,28 @@ modules = [ ({pkgs, ...}: { packages.cardano-cli.configureFlags = ["--ghc-option=-Werror"] ++ gitRevFlag; + # haskell.nix does not run the SRP post-checkout-command from cabal.project. + # Apply the same temporary cardano-api compatibility fix here. + packages.cardano-api.postPatch = '' + substituteInPlace src/Cardano/Api/Experimental/Tx/Internal/BodyContent.hs \ + src/Cardano/Api/Experimental/Tx/Internal/SubTransaction.hs \ + test/cardano-api-test/Test/Cardano/Api/Experimental.hs \ + --replace-fail requiredTopLevelGuardsL requiredTopLevelGuardsTxBodyL + substituteInPlace src/Cardano/Api/Query/Internal/Type/DebugLedgerState.hs \ + --replace-fail 'import Data.Aeson qualified as Aeson' 'import Data.Aeson qualified as Aeson; import Lens.Micro ((^.))' \ + --replace-fail 'import Cardano.Ledger.Shelley.API qualified as Shelley' 'import Cardano.Ledger.Shelley.API qualified as Shelley; import Cardano.Ledger.Shelley.LedgerState qualified as Shelley (nesStakePoolDistrG)' \ + --replace-fail 'Shelley.nesPd newEpochS' 'newEpochS ^. Shelley.nesStakePoolDistrG' + ''; + packages.ouroboros-consensus.postPatch = '' + substituteInPlace ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs \ + --replace-fail 'nesPd .' 'view SL.nesStakePoolDistrG .' + substituteInPlace ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/SupportsProtocol.hs \ + --replace-fail 'import qualified Cardano.Ledger.Shelley.API as SL' 'import qualified Cardano.Ledger.Shelley.API as SL; import qualified Cardano.Ledger.Shelley.LedgerState as SL (nesStakePoolDistrG)' \ + --replace-fail 'SL.NewEpochState{nesPd} = nes' 'nesPd = nes Lens.Micro.^. SL.nesStakePoolDistrG' + substituteInPlace ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs \ + --replace-fail 'seedInitialStakeSnapshots maxKeyAge trigger' 'seedInitialStakeSnapshots _maxKeyAge trigger' \ + --replace-fail 'mkSetSnapShot (ss ^. ssStakeMarkL) maxKeyAge' 'mkSetSnapShot (ss ^. ssStakeMarkL)' + ''; packages.basement.configureFlags = ["--hsc2hs-option=--cflag=-Wno-int-conversion"]; }) ({ From 41a683061d19c4dc4ce3eaf0c5f204ee857bc032 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Fri, 16 Oct 2026 09:49:35 -0400 Subject: [PATCH 2/3] Link ledger decoder changelog to PR 1473 --- .changes/20261016_cardano-cli_ledger_6189.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/20261016_cardano-cli_ledger_6189.yml b/.changes/20261016_cardano-cli_ledger_6189.yml index 6d40a3d83e..7b6c24a334 100644 --- a/.changes/20261016_cardano-cli_ledger_6189.yml +++ b/.changes/20261016_cardano-cli_ledger_6189.yml @@ -1,5 +1,5 @@ project: cardano-cli -pr: 0 +pr: 1473 kind: - bugfix description: Pin cardano-ledger to PR 6189 to fix Plutus data decoding for required top-level guards. From 64aca1c00a65fd501e2229547045587cf686a8ce Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Fri, 16 Oct 2026 10:11:08 -0400 Subject: [PATCH 3/3] Replace dependency source rewrites with remote branch pins --- cabal.project | 26 ++++++-------------------- flake.nix | 22 ---------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/cabal.project b/cabal.project index ab2fd6dccc..b40711ab95 100644 --- a/cabal.project +++ b/cabal.project @@ -105,29 +105,23 @@ source-repository-package libs/small-steps libs/vector-map --- cardano-api 11.9 uses guard and stake distribution accessors changed by the ledger SRP. --- Keep this temporary substitution in sync with cardano-api.postPatch in flake.nix. +-- Temporary cardano-api compatibility branch: srp/cardano-ledger-6189 source-repository-package type: git location: https://github.com/IntersectMBO/cardano-api - tag: 79d1fd050d131127e3d976208d1654c8e097eee6 - --sha256: 009cbk7vjy07b1gg54rh3kxgh02s6513f51j8aa3lxmxp4rkx0j3 + tag: 326a8f02df4ff1bb8a862aba23ed7e0cbe40a32c + --sha256: 0gn5ad80qp7i5bvyjrsqrm2hq6ifmvcjhnzf6yys30286y94km5l subdir: cardano-api - post-checkout-command: sh -ec "sed -i.bak s/requiredTopLevelGuardsL/requiredTopLevelGuardsTxBodyL/g cardano-api/src/Cardano/Api/Experimental/Tx/Internal/BodyContent.hs cardano-api/src/Cardano/Api/Experimental/Tx/Internal/SubTransaction.hs cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs; sed -i.bak -e 's/^import Data.Aeson qualified as Aeson$/import Data.Aeson qualified as Aeson; import Lens.Micro ((^.))/' -e 's|^import Cardano.Ledger.Shelley.API qualified as Shelley$|import Cardano.Ledger.Shelley.API qualified as Shelley; import Cardano.Ledger.Shelley.LedgerState qualified as Shelley (nesStakePoolDistrG)|' -e 's/Shelley.nesPd newEpochS/newEpochS ^. Shelley.nesStakePoolDistrG/' cardano-api/src/Cardano/Api/Query/Internal/Type/DebugLedgerState.hs" --- Adapt the released consensus package to the ledger's new stake distribution getter. --- Keep these substitutions in sync with ouroboros-consensus.postPatch in flake.nix. +-- Temporary ouroboros-consensus compatibility branch: srp/cardano-ledger-6189 source-repository-package type: git location: https://github.com/IntersectMBO/ouroboros-consensus - tag: 4ab9e25069c24be341fb96887a416443f822d01c - --sha256: 01rgxx962d5vmdd4l69g0z5dxi51c21mj32406x9ldclmc6i9r5r - post-checkout-command: sh -ec "sed -i.bak 's/nesPd \\./view SL.nesStakePoolDistrG ./g' ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs; sed -i.bak -e 's|^import qualified Cardano.Ledger.Shelley.API as SL$|import qualified Cardano.Ledger.Shelley.API as SL; import qualified Cardano.Ledger.Shelley.LedgerState as SL (nesStakePoolDistrG)|' -e 's/SL.NewEpochState{nesPd} = nes/nesPd = nes Lens.Micro.^. SL.nesStakePoolDistrG/' ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/SupportsProtocol.hs; sed -i.bak -e 's/seedInitialStakeSnapshots maxKeyAge trigger/seedInitialStakeSnapshots _maxKeyAge trigger/' -e 's/mkSetSnapShot (ss ^. ssStakeMarkL) maxKeyAge/mkSetSnapShot (ss ^. ssStakeMarkL)/' ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs" + tag: 7ef5dc2474d42eeccc8244c9d2a5379ea2405df7 + --sha256: 073rxsv3p5wr9n6kj4hbksa5mirmkpxasayv6h221v1frswp0mr7 allow-newer: -- Temporary ledger SRP versions exceed the bounds in these released packages. - , cardano-api:cardano-ledger-api - , cardano-api:cardano-protocol , cardano-config:cardano-ledger-alonzo , cardano-config:cardano-ledger-conway , cardano-config:cardano-ledger-core @@ -136,14 +130,6 @@ allow-newer: , cardano-keys:cardano-ledger-core , cardano-keys:cardano-ledger-shelley , cardano-keys:cardano-protocol - , ouroboros-consensus:cardano-ledger-alonzo - , ouroboros-consensus:cardano-ledger-api - , ouroboros-consensus:cardano-ledger-conway - , ouroboros-consensus:cardano-ledger-core - , ouroboros-consensus:cardano-ledger-dijkstra - , ouroboros-consensus:cardano-ledger-mary - , ouroboros-consensus:cardano-ledger-shelley - , ouroboros-consensus:cardano-protocol -- Allow network-mux 0.11 from SRP (cardano-ping 0.10 on CHaP expects ^>=0.10) , cardano-ping:network-mux -- Allow grapesy deps with updated bounds (matching cardano-node) diff --git a/flake.nix b/flake.nix index 8c7cf8b952..f6bad90c03 100644 --- a/flake.nix +++ b/flake.nix @@ -202,28 +202,6 @@ modules = [ ({pkgs, ...}: { packages.cardano-cli.configureFlags = ["--ghc-option=-Werror"] ++ gitRevFlag; - # haskell.nix does not run the SRP post-checkout-command from cabal.project. - # Apply the same temporary cardano-api compatibility fix here. - packages.cardano-api.postPatch = '' - substituteInPlace src/Cardano/Api/Experimental/Tx/Internal/BodyContent.hs \ - src/Cardano/Api/Experimental/Tx/Internal/SubTransaction.hs \ - test/cardano-api-test/Test/Cardano/Api/Experimental.hs \ - --replace-fail requiredTopLevelGuardsL requiredTopLevelGuardsTxBodyL - substituteInPlace src/Cardano/Api/Query/Internal/Type/DebugLedgerState.hs \ - --replace-fail 'import Data.Aeson qualified as Aeson' 'import Data.Aeson qualified as Aeson; import Lens.Micro ((^.))' \ - --replace-fail 'import Cardano.Ledger.Shelley.API qualified as Shelley' 'import Cardano.Ledger.Shelley.API qualified as Shelley; import Cardano.Ledger.Shelley.LedgerState qualified as Shelley (nesStakePoolDistrG)' \ - --replace-fail 'Shelley.nesPd newEpochS' 'newEpochS ^. Shelley.nesStakePoolDistrG' - ''; - packages.ouroboros-consensus.postPatch = '' - substituteInPlace ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs \ - --replace-fail 'nesPd .' 'view SL.nesStakePoolDistrG .' - substituteInPlace ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/SupportsProtocol.hs \ - --replace-fail 'import qualified Cardano.Ledger.Shelley.API as SL' 'import qualified Cardano.Ledger.Shelley.API as SL; import qualified Cardano.Ledger.Shelley.LedgerState as SL (nesStakePoolDistrG)' \ - --replace-fail 'SL.NewEpochState{nesPd} = nes' 'nesPd = nes Lens.Micro.^. SL.nesStakePoolDistrG' - substituteInPlace ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs \ - --replace-fail 'seedInitialStakeSnapshots maxKeyAge trigger' 'seedInitialStakeSnapshots _maxKeyAge trigger' \ - --replace-fail 'mkSetSnapShot (ss ^. ssStakeMarkL) maxKeyAge' 'mkSetSnapShot (ss ^. ssStakeMarkL)' - ''; packages.basement.configureFlags = ["--hsc2hs-option=--cflag=-Wno-int-conversion"]; }) ({