diff --git a/cabal.project b/cabal.project index 0f230c2e37..84571b52fe 100644 --- a/cabal.project +++ b/cabal.project @@ -13,14 +13,14 @@ 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-11-05T09:40:54Z + , hackage.haskell.org 2025-12-03T15:53:31Z , cardano-haskell-packages 2025-11-24T10:27:41Z packages: cardano-api cardano-api-gen cardano-wasm - cardano-rpc +-- cardano-rpc extra-packages: Cabal @@ -51,12 +51,6 @@ write-ghc-environment-files: always jobs: $ncpus semaphore: True -if impl (ghc >= 9.12) - allow-newer: - -- https://github.com/kapralVV/Unique/issues/11 - , Unique:hashable - - -- WASM compilation specific if arch(wasm32) @@ -164,3 +158,52 @@ if arch(wasm32) -- IMPORTANT -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: baf4ebbd924433543f8c5142b370b1061ac2e7bb + --sha256: sha256-dCNFxrLF7MPqNRc9aIwl2AZpjHqw9dGerTudo7GQzao= + subdir: + ouroboros-consensus + ouroboros-consensus-cardano + ouroboros-consensus-diffusion + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: fb09078fa55015c881303a2ddb609c024cec258f + --sha256: sha256-9Y9CRiyMn0AWD+C4aNVMaJgrj3FDAYfCX4VrLvtoMaI= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/alonzo/test-suite + eras/babbage/impl + eras/conway/impl + eras/dijkstra/impl + eras/mary/impl + eras/shelley/impl + eras/shelley/test-suite + eras/shelley-ma/test-suite + libs/cardano-ledger-api + libs/cardano-ledger-core + libs/cardano-ledger-binary + libs/cardano-protocol-tpraos + libs/non-integral + libs/small-steps + libs/cardano-data + libs/set-algebra + libs/vector-map + eras/byron/chain/executable-spec + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/byron/crypto + +-- Backported version of https://github.com/IntersectMBO/ouroboros-network/pull/5161 +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-network + tag: dfcb1f9c578ec8cd5114fea9696e7be6c9001323 + --sha256: sha256-omXPdi/T/f3gq9rOH20zX+x3WvaxlB704g07RF/13Nk= + subdir: + ouroboros-network-api + ouroboros-network diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index a3918bf26d..345cb5eafe 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -129,12 +129,12 @@ library cardano-data >=1.0, cardano-ledger-allegra >=1.7, cardano-ledger-alonzo >=1.13, - cardano-ledger-api ^>=1.12.1, + cardano-ledger-api ^>=1.13, cardano-ledger-babbage >=1.11, cardano-ledger-binary >=1.6, cardano-ledger-byron >=1.2, cardano-ledger-conway >=1.19, - cardano-ledger-core >=1.17 && <1.19, + cardano-ledger-core >=1.17 && <1.20, cardano-ledger-dijkstra >=0.1, cardano-ledger-mary >=1.8, cardano-ledger-shelley >=1.16, @@ -172,8 +172,8 @@ library ouroboros-network-framework, ouroboros-network-protocols >=0.15, parsec, - plutus-core ^>=1.53, - plutus-ledger-api ^>=1.53, + plutus-core ^>=1.53.1, + plutus-ledger-api ^>=1.53.1, pretty-simple, prettyprinter, prettyprinter-ansi-terminal, @@ -318,7 +318,7 @@ library gen build-depends: FailT, - QuickCheck <2.16, + QuickCheck, aeson >=1.5.6.0, base16-bytestring, bytestring, @@ -359,7 +359,7 @@ test-suite cardano-api-test buildable: False build-depends: FailT, - QuickCheck <2.16, + QuickCheck, aeson >=1.5.6.0, base16-bytestring, bytestring, @@ -371,7 +371,7 @@ test-suite cardano-api-test cardano-crypto-tests ^>=2.2, cardano-crypto-wrapper, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.12.1, + cardano-ledger-api ^>=1.13, cardano-ledger-binary, cardano-ledger-conway, cardano-ledger-core >=1.14, @@ -446,7 +446,7 @@ test-suite cardano-api-golden cardano-crypto-class, cardano-data >=1.0, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.12.1, + cardano-ledger-api ^>=1.13, cardano-ledger-binary, cardano-ledger-core >=1.14, cardano-ledger-shelley, diff --git a/cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs b/cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs index d48f1fa643..484b1cd4fc 100644 --- a/cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs +++ b/cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs @@ -29,7 +29,6 @@ import Cardano.Binary import Cardano.Crypto.Hash.Blake2b qualified as Blake2b import Cardano.Crypto.Hash.Class qualified as C import Cardano.Crypto.VRF qualified as C -import Cardano.Ledger.Allegra.Scripts qualified as L import Cardano.Ledger.Alonzo.Plutus.Context qualified as Plutus import Cardano.Ledger.Alonzo.Scripts qualified as L import Cardano.Ledger.Alonzo.Tx qualified as L @@ -107,11 +106,9 @@ type AlonzoEraOnwardsConstraints era = , L.EraUTxO (ShelleyLedgerEra era) , L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody , L.MaryEraTxBody (ShelleyLedgerEra era) - , L.NativeScript (ShelleyLedgerEra era) ~ L.Timelock (ShelleyLedgerEra era) , Plutus.EraPlutusContext (ShelleyLedgerEra era) , L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era) , L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era) - , L.ShelleyEraTxCert (ShelleyLedgerEra era) , L.Value (ShelleyLedgerEra era) ~ L.MaryValue , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) @@ -131,7 +128,7 @@ alonzoEraOnwardsConstraints = \case AlonzoEraOnwardsAlonzo -> id AlonzoEraOnwardsBabbage -> id AlonzoEraOnwardsConway -> id - AlonzoEraOnwardsDijkstra -> const $ error "alonzoEraOnwardsConstraints: Dijkstra era not yet supported" + AlonzoEraOnwardsDijkstra -> id {-# DEPRECATED alonzoEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-} alonzoEraOnwardsToShelleyBasedEra :: AlonzoEraOnwards era -> ShelleyBasedEra era diff --git a/cardano-api/src/Cardano/Api/Experimental/Era.hs b/cardano-api/src/Cardano/Api/Experimental/Era.hs index 8e7453e9f3..aa2c411a81 100644 --- a/cardano-api/src/Cardano/Api/Experimental/Era.hs +++ b/cardano-api/src/Cardano/Api/Experimental/Era.hs @@ -311,7 +311,6 @@ type EraCommonConstraints era = , L.EraUTxO (LedgerEra era) , L.Value (LedgerEra era) ~ L.MaryValue , FromCBOR (ChainDepState (ConsensusProtocol era)) - , L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era) , PraosProtocolSupportsNode (ConsensusProtocol era) , ShelleyLedgerEra era ~ LedgerEra era , ToJSON (ChainDepState (ConsensusProtocol era)) diff --git a/cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs b/cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs index 009a701f74..d0816ee016 100644 --- a/cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs +++ b/cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs @@ -37,6 +37,7 @@ import Cardano.Binary qualified as CBOR import Cardano.Ledger.Alonzo.Scripts qualified as L import Cardano.Ledger.BaseTypes (Version) import Cardano.Ledger.Core qualified as L +import Cardano.Ledger.Dijkstra.Scripts qualified as Dijkstra import Cardano.Ledger.Plutus.Language qualified as L import Data.Text qualified as Text @@ -96,7 +97,11 @@ convertToNewScriptWitness eon (Old.SimpleScriptWitness _ scriptOrRefInput) witne convertTotimelock :: AlonzoEraOnwards era -> Old.SimpleScript -> L.NativeScript (ShelleyLedgerEra era) -convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s +convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ case eon of + AlonzoEraOnwardsAlonzo -> Old.toAllegraTimelock s + AlonzoEraOnwardsBabbage -> Old.toAllegraTimelock s + AlonzoEraOnwardsConway -> Old.toAllegraTimelock s + AlonzoEraOnwardsDijkstra -> Dijkstra.upgradeTimelock (Old.toAllegraTimelock s) createPlutusScriptDatum :: Witnessable thing era diff --git a/cardano-api/src/Cardano/Api/LedgerState.hs b/cardano-api/src/Cardano/Api/LedgerState.hs index 1c32a76e80..9612d3e633 100644 --- a/cardano-api/src/Cardano/Api/LedgerState.hs +++ b/cardano-api/src/Cardano/Api/LedgerState.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} +{-# OPTIONS_GHC -Wno-x-ord-preserving-coercions #-} module Cardano.Api.LedgerState ( -- * Initialization / Accumulation @@ -207,6 +208,7 @@ import Ouroboros.Consensus.Shelley.HFEras qualified as Shelley import Ouroboros.Consensus.Shelley.Ledger.Block qualified as Shelley import Ouroboros.Consensus.Shelley.Ledger.Ledger qualified as Shelley import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent)) +import Ouroboros.Consensus.Util (coerceMapKeys) import Ouroboros.Network.Block (blockNo) import Ouroboros.Network.Block qualified import Ouroboros.Network.Protocol.ChainSync.Client qualified as CS @@ -2285,7 +2287,7 @@ getLedgerTablesUTxOValues sbe tbs = -> Map TxIn (TxOut CtxUTxO era) ejectTables idx = let Consensus.LedgerTables (Ledger.ValuesMK values) = HFC.ejectLedgerTables idx tbs - in Map.mapKeys fromShelleyTxIn $ Map.map (fromShelleyTxOut sbe) values + in Map.mapKeys fromShelleyTxIn $ coerceMapKeys $ Map.map (fromShelleyTxOut sbe) values in case sbe of ShelleyBasedEraShelley -> ejectTables (IS IZ) diff --git a/cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs b/cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs index 8c30f37b44..9de29c612d 100644 --- a/cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs +++ b/cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs @@ -1242,7 +1242,7 @@ toShelleyScript (ScriptInEra langInEra (SimpleScript script)) = SimpleScriptInAlonzo -> Alonzo.NativeScript (toAllegraTimelock script) SimpleScriptInBabbage -> Alonzo.NativeScript (toAllegraTimelock script) SimpleScriptInConway -> Alonzo.NativeScript (toAllegraTimelock script) - SimpleScriptInDijkstra -> Alonzo.NativeScript (toAllegraTimelock script) + SimpleScriptInDijkstra -> Alonzo.NativeScript (Dijkstra.upgradeTimelock (toAllegraTimelock script)) toShelleyScript ( ScriptInEra langInEra diff --git a/flake.lock b/flake.lock index 981af01f0a..23970feff9 100644 --- a/flake.lock +++ b/flake.lock @@ -281,11 +281,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1764721618, - "narHash": "sha256-qayd4uIJ1PU3TWnm4ExC8WmLBUo8/4LL9QEWngiaz24=", + "lastModified": 1764932461, + "narHash": "sha256-+aMywxHRjMT6UySqNRuE3Q/LGENW2j8E+PDGS5s+Xl8=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "1b943b3cd91ffdaa62da6fe5870b7c7cfca30729", + "rev": "f964c738b8ff95bdd2f30364b39fd360de9f7ba1", "type": "github" }, "original": {