From 0eaf0c197f9f57db50d74ea9eb50d574f8839084 Mon Sep 17 00:00:00 2001 From: Carlos LopezDeLara Date: Mon, 1 Jul 2024 13:28:08 -0600 Subject: [PATCH] Integrate for node 9.0 Integrate consensus, ledger and api in preparation for node v9.0.0 --- cabal.project | 4 ++-- cardano-cli/cardano-cli.cabal | 6 +++--- .../src/Cardano/CLI/EraBased/Options/Transaction.hs | 4 ++-- cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs | 7 +++---- .../src/Cardano/CLI/EraBased/Run/Transaction.hs | 8 ++++---- .../src/Cardano/CLI/Legacy/Run/Transaction.hs | 2 +- flake.lock | 12 ++++++------ 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/cabal.project b/cabal.project index 1c5a827da1..f4bc98a779 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 2024-06-27T12:26:16Z - , cardano-haskell-packages 2024-06-27T12:26:16Z + , hackage.haskell.org 2024-06-23T23:01:13Z + , cardano-haskell-packages 2024-07-02T19:42:00Z packages: cardano-cli diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index b07aa857d8..9a877ff64d 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -205,7 +205,7 @@ library , binary , bytestring , canonical-json - , cardano-api ^>= 8.49.0.0 + , cardano-api ^>= 9.0 , cardano-binary , cardano-crypto , cardano-crypto-class ^>= 2.1.2 @@ -234,9 +234,9 @@ library , microlens , network , optparse-applicative-fork - , ouroboros-consensus ^>= 0.19 + , ouroboros-consensus ^>= 0.20 -- TODO: bump consensus back - , ouroboros-consensus-cardano ^>= 0.17 + , ouroboros-consensus-cardano ^>= 0.18 , ouroboros-consensus-protocol ^>= 0.9.0.1 , ouroboros-network-api ^>= 0.7.3 , ouroboros-network-protocols diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs index eff6d214cb..199034b096 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs @@ -180,7 +180,7 @@ pTransactionBuildCmd era envCli = do Nothing "Filepath of auxiliary script(s)") <*> many pMetadataFile - <*> pFeatured (shelleyBasedToCardanoEra sbe) (optional pUpdateProposalFile) + <*> pFeatured (toCardanoEra sbe) (optional pUpdateProposalFile) <*> pVoteFiles sbe AutoBalance <*> pProposalFiles sbe AutoBalance <*> pTreasuryDonation sbe @@ -235,7 +235,7 @@ pTransactionBuildEstimateCmd era _envCli = do Nothing "Filepath of auxiliary script(s)") <*> many pMetadataFile - <*> pFeatured (shelleyBasedToCardanoEra sbe) (optional pUpdateProposalFile) + <*> pFeatured (toCardanoEra sbe) (optional pUpdateProposalFile) <*> pVoteFiles sbe ManualBalance <*> pProposalFiles sbe ManualBalance <*> pCurrentTreasuryValue sbe diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs index 2722963161..cbc384bdc0 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs @@ -170,11 +170,11 @@ runQueryProtocolParametersCmd , Cmd.mOutFile } = do let localNodeConnInfo = LocalNodeConnectInfo consensusModeParams networkId nodeSocketPath - AnyCardanoEra era <- firstExceptT QueryCmdAcquireFailure $ newExceptT $ determineEra localNodeConnInfo + AnyCardanoEra era <- firstExceptT QueryCmdAcquireFailure $ determineEra localNodeConnInfo sbe <- forEraInEon @ShelleyBasedEra era (left QueryCmdByronEra) pure let qInMode = QueryInEra $ QueryInShelleyBasedEra sbe Api.QueryProtocolParameters pp <- firstExceptT QueryCmdConvenienceError - . newExceptT $ executeQueryAnyMode localNodeConnInfo qInMode + $ executeQueryAnyMode localNodeConnInfo qInMode writeProtocolParameters sbe mOutFile pp where writeProtocolParameters @@ -654,8 +654,7 @@ runQueryTxMempoolCmd localQuery <- case query of TxMempoolQueryTxExists tx -> do - AnyCardanoEra era <- lift (determineEra localNodeConnInfo) - & onLeft (left . QueryCmdAcquireFailure) + AnyCardanoEra era <- modifyError QueryCmdAcquireFailure (determineEra localNodeConnInfo) pure $ LocalTxMonitoringQueryTx $ TxIdInMode era tx TxMempoolQueryNextTx -> pure LocalTxMonitoringSendNextTx TxMempoolQueryInfo -> pure LocalTxMonitoringMempoolInformation diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index e391961b74..5cc6cc226a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -131,7 +131,7 @@ runTransactionBuildCmd , treasuryDonation , buildOutputOptions } = shelleyBasedEraConstraints eon $ do - let era = shelleyBasedToCardanoEra eon + let era = toCardanoEra eon -- The user can specify an era prior to the era that the node is currently in. -- We cannot use the user specified era to construct a query against a node because it may differ @@ -766,7 +766,7 @@ runTxBuild -- TODO: All functions should be parameterized by ShelleyBasedEra -- as it's not possible to call this function with ByronEra - let era = shelleyBasedToCardanoEra sbe + let era = toCardanoEra sbe inputsThatRequireWitnessing = [input | (input,_) <- inputsAndMaybeScriptWits] let allReferenceInputs = getAllReferenceInputs @@ -1078,7 +1078,7 @@ toTxAlonzoDatum supp cliDatum = sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile pure (TxOutDatumInTx supp sData) TxOutInlineDatumByValue sDataOrFile -> do - let cEra = alonzoEraOnwardsToCardanoEra supp + let cEra = toCardanoEra supp forEraInEon cEra (txFeatureMismatch cEra TxFeatureInlineDatums) $ \babbageOnwards -> do sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile pure $ TxOutDatumInline babbageOnwards sData @@ -1521,7 +1521,7 @@ runTransactionSignWitnessCmd lift (readFileTxKeyWitness file) & onLeft (left . TxCmdCddlWitnessError) case testEquality era era' of - Nothing -> left $ TxCmdWitnessEraMismatch (AnyCardanoEra $ shelleyBasedToCardanoEra era) (AnyCardanoEra $ shelleyBasedToCardanoEra era') witnessFile + Nothing -> left $ TxCmdWitnessEraMismatch (AnyCardanoEra $ toCardanoEra era) (AnyCardanoEra $ toCardanoEra era') witnessFile Just Refl -> return witness | witnessFile@(WitnessFile file) <- witnessFiles ] diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs index d8270cd2c2..1a0fc007ed 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs @@ -103,7 +103,7 @@ runLegacyTransactionBuildCmd outputOptions = do mUpdateProposalFile <- - validateUpdateProposalFile (shelleyBasedToCardanoEra sbe) mUpdateProposal + validateUpdateProposalFile (toCardanoEra sbe) mUpdateProposal & hoistEither & firstExceptT TxCmdNotSupportedInEraValidationError diff --git a/flake.lock b/flake.lock index 65f9113821..287659a045 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1719559353, - "narHash": "sha256-oVMUrDPUbVVsTWOsmtZkpHFr+oKPEezlSADm/s3A2/o=", + "lastModified": 1719950081, + "narHash": "sha256-RBuStLEj6JBd1ouBRa8W0vb/X32TD49DmTvBtTIjy1c=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "35bd2072a08607a3b2e4b56cf9c243c449908017", + "rev": "c5fb42c338a64c2eda832ecea7a5b354c971a5e5", "type": "github" }, "original": { @@ -210,11 +210,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1719535035, - "narHash": "sha256-kCCfZytGgkRYlsiNe/dwLAnpNOvfywpjVl61hO/8l2M=", + "lastModified": 1719794527, + "narHash": "sha256-qHo/KumtwAzPkfLWODu/6EFY/LeK+C7iPJyAUdT8tGA=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "66f23365685f71610460f3c2c0dfa91f96c532ac", + "rev": "da2a3bc9bd1b3dd41bb147279529c471c615fd3e", "type": "github" }, "original": {