diff --git a/cabal.project b/cabal.project index d99b38cb71..68cac8f321 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 2025-06-22T20:18:27Z - , cardano-haskell-packages 2025-07-14T17:31:29Z + , hackage.haskell.org 2025-07-22T09:13:54Z + , cardano-haskell-packages 2025-07-28T14:33:19Z packages: cardano-cli @@ -65,3 +65,64 @@ if impl (ghc >= 9.12) -- https://github.com/kapralVV/Unique/issues/11 , Unique:hashable +allow-newer: + , cardano-ledger-byron + -- https://github.com/phadej/vec/issues/121 + , ral:QuickCheck + , fin:QuickCheck + , bin:QuickCheck + +constraints: + + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api + tag: 64e62e7d6ac1bd250e4b61346f09ecd697ee2e90 + --sha256: sha256-RsLNzqPx0nDvXCUpBCVcylE3+kUoWBwUSHAQQERR5Pc= + subdir: + cardano-api + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: 5aac28bec41b7709f75a5c9f20e2431259cf237f + --sha256: sha256-PXnD7mAIZgnodqbMU3ImCb/uoat61vLsqnc6dUyTRIw= + subdir: + ouroboros-consensus + ouroboros-consensus-cardano + ouroboros-consensus-diffusion + ouroboros-consensus-protocol + sop-extras + strict-sop-core + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: 20485948f78ab139d246695e540f9ec00963a16e + --sha256: sha256-SHnyp+GvNeR82UXoKeDEgsp1AUE2yF5dGL4HIZm0zK8= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/alonzo/test-suite + eras/babbage/impl + eras/babbage/test-suite + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/conway/impl + eras/dijkstra + eras/mary/impl + eras/shelley/impl + eras/shelley-ma/test-suite + 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/set-algebra + libs/small-steps + libs/vector-map diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 9da7da8f9a..4055abfe9c 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -251,7 +251,7 @@ library cardano-ledger-api, cardano-ledger-conway, cardano-ledger-core, - cardano-ping ^>=0.8, + cardano-ping ^>=0.9, cardano-prelude, cardano-protocol-tpraos, cardano-slotting ^>=0.2.0.0, @@ -271,6 +271,7 @@ library http-client-tls, http-types, io-classes, + io-classes:strict-stm, iproute, microlens, mmorph, @@ -278,12 +279,14 @@ library network, network-uri, optparse-applicative-fork, + ouroboros-consensus, + ouroboros-consensus-cardano, prettyprinter, prettyprinter-ansi-terminal, random, rio, + sop-extras, split, - strict-stm, text, time, transformers, diff --git a/cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs b/cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs index 09f0ddda5c..646e1457eb 100644 --- a/cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs +++ b/cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs @@ -58,6 +58,9 @@ runCompatibleGovernanceActionCreateProtocolParametersUpdateCmd eraBasedPParams' ShelleyBasedEraBabbage -> shelleyToBabbageProtocolParametersUpdate sbe eraBasedPParams' ShelleyBasedEraConway -> conwayProtocolParametersUpdate sbe eraBasedPParams' + ShelleyBasedEraDijkstra -> + -- TODO: Dijkstra + error "runCompatibleGovernanceActionCreateProtocolParametersUpdateCmd: Dijkstra not supported yet" maybeAddUpdatedCostModel :: GovernanceActionProtocolParametersUpdateCmdArgs era diff --git a/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs b/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs index fec926236e..4de5910abb 100644 --- a/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs +++ b/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs @@ -345,7 +345,14 @@ getScriptWitnessDetails era tb = Ledger.ConwayRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp Ledger.ConwayVoting (L.AsIxItem _ vp) -> addLabelToPurpose Voting vp Ledger.ConwayProposing (L.AsIxItem _ pp) -> addLabelToPurpose Proposing pp - + friendlyPurpose AlonzoEraOnwardsDijkstra purpose = + case purpose of + Ledger.ConwaySpending (L.AsIxItem _ sp) -> addLabelToPurpose Spending (friendlyInput sp) + Ledger.ConwayMinting (L.AsIxItem _ mp) -> addLabelToPurpose Minting mp + Ledger.ConwayCertifying (L.AsIxItem _ cp) -> addLabelToPurpose Certifying cp + Ledger.ConwayRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp + Ledger.ConwayVoting (L.AsIxItem _ vp) -> addLabelToPurpose Voting vp + Ledger.ConwayProposing (L.AsIxItem _ pp) -> addLabelToPurpose Proposing pp friendlyInput :: Ledger.TxIn -> Aeson.Value friendlyInput (Ledger.TxIn (Ledger.TxId txidHash) ix) = Aeson.String $ @@ -738,6 +745,8 @@ renderCertificate sbe = \case [ "Drep credential" .= drepCredential , "anchor " .= mbAnchor ] + -- TODO: Dijkstra + _ -> error "renderCertificate: Dijkstra" where conwayToObject :: () diff --git a/cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs b/cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs index 240d06a02b..fb132a9bce 100644 --- a/cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs +++ b/cardano-cli/src/Cardano/CLI/Compatible/Transaction/Option.hs @@ -97,6 +97,7 @@ pTxOutDatum = AlonzoEraOnwardsBabbage -> pBabbageDatumFunctionality <|> pure TxOutDatumByNone AlonzoEraOnwardsConway -> pConwayDatumFunctionality <|> pure TxOutDatumByNone + AlonzoEraOnwardsDijkstra -> pConwayDatumFunctionality <|> pure TxOutDatumByNone ) where pAlonzoDatumFunctionality = diff --git a/cardano-cli/src/Cardano/CLI/Environment.hs b/cardano-cli/src/Cardano/CLI/Environment.hs index 8f05bca3e8..76776fe695 100644 --- a/cardano-cli/src/Cardano/CLI/Environment.hs +++ b/cardano-cli/src/Cardano/CLI/Environment.hs @@ -53,6 +53,7 @@ anyCardanoEraToEra (AnyCardanoEra era) = AlonzoEra -> Nothing BabbageEra -> Nothing ConwayEra -> Just Exp.ConwayEra + DijkstraEra -> Nothing envCliEra :: EnvCli -> Maybe (Exp.Era Exp.ConwayEra) envCliEra envCli = do diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Genesis/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/Genesis/Option.hs index 718e7599ce..31078f0098 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Genesis/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Genesis/Option.hs @@ -232,8 +232,8 @@ pGenesisCreateTestNetData envCli = <*> pNumGenesisKeys <*> pNumPools <*> pNumStakeDelegs - <*> (case Exp.useEra @era of Exp.ConwayEra -> pNumCommittee) -- Committee doesn't exist in babbage - <*> (case Exp.useEra @era of Exp.ConwayEra -> pNumDReps) -- DReps don't exist in babbage + <*> pNumCommittee + <*> pNumDReps <*> pNumStuffedUtxoCount <*> pNumUtxoKeys <*> pSupply diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs index 31f8d5d207..74d087c85f 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs @@ -345,6 +345,9 @@ pGovActionProtocolParametersUpdate = \case <*> pAlonzoOnwardsPParams <*> pIntroducedInBabbagePParams <*> pIntroducedInConwayPParams + ShelleyBasedEraDijkstra -> + -- TODO: Dijkstra + error "pGovActionProtocolParametersUpdate: Dijkstra era not supported yet" pGovernanceActionTreasuryWithdrawalCmd :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era)) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Run.hs index e4648c1051..76abd791dd 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Run.hs @@ -374,6 +374,10 @@ addCostModelsToEraBasedProtocolParametersUpdate cmdls (ConwayEraBasedProtocolParametersUpdate common aOn inB inC) = ConwayEraBasedProtocolParametersUpdate common (aOn{alCostModels = SJust cmdls}) inB inC +addCostModelsToEraBasedProtocolParametersUpdate + AlonzoEraOnwardsDijkstra + _ + _ = error "addCostModelsToEraBasedProtocolParametersUpdate: Dijkstra not supported yet" -- TODO: Dijkstra runGovernanceActionTreasuryWithdrawalCmd :: forall era e diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs index 54c0e54557..94d926fe78 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs @@ -64,8 +64,13 @@ import Cardano.CLI.Type.Output (QueryDRepStateOutput (..)) import Cardano.CLI.Type.Output qualified as O import Cardano.Crypto.Hash (hashToBytesAsHex) import Cardano.Ledger.Api.State.Query qualified as L +import Cardano.Ledger.Conway.State (ChainAccountState (..)) import Cardano.Slotting.EpochInfo (EpochInfo (..), epochInfoSlotToUTCTime, hoistEpochInfo) import Cardano.Slotting.Time (RelativeTime (..), toRelativeTime) +import Ouroboros.Consensus.Cardano.Block as Consensus +import Ouroboros.Consensus.HardFork.Combinator.NetworkVersion +import Ouroboros.Consensus.Node.NetworkProtocolVersion +import Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion import RIO hiding (toList) @@ -77,6 +82,7 @@ import Data.ByteString.Lazy.Char8 qualified as LBS import Data.Coerce (coerce) import Data.List qualified as List import Data.Map.Strict qualified as Map +import Data.SOP.Index import Data.Sequence qualified as Seq import Data.Set qualified as Set import Data.Text qualified as Text @@ -872,7 +878,7 @@ runQueryLedgerPeerSnapshot } = do result <- fromEitherIOCli - ( executeLocalStateQueryExpr nodeConnInfo target $ runExceptT $ do + ( executeLocalStateQueryExprWithVersion nodeConnInfo target $ \globalNtcVersion -> runExceptT $ do AnyCardanoEra cEra <- lift queryCurrentEra & onLeft (left . QueryCmdUnsupportedNtcVersion) @@ -882,9 +888,11 @@ runQueryLedgerPeerSnapshot result <- easyRunQuery (queryLedgerPeerSnapshot sbe) + shelleyNtcVersion <- hoistEither $ getShelleyNodeToClientVersion era globalNtcVersion + hoist liftIO $ obtainCommonConstraints era $ - case decodeBigLedgerPeerSnapshot result of + case decodeBigLedgerPeerSnapshot shelleyNtcVersion result of Left (bs, _decoderError) -> pure $ Left bs Right snapshot -> pure $ Right snapshot ) @@ -1057,6 +1065,28 @@ getQueryStakeAddressInfo -- ------------------------------------------------------------------------------------------------- +getShelleyNodeToClientVersion + :: Exp.Era era -> NodeToClientVersion -> Either QueryCmdError ShelleyNodeToClientVersion +getShelleyNodeToClientVersion era globalNtcVersion = + case supportedNodeToClientVersions (Proxy @(CardanoBlock StandardCrypto)) Map.! globalNtcVersion of + HardForkNodeToClientEnabled _ np -> + case era of + Exp.ConwayEra -> + case projectNP conwayIndex np of + EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled + EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion + Exp.DijkstraEra -> + case projectNP dijkstraIndex np of + EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled + EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion + HardForkNodeToClientDisabled _ -> Left QueryCmdNodeToClientDisabled + +conwayIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x : xs1) x +conwayIndex = IS (IS (IS (IS (IS (IS IZ))))) + +dijkstraIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x'7 : x : xs1) x +dijkstraIndex = IS (IS (IS (IS (IS (IS (IS IZ)))))) + writeStakeAddressInfo :: StakeAddressInfoData -> Vary [FormatJson, FormatYaml] @@ -1212,7 +1242,7 @@ writeFilteredUTxOs era format mOutFile utxo = do . Vary.on (\FormatCborBin -> CBOR.serialize $ toLedgerUTxO (convert era) utxo) . Vary.on (\FormatCborHex -> Base16.encode . CBOR.serialize $ toLedgerUTxO (convert era) utxo) . Vary.on (\FormatJson -> Json.encodeJson utxo) - . Vary.on (\FormatText -> strictTextToLazyBytestring $ filteredUTxOsToText (convert era) utxo) + . Vary.on (\FormatText -> strictTextToLazyBytestring $ filteredUTxOsToText utxo) . Vary.on (\FormatYaml -> Json.encodeYaml utxo) $ Vary.exhaustiveCase ) @@ -1221,13 +1251,13 @@ writeFilteredUTxOs era format mOutFile utxo = do . newExceptT $ writeLazyByteStringOutput mOutFile output -filteredUTxOsToText :: Exp.Era era -> UTxO era -> Text -filteredUTxOsToText era (UTxO utxo) = do +filteredUTxOsToText :: UTxO era -> Text +filteredUTxOsToText (UTxO utxo) = do mconcat [ Text.unlines [title, Text.replicate (Text.length title + 2) "-"] - , Text.unlines $ case era of - Exp.ConwayEra -> - map (utxoToText era) $ toList utxo + , Text.unlines $ + map utxoToText $ + toList utxo ] where title :: Text @@ -1235,18 +1265,15 @@ filteredUTxOsToText era (UTxO utxo) = do " TxHash TxIx Amount" utxoToText - :: Exp.Era era - -> (TxIn, TxOut CtxUTxO era) + :: (TxIn, TxOut CtxUTxO era) -> Text -utxoToText sbe txInOutTuple = - case sbe of - Exp.ConwayEra -> - let (TxIn (TxId txhash) (TxIx index), TxOut _ value mDatum _) = txInOutTuple - in mconcat - [ Text.decodeLatin1 (hashToBytesAsHex txhash) - , textShowN 6 index - , " " <> printableValue value <> " + " <> Text.pack (show mDatum) - ] +utxoToText txInOutTuple = + let (TxIn (TxId txhash) (TxIx index), TxOut _ value mDatum _) = txInOutTuple + in mconcat + [ Text.decodeLatin1 (hashToBytesAsHex txhash) + , textShowN 6 index + , " " <> printableValue value <> " + " <> Text.pack (show mDatum) + ] where textShowN :: Show a => Int -> a -> Text textShowN len x = @@ -1901,12 +1928,13 @@ runQueryTreasuryValue } , Cmd.mOutFile } = conwayEraOnwardsConstraints eon $ do - L.AccountState (L.Coin treasury) _reserves <- + chainAccountState <- fromExceptTCli $ runQuery nodeConnInfo target $ queryAccountState eon - let output = LBS.pack $ show treasury + let (L.Coin treasury) = casTreasury chainAccountState + output = LBS.pack $ show treasury fromEitherCIOCli @(FileError ()) $ writeLazyByteStringOutput mOutFile output diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Script/Certificate/Read.hs b/cardano-cli/src/Cardano/CLI/EraBased/Script/Certificate/Read.hs index 83e94292ad..ec302eba75 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Script/Certificate/Read.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Script/Certificate/Read.hs @@ -114,6 +114,7 @@ obtainConstraints v = Api.PlutusScriptV1 -> id Api.PlutusScriptV2 -> id Api.PlutusScriptV3 -> id + Api.PlutusScriptV4 -> id getVersion :: forall era. Era era -> L.Version getVersion e = obtainCommonConstraints e $ L.eraProtVerLow @(LedgerEra era) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs index a7f2683add..e6d08e8c8a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs @@ -545,10 +545,12 @@ runTransactionBuildEstimateCmd -- TODO change type toShelleyLedgerPParamsShim :: Exp.Era era -> L.PParams (Exp.LedgerEra era) -> L.PParams (ShelleyLedgerEra era) toShelleyLedgerPParamsShim Exp.ConwayEra pp = pp +toShelleyLedgerPParamsShim Exp.DijkstraEra pp = pp fromShelleyLedgerPParamsShim :: Exp.Era era -> L.PParams (ShelleyLedgerEra era) -> L.PParams (Exp.LedgerEra era) fromShelleyLedgerPParamsShim Exp.ConwayEra pp = pp +fromShelleyLedgerPParamsShim Exp.DijkstraEra pp = pp getPoolDeregistrationInfo :: Exp.Era era @@ -574,14 +576,13 @@ getStakeDeregistrationInfo (Exp.Certificate cert) = getConwayDeregistrationInfo Exp.useEra cert getConwayDeregistrationInfo - :: Exp.Era era + :: forall era + . Exp.Era era -> L.TxCert (Exp.LedgerEra era) -> Maybe (StakeCredential, Lovelace) -getConwayDeregistrationInfo e cert = - case e of - Exp.ConwayEra -> do - (stakeCred, depositRefund) <- L.getUnRegDepositTxCert cert - return (fromShelleyStakeCredential stakeCred, depositRefund) +getConwayDeregistrationInfo e cert = do + (stakeCred, depositRefund) <- obtainCommonConstraints e $ L.getUnRegDepositTxCert cert + return (fromShelleyStakeCredential stakeCred, depositRefund) getExecutionUnitPrices :: CardanoEra era -> LedgerProtocolParameters era -> Maybe L.Prices getExecutionUnitPrices cEra (LedgerProtocolParameters pp) = diff --git a/cardano-cli/src/Cardano/CLI/Orphan.hs b/cardano-cli/src/Cardano/CLI/Orphan.hs index 029134166f..87de49f538 100644 --- a/cardano-cli/src/Cardano/CLI/Orphan.hs +++ b/cardano-cli/src/Cardano/CLI/Orphan.hs @@ -15,9 +15,8 @@ import Cardano.Api.Experimental as Exp import Cardano.Api.Ledger qualified as L import Cardano.CLI.Type.Error.ScriptDecodeError -import Cardano.Ledger.CertState qualified as L import Cardano.Ledger.Conway.Governance qualified as L -import Cardano.Ledger.State qualified as L +import Cardano.Ledger.Conway.State qualified as L import Control.Exception import Data.Aeson @@ -103,3 +102,4 @@ instance Error [(Word64, TxMetadataRangeError)] where -- Move to cardano-api instance Convert Era AllegraEraOnwards where convert Exp.ConwayEra = AllegraEraOnwardsConway + convert Exp.DijkstraEra = AllegraEraOnwardsDijkstra diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 25ce803b6a..89de70844e 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -894,3 +894,5 @@ deserialisePlutusScript bs = do FromSomeType (AsPlutusScript AsPlutusScriptV2) (AnyPlutusScript PlutusScriptV2) AnyPlutusScriptVersion PlutusScriptV3 -> FromSomeType (AsPlutusScript AsPlutusScriptV3) (AnyPlutusScript PlutusScriptV3) + AnyPlutusScriptVersion PlutusScriptV4 -> + FromSomeType (AsPlutusScript AsPlutusScriptV4) (AnyPlutusScript PlutusScriptV4) diff --git a/cardano-cli/src/Cardano/CLI/Type/Error/QueryCmdError.hs b/cardano-cli/src/Cardano/CLI/Type/Error/QueryCmdError.hs index dffe3476ef..c27e19a277 100644 --- a/cardano-cli/src/Cardano/CLI/Type/Error/QueryCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Type/Error/QueryCmdError.hs @@ -34,6 +34,7 @@ data QueryCmdError = QueryCmdWriteFileError !(FileError ()) | QueryCmdAcquireFailure !AcquiringFailure | QueryCmdEraMismatch !EraMismatch + | QueryCmdNodeToClientDisabled | QueryCmdPastHorizon !Consensus.PastHorizonException | QueryCmdSystemStartUnavailable | QueryCmdLeaderShipError !LeadershipError @@ -63,6 +64,7 @@ renderQueryCmdError = \case prettyError fileErr QueryCmdAcquireFailure acquireFail -> pshow acquireFail + QueryCmdNodeToClientDisabled -> "Node to client disabled" QueryCmdEraMismatch (EraMismatch ledgerEra queryEra) -> "\nAn error mismatch occurred." <> "\nSpecified query era: " diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/Run/Hash.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/Run/Hash.hs index 7e1923d869..59de0dea79 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/Run/Hash.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/Run/Hash.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE FlexibleContexts #-} + {- HLINT ignore "Use camelCase" -} module Test.Cli.Run.Hash where @@ -24,7 +26,9 @@ hprop_hash_trip = -- Test that @cardano-cli hash --text > file1@ and -- @cardano-cli --text --out-file file2@ yields -- similar @file1@ and @file2@ files. -hash_trip_fun :: (MonadTest m, MonadCatch m, MonadResource m, HasCallStack) => String -> m () +hash_trip_fun + :: (MonadTest m, MonadCatch m, MonadResource m, H.MonadBaseControl IO m, HasCallStack) + => String -> m () hash_trip_fun input = H.moduleWorkspace "tmp" $ \tempDir -> do hashFile <- noteTempFile tempDir "hash.txt" diff --git a/flake.lock b/flake.lock index 46cd08cf46..1a23da9fdc 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1752606079, - "narHash": "sha256-e9g0f4Pb/xTNGjD/ggubZeTT/lhqEzGnQWLh3ZY5mi8=", + "lastModified": 1754478832, + "narHash": "sha256-iJ0g2vuGh2f9Y9USYdaZnhBK3zz4zAE0IKh3Li2HQSM=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "6e80c1c3d4fd4100b4da313b9f7e537f1b701a78", + "rev": "71cbaa8ebe4514ea5292f48018b54a083768bea8", "type": "github" }, "original": { @@ -36,16 +36,16 @@ "blst": { "flake": false, "locked": { - "lastModified": 1691598027, - "narHash": "sha256-oqljy+ZXJAXEB/fJtmB8rlAr4UXM+Z2OkDa20gpILNA=", + "lastModified": 1739372843, + "narHash": "sha256-IlbNMLBjs/dvGogcdbWQIL+3qwy7EXJbIDpo4xBd4bY=", "owner": "supranational", "repo": "blst", - "rev": "3dd0f804b1819e5d03fb22ca2e6fac105932043a", + "rev": "8c7db7fe8d2ce6e76dc398ebd4d475c0ec564355", "type": "github" }, "original": { "owner": "supranational", - "ref": "v0.3.11", + "ref": "v0.3.14", "repo": "blst", "type": "github" } @@ -170,14 +170,14 @@ "type": "github" } }, - "hackageNix": { + "hackage-for-stackage": { "flake": false, "locked": { - "lastModified": 1750552134, - "narHash": "sha256-KC/e7tQOID9SgRkmH3BNlnPZ7sn3v5k5GyllLmSZicY=", + "lastModified": 1755131220, + "narHash": "sha256-GrhjTpoIWeCav/6MMvKrhbv/bMhZ8EJCHkpVRHO1C5I=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "a5d60b2d3c435cf26848e34b92e28f96e13cde7c", + "rev": "9eb72dd9477e042d1105d6883c97c6376e1da682", "type": "github" }, "original": { @@ -187,6 +187,38 @@ "type": "github" } }, + "hackage-internal": { + "flake": false, + "locked": { + "lastModified": 1750307553, + "narHash": "sha256-iiafNoeLHwlSLQTyvy8nPe2t6g5AV4PPcpMeH/2/DLs=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "f7867baa8817fab296528f4a4ec39d1c7c4da4f3", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackageNix": { + "flake": false, + "locked": { + "lastModified": 1755160441, + "narHash": "sha256-/nzrHgd2CUhlRp0c72nlcO9IlbMJQrgnqymL3PGjLhc=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "7eaeceb2d4bc5172c1a126bd867739e00641e889", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, "haskellNix": { "inputs": { "HTTP": "HTTP", @@ -199,8 +231,13 @@ "hackage": [ "hackageNix" ], + "hackage-for-stackage": "hackage-for-stackage", + "hackage-internal": "hackage-internal", + "hls": "hls", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", + "hls-2.10": "hls-2.10", + "hls-2.11": "hls-2.11", "hls-2.2": "hls-2.2", "hls-2.3": "hls-2.3", "hls-2.4": "hls-2.4", @@ -210,39 +247,50 @@ "hls-2.8": "hls-2.8", "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", "iserv-proxy": "iserv-proxy", "nixpkgs": [ "haskellNix", "nixpkgs-unstable" ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-2411": "nixpkgs-2411", + "nixpkgs-2505": "nixpkgs-2505", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1726275037, - "narHash": "sha256-q0+NlcOGV1eQRN1FjLpt5li6iyPQPeky37hwP5JLqVU=", + "lastModified": 1755132736, + "narHash": "sha256-s+a08wZ1iIMlJD75y1uOY7KVT4Rbc0PoJ8mYFThd4kg=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "a93d40302777a9ce268b3bc57caae3f7fdae1ce1", + "rev": "1000d92b78ac29bbdd966a2956384e011d758698", "type": "github" }, "original": { "owner": "input-output-hk", - "ref": "2024.09.15", "repo": "haskell.nix", "type": "github" } }, + "hls": { + "flake": false, + "locked": { + "lastModified": 1741604408, + "narHash": "sha256-tuq3+Ip70yu89GswZ7DSINBpwRprnWnl6xDYnS4GOsc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "682d6894c94087da5e566771f25311c47e145359", + "type": "github" + }, + "original": { + "owner": "haskell", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-1.10": { "flake": false, "locked": { @@ -277,6 +325,40 @@ "type": "github" } }, + "hls-2.10": { + "flake": false, + "locked": { + "lastModified": 1743069404, + "narHash": "sha256-q4kDFyJDDeoGqfEtrZRx4iqMVEC2MOzCToWsFY+TOzY=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "2318c61db3a01e03700bd4b05665662929b7fe8b", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.11": { + "flake": false, + "locked": { + "lastModified": 1747306193, + "narHash": "sha256-/MmtpF8+FyQlwfKHqHK05BdsxC9LHV70d/FiMM7pzBM=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "46ef4523ea4949f47f6d2752476239f1c6d806fe", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.11.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.2": { "flake": false, "locked": { @@ -399,16 +481,16 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1718469202, - "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "lastModified": 1719993701, + "narHash": "sha256-wy348++MiMm/xwtI9M3vVpqj2qfGgnDcZIGXw8sF1sA=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "rev": "90319a7e62ab93ab65a95f8f2bcf537e34dae76a", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.9.0.0", + "ref": "2.9.0.1", "repo": "haskell-language-server", "type": "github" } @@ -429,29 +511,6 @@ "type": "github" } }, - "hydra": { - "inputs": { - "nix": "nix", - "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": "nixlib" @@ -473,16 +532,16 @@ "iohkNix": { "inputs": { "blst": "blst", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "secp256k1": "secp256k1", "sodium": "sodium" }, "locked": { - "lastModified": 1734618971, - "narHash": "sha256-5StB/VhWHOj3zlBxshqVFa6cwAE0Mk/wxRo3eEfcy74=", + "lastModified": 1751421193, + "narHash": "sha256-rklXDo12dfukaSqcEyiYbze3ffRtTl2/WAAQCWfkGiw=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "dc900a3448e805243b0ed196017e8eb631e32240", + "rev": "64ca6f4c0c6db283e2ec457c775bce75173fb319", "type": "github" }, "original": { @@ -494,11 +553,11 @@ "iserv-proxy": { "flake": false, "locked": { - "lastModified": 1717479972, - "narHash": "sha256-7vE3RQycHI1YT9LHJ1/fUaeln2vIpYm6Mmn8FTpYeVo=", + "lastModified": 1755040634, + "narHash": "sha256-8W7uHpAIG8HhO3ig5OGHqvwduoye6q6dlrea1IrP2eI=", "owner": "stable-haskell", "repo": "iserv-proxy", - "rev": "2ed34002247213fc435d0062350b91bab920626e", + "rev": "1383d199a2c64f522979005d112b4fbdee38dd92", "type": "github" }, "original": { @@ -508,43 +567,6 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "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" - } - }, "nixlib": { "locked": { "lastModified": 1667696192, @@ -562,96 +584,16 @@ }, "nixpkgs": { "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-2003": { - "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, - "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, - "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, - "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, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", - "owner": "NixOS", + "lastModified": 1751071626, + "narHash": "sha256-/uHE/AD2qGq4QLigWAnBHiVvpVXB04XAfrOtw8JMv+Y=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "rev": "a47938d89bdf8e279ad432bd6a473cf4c430f48c", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", + "owner": "nixos", + "ref": "release-25.05", "repo": "nixpkgs", "type": "github" } @@ -690,11 +632,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": { @@ -704,50 +646,50 @@ "type": "github" } }, - "nixpkgs-regression": { + "nixpkgs-2411": { "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "lastModified": 1748037224, + "narHash": "sha256-92vihpZr6dwEMV6g98M5kHZIttrWahb9iRPBm1atcPk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "rev": "f09dede81861f3a83f7f06641ead34f02f37597f", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixpkgs-24.11-darwin", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-2505": { "locked": { - "lastModified": 1720181791, - "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "lastModified": 1748852332, + "narHash": "sha256-r/wVJWmLYEqvrJKnL48r90Wn9HWX9SHFt6s4LhuTh7k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "rev": "a8167f3cc2f991dd4d0055746df53dae5fd0c953", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixpkgs-25.05-darwin", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1684171562, - "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", - "owner": "nixos", + "lastModified": 1748856973, + "narHash": "sha256-RlTsJUvvr8ErjPBsiwrGbbHYW8XbB/oek0Gi78XdWKg=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "55af203d468a6f5032a519cba4f41acf5a74b638", + "rev": "e4b09e47ace7d87de083786b404bf232eb6c89d8", "type": "github" }, "original": { - "owner": "nixos", - "ref": "release-22.11", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -820,11 +762,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1726100060, - "narHash": "sha256-nvxogFYvwoUuqTHKyn1vcOuQFKEGGlXiTNzTDHeOImk=", + "lastModified": 1755130418, + "narHash": "sha256-vbBlIhuEGVPn9uDe0UQr88JsfwqFdxiyz6i19ljs/Ec=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "732fcc1460200a3050697a056a0fe9d460d0dbec", + "rev": "db94f1d0034dbbcd2314fa24ffbad7d86cf6bcea", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index babe0b6b3d..a8bbeaf738 100644 --- a/flake.nix +++ b/flake.nix @@ -3,11 +3,11 @@ inputs = { hackageNix = { - url = "github:input-output-hk/hackage.nix?ref=for-stackage"; + url = "github:input-output-hk/hackage.nix"; flake = false; }; haskellNix = { - url = "github:input-output-hk/haskell.nix?ref=2024.09.15"; + url = "github:input-output-hk/haskell.nix"; inputs.hackage.follows = "hackageNix"; }; nixpkgs.follows = "haskellNix/nixpkgs-unstable"; @@ -119,6 +119,7 @@ modules = [ ({pkgs, ...}: { packages.cardano-cli.configureFlags = ["--ghc-option=-Werror"] ++ gitRevFlag; + packages.basement.configureFlags = [ "--hsc2hs-option=--cflag=-Wno-int-conversion" ]; }) ({ pkgs,