From 2de15ecf0ee641c90d34627b34f96542a070214d Mon Sep 17 00:00:00 2001 From: Fabrizio Ferrai Date: Tue, 26 May 2026 17:35:03 +0300 Subject: [PATCH] Integration for Node release 11.1 --- cabal.project | 76 ++++++++++++++++++- cardano-cli/cardano-cli.cabal | 5 +- .../src/Cardano/CLI/Byron/UpdateProposal.hs | 2 +- cardano-cli/src/Cardano/CLI/Byron/Vote.hs | 2 +- .../CLI/EraIndependent/Cip/Cip129/Run.hs | 13 ++-- .../EraIndependent/Debug/LogEpochState/Run.hs | 9 +++ .../Cardano/CLI/EraIndependent/Ping/Run.hs | 4 +- cardano-cli/src/Cardano/CLI/Orphan.hs | 8 -- cardano-cli/src/Cardano/CLI/Read.hs | 13 ++++ flake.lock | 12 +-- 10 files changed, 115 insertions(+), 29 deletions(-) diff --git a/cabal.project b/cabal.project index 2ca4e93f27..f8538f1692 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,8 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2026-04-16T00:15:23Z - , cardano-haskell-packages 2026-05-18T18:23:40Z + , hackage.haskell.org 2026-05-18T17:14:36Z + , cardano-haskell-packages 2026-05-26T09:41:58Z active-repositories: , :rest @@ -140,3 +140,75 @@ if impl(ghc >= 9.14) , wl-pprint-text:base-compat -- cabal-allow-newer end + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api.git + tag: ea7b1bdb3174b0d727ad128a5bb8e3065a658d97 + --sha256: sha256-VfpiRNwnKVMoYkf1Khw0TQnDSKaE1+0l4qvsWLhPlTc= + subdir: + cardano-api + +-- cuddle 1.7 +source-repository-package + type: git + location: https://github.com/input-output-hk/cuddle + tag: 7b67a97a71601e686823afe362485d51340fb317 + --sha256: sha256-nUEFgDC7lQoSfwqjwDWhKfc/1ZOO/D+zPiBd7hoNaYs= + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger.git + tag: 6a71a6b37879c0b77abdeac30ae94102620f5a2c + --sha256: sha256-8mKgdf9b4UAy6c6OeaJh0yRPqt3NDeOUH9ko2uBSSBI= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/babbage/impl + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/conway/impl + eras/dijkstra/impl + eras/mary/impl + eras/shelley-ma/test-suite + 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-tpraos + libs/non-integral + libs/small-steps + libs/vector-map + +source-repository-package + type: git + location: https://github.com/f-f/kes-agent.git + tag: 0b362519f6915841c92869ed288ce83f89b17b73 + --sha256: sha256-8pZYF7MJZZ1tM19wIUhbLKORDL+OP2ckhueWJM4aG/c= + subdir: + kes-agent + kes-agent-crypto + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: 4b8da559df6b760f12edc9d5ebe6f01ab4f5ee91 + --sha256: sha256-+fbOSEZW59Vq3IyuLxPdknSau4idpUCoyrYdGEt0L0g= + subdir: + . + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-network.git + tag: d842a238a9ac329a4bb676dd95e46ee25a7a1a94 + --sha256: sha256-8vW+gEV3UxoEYRBJKH02TjQKVFw++gdDh77bzLCrWCI= + subdir: + ./cardano-diffusion + ./cardano-ping + ./monoidal-synchronisation + ./network-mux + ./ouroboros-network diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index b65fa00ac3..613b9e27c7 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -245,7 +245,7 @@ library cardano-api ^>=11.2, cardano-binary, cardano-crypto, - cardano-crypto-class ^>=2.3, + cardano-crypto-class ^>=2.5, cardano-crypto-wrapper ^>=1.7, cardano-data >=1.1, cardano-git-rev ^>=0.2.2, @@ -267,6 +267,7 @@ library exceptions, filepath, formatting, + fs-api, generic-lens, haskeline, http-client, @@ -292,7 +293,7 @@ library transformers, unliftio-core, utf8-string, - validation, + validation ^>=1.2, vary ^>=0.1.1.2, vector, yaml, diff --git a/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs b/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs index 79a3b7e146..d929c2a0cd 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs @@ -69,5 +69,5 @@ submitByronUpdateProposal submitByronUpdateProposal nodeSocketPath network proposalFp = do proposal <- readByronUpdateProposal proposalFp let genTx = toByronLedgerUpdateProposal proposal - traceWith stdoutTracer $ "Update proposal TxId: " ++ condense (txId genTx) + liftIO $ traceWith stdoutTracer $ "Update proposal TxId: " ++ condense (txId genTx) fromExceptTCli $ nodeSubmitTx nodeSocketPath network genTx diff --git a/cardano-cli/src/Cardano/CLI/Byron/Vote.hs b/cardano-cli/src/Cardano/CLI/Byron/Vote.hs index 10c99d15b2..6dea978de1 100644 --- a/cardano-cli/src/Cardano/CLI/Byron/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/Byron/Vote.hs @@ -52,7 +52,7 @@ submitByronVote submitByronVote nodeSocketPath network voteFp = do vote <- readByronVote voteFp let genTx = toByronLedgertoByronVote vote - traceWith stdoutTracer ("Vote TxId: " ++ condense (txId genTx)) + liftIO $ traceWith stdoutTracer ("Vote TxId: " ++ condense (txId genTx)) fromExceptTCli $ nodeSubmitTx nodeSocketPath network genTx readByronVote :: FilePath -> CIO e ByronVote diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs index 2c231cc6b3..78c5b6635c 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs @@ -22,7 +22,6 @@ import Data.ByteString (ByteString) import Data.ByteString qualified as BS import Data.ByteString.Char8 qualified as BSC import Data.Text.Encoding qualified as Text -import Data.Validation qualified as Valid import System.IO runCip129 :: Cip129 -> CIO e () @@ -32,9 +31,9 @@ runCip129 (Cip129DRep inp out) = do f <- liftIO $ fileOrPipe textEnvFp fromEitherIOCli $ readDrepVerificationKeyFile f InputHexText t -> do - fromEitherCli . Valid.toEither $ readDRepHexVerificationKeyText t + fromEitherCli . toEither $ readDRepHexVerificationKeyText t InputBech32Text t -> do - fromEitherCli . Valid.toEither $ readDRepBech32VerificationKeyText t + fromEitherCli . toEither $ readDRepBech32VerificationKeyText t let cip129Output = Text.encodeUtf8 $ encodeCip129DrepVerficationKeyText k renderOutput cip129Output out runCip129 (Cip129CommitteeHotKey inp out) = do @@ -43,9 +42,9 @@ runCip129 (Cip129CommitteeHotKey inp out) = do f <- liftIO $ fileOrPipe textEnvFp fromEitherIOCli $ readCommitteeHotVerificationKeyFile f InputHexText t -> - fromEitherCli . Valid.toEither $ readCommitteeHotHexVerificationKeyText t + fromEitherCli . toEither $ readCommitteeHotHexVerificationKeyText t InputBech32Text t -> - fromEitherCli . Valid.toEither $ readCommitteeHotBech32VerificationKeyText t + fromEitherCli . toEither $ readCommitteeHotBech32VerificationKeyText t let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeHotVerficationKeyText k renderOutput cip129Output out runCip129 (Cip129CommitteeColdKey inp out) = do @@ -54,9 +53,9 @@ runCip129 (Cip129CommitteeColdKey inp out) = do f <- liftIO $ fileOrPipe textEnvFp fromEitherIOCli $ readCommitteeColdVerificationKeyFile f InputHexText t -> - fromEitherCli . Valid.toEither $ readCommitteeColdHexVerificationKeyText t + fromEitherCli . toEither $ readCommitteeColdHexVerificationKeyText t InputBech32Text t -> - fromEitherCli . Valid.toEither $ readCommitteeColdBech32VerificationKeyText t + fromEitherCli . toEither $ readCommitteeColdBech32VerificationKeyText t let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeColdVerficationKeyText k renderOutput cip129Output out runCip129 (Cip129GovernanceAction inp out) = diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Debug/LogEpochState/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Debug/LogEpochState/Run.hs index 61093b9505..a786fbc52d 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Debug/LogEpochState/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Debug/LogEpochState/Run.hs @@ -15,6 +15,11 @@ import Cardano.CLI.Orphan () import Data.Aeson qualified as Aeson import Data.ByteString.Lazy qualified as LBS +import System.Directory (makeAbsolute) +import System.FS.API (SomeHasFS (..)) +import System.FS.API.Types (MountPoint (MountPoint)) +import System.FS.IO (ioHasFS) +import System.FilePath (takeDirectory) import System.IO qualified as IO runLogEpochStateCmd @@ -28,9 +33,13 @@ runLogEpochStateCmd } = do LBS.appendFile outputFilePath "" + configDir <- takeDirectory <$> makeAbsolute (unFile configurationFile) + let fs = SomeHasFS (ioHasFS (MountPoint configDir)) + result <- runExceptT $ foldEpochState + fs configurationFile nodeSocketPath Api.QuickValidation diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Ping/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Ping/Run.hs index de66b74651..596d3540bf 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Ping/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Ping/Run.hs @@ -19,7 +19,7 @@ import Control.Concurrent.Class.MonadSTM.Strict qualified as STM import Control.Exception (SomeException) import Control.Monad (forM, unless) import Control.Monad.Class.MonadAsync (MonadAsync (async, wait, waitCatch)) -import Control.Tracer (Tracer (..)) +import Control.Tracer (Tracer, mkTracer) import Data.List qualified as L import Data.List qualified as List import Network.Socket (AddrInfo) @@ -96,7 +96,7 @@ runPingCmd options = do -- Ping client thread handles caids <- forM addresses $ - liftIO . async . pingClient (Tracer $ doLog msgQueue) (Tracer doErrLog) options versions + liftIO . async . pingClient (mkTracer $ doLog msgQueue) (mkTracer doErrLog) options versions res <- L.zip addresses <$> mapM (liftIO . waitCatch) caids liftIO $ doLog msgQueue CNP.LogEnd liftIO $ wait laid diff --git a/cardano-cli/src/Cardano/CLI/Orphan.hs b/cardano-cli/src/Cardano/CLI/Orphan.hs index 4a81e7c75c..ec8a8112c7 100644 --- a/cardano-cli/src/Cardano/CLI/Orphan.hs +++ b/cardano-cli/src/Cardano/CLI/Orphan.hs @@ -15,7 +15,6 @@ import Cardano.Api.Experimental as Exp import Cardano.Api.Ledger qualified as L import Cardano.CLI.Type.Error.ScriptDecodeError -import Cardano.Ledger.Conway.Governance qualified as L import Cardano.Ledger.Conway.State qualified as L import Control.Exception @@ -24,13 +23,6 @@ import Data.List qualified as List import Data.Typeable import Data.Word -instance ToJSON L.DefaultVote where - toJSON defaultVote = - case defaultVote of - L.DefaultNo -> String "DefaultNo" - L.DefaultAbstain -> String "DefaultAbstain" - L.DefaultNoConfidence -> String "DefaultNoConfidence" - instance Error [Bech32DecodeError] where prettyError errs = vsep $ map prettyError errs diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 93d64b2605..7e11c21e51 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -91,6 +91,8 @@ module Cardano.CLI.Read -- * utilities , readerFromParsecParser + , liftError + , toEither ) where @@ -134,6 +136,7 @@ import Data.Text qualified as T import Data.Text qualified as Text import Data.Text.Encoding qualified as Text import Data.Text.Encoding.Error qualified as Text +import Data.Validation (Validation (Failure, Success)) import GHC.IO.Handle (hClose, hIsSeekable) import GHC.IO.Handle.FD (openFileBlocking) import GHC.Stack @@ -819,6 +822,16 @@ readFileCli = withFrozenCallStack . readFileBinary readerFromParsecParser :: P.Parser a -> Opt.ReadM a readerFromParsecParser p = Opt.eitherReader (P.runParser p . T.pack) +liftError :: (e -> e') -> Either e a -> Validation e' a +liftError f = \case + Left e -> Failure (f e) + Right a -> Success a + +toEither :: Validation e a -> Either e a +toEither = \case + Failure e -> Left e + Success a -> Right a + -- TODO: Update to handle hex script bytes directly as well! readFilePlutusScript :: forall e era diff --git a/flake.lock b/flake.lock index 229bec3367..9a850df751 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1779134693, - "narHash": "sha256-2vRtxwIvAX4MOAvetH4lqPoKqQ2g6/mlJoBrhlVrGyk=", + "lastModified": 1779802675, + "narHash": "sha256-LQN0f9GBBmYMo9tQ/11EvU5tAEOhGtQnU2UP3S78cqg=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "a91041c5d000a3016cc09d3621887599a5f1f4f1", + "rev": "b8c7b848cdb6d08e414c37d026c300200f8c1b5b", "type": "github" }, "original": { @@ -209,11 +209,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1776316107, - "narHash": "sha256-lYM+lDSQCT+MYtNXigF0u3hyH7PabG5okls4a6AZGlQ=", + "lastModified": 1779711321, + "narHash": "sha256-Fca5Phc5+7ybs5EP/HaCS0bf2GuvMP9lFaERWiOJRYs=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "54996315d39ab3042ef00e30942031666a78ae5c", + "rev": "d6ed0b8a5851caeffc7e9d45daf9d54b33544e32", "type": "github" }, "original": {