Skip to content

Commit f817a05

Browse files
committed
Update to LSM
1 parent a909b0b commit f817a05

File tree

8 files changed

+72
-26
lines changed

8 files changed

+72
-26
lines changed

cabal.project

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repository cardano-haskell-packages
1313
-- See CONTRIBUTING for information about these, including some Nix commands
1414
-- you need to run if you change them
1515
index-state:
16-
, hackage.haskell.org 2025-09-11T01:58:40Z
16+
, hackage.haskell.org 2025-10-23T13:39:53Z
1717
, cardano-haskell-packages 2025-10-21T11:16:53Z
1818

1919
packages:
@@ -55,12 +55,6 @@ write-ghc-environment-files: always
5555
jobs: $ncpus
5656
semaphore: True
5757

58-
if impl (ghc >= 9.12)
59-
allow-newer:
60-
-- https://github.com/kapralVV/Unique/issues/11
61-
, Unique:hashable
62-
63-
6458
-- WASM compilation specific
6559

6660
if arch(wasm32)
@@ -175,4 +169,53 @@ if arch(wasm32)
175169

176170
-- IMPORTANT
177171
-- Do NOT add more source-repository-package stanzas here unless they are strictly
178-
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
172+
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
173+
source-repository-package
174+
type: git
175+
location: https://github.com/IntersectMBO/ouroboros-consensus
176+
tag: 513d27d99b2486bf16d44a9f845ddb358244673f
177+
--sha256: 0brlyrvhqxcpya6frx1w5bwbpz5bjjsvxm26951vf2lxah8rx8hp
178+
subdir:
179+
ouroboros-consensus
180+
ouroboros-consensus-cardano
181+
ouroboros-consensus-diffusion
182+
183+
source-repository-package
184+
type: git
185+
location: https://github.com/IntersectMBO/cardano-ledger
186+
tag: fb09078fa55015c881303a2ddb609c024cec258f
187+
--sha256: sha256-9Y9CRiyMn0AWD+C4aNVMaJgrj3FDAYfCX4VrLvtoMaI=
188+
subdir:
189+
eras/allegra/impl
190+
eras/alonzo/impl
191+
eras/alonzo/test-suite
192+
eras/babbage/impl
193+
eras/conway/impl
194+
eras/dijkstra/impl
195+
eras/mary/impl
196+
eras/shelley/impl
197+
eras/shelley/test-suite
198+
eras/shelley-ma/test-suite
199+
libs/cardano-ledger-api
200+
libs/cardano-ledger-core
201+
libs/cardano-ledger-binary
202+
libs/cardano-protocol-tpraos
203+
libs/non-integral
204+
libs/small-steps
205+
libs/cardano-data
206+
libs/set-algebra
207+
libs/vector-map
208+
eras/byron/chain/executable-spec
209+
eras/byron/ledger/executable-spec
210+
eras/byron/ledger/impl
211+
eras/byron/crypto
212+
213+
-- Backported version of https://github.com/IntersectMBO/ouroboros-network/pull/5161
214+
source-repository-package
215+
type: git
216+
location: https://github.com/IntersectMBO/ouroboros-network
217+
tag: 1385b53cefb81e79553b6b0252537455833ea9c4
218+
--sha256: sha256-zZ7WsMfRs1fG16bmvI5vIh4fhQ8RGyEvYGLSWlrxpg0=
219+
subdir:
220+
ouroboros-network-api
221+
ouroboros-network

cardano-api/cardano-api.cabal

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ library
131131
cardano-ledger-binary >=1.6,
132132
cardano-ledger-byron >=1.2,
133133
cardano-ledger-conway >=1.19,
134-
cardano-ledger-core >=1.17 && <1.19,
134+
cardano-ledger-core >=1.17 && <1.20,
135135
cardano-ledger-dijkstra >=0.1,
136136
cardano-ledger-mary >=1.8,
137137
cardano-ledger-shelley >=1.16,
@@ -169,8 +169,8 @@ library
169169
ouroboros-network-framework,
170170
ouroboros-network-protocols >=0.15,
171171
parsec,
172-
plutus-core ^>=1.53,
173-
plutus-ledger-api ^>=1.53,
172+
plutus-core ^>=1.53.1,
173+
plutus-ledger-api ^>=1.53.1,
174174
pretty-simple,
175175
prettyprinter,
176176
prettyprinter-ansi-terminal,
@@ -311,7 +311,7 @@ library gen
311311

312312
build-depends:
313313
FailT,
314-
QuickCheck <2.16,
314+
QuickCheck,
315315
aeson >=1.5.6.0,
316316
base16-bytestring,
317317
bytestring,
@@ -352,7 +352,7 @@ test-suite cardano-api-test
352352
buildable: False
353353
build-depends:
354354
FailT,
355-
QuickCheck <2.16,
355+
QuickCheck,
356356
aeson >=1.5.6.0,
357357
base16-bytestring,
358358
bytestring,
@@ -450,8 +450,8 @@ test-suite cardano-api-golden
450450
hedgehog >=1.1,
451451
hedgehog-extras ^>=0.10,
452452
microlens,
453-
plutus-core ^>=1.53,
454-
plutus-ledger-api ^>=1.53,
453+
plutus-core ^>=1.53.1,
454+
plutus-ledger-api ^>=1.53.1,
455455
tasty,
456456
tasty-discover,
457457
tasty-hedgehog,

cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import Cardano.Binary
2929
import Cardano.Crypto.Hash.Blake2b qualified as Blake2b
3030
import Cardano.Crypto.Hash.Class qualified as C
3131
import Cardano.Crypto.VRF qualified as C
32-
import Cardano.Ledger.Allegra.Scripts qualified as L
3332
import Cardano.Ledger.Alonzo.Plutus.Context qualified as Plutus
3433
import Cardano.Ledger.Alonzo.Scripts qualified as L
3534
import Cardano.Ledger.Alonzo.Tx qualified as L
@@ -107,11 +106,9 @@ type AlonzoEraOnwardsConstraints era =
107106
, L.EraUTxO (ShelleyLedgerEra era)
108107
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody
109108
, L.MaryEraTxBody (ShelleyLedgerEra era)
110-
, L.NativeScript (ShelleyLedgerEra era) ~ L.Timelock (ShelleyLedgerEra era)
111109
, Plutus.EraPlutusContext (ShelleyLedgerEra era)
112110
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
113111
, L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era)
114-
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
115112
, L.Value (ShelleyLedgerEra era) ~ L.MaryValue
116113
, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
117114
, FromCBOR (DebugLedgerState era)
@@ -131,7 +128,7 @@ alonzoEraOnwardsConstraints = \case
131128
AlonzoEraOnwardsAlonzo -> id
132129
AlonzoEraOnwardsBabbage -> id
133130
AlonzoEraOnwardsConway -> id
134-
AlonzoEraOnwardsDijkstra -> const $ error "alonzoEraOnwardsConstraints: Dijkstra era not yet supported"
131+
AlonzoEraOnwardsDijkstra -> id
135132

136133
{-# DEPRECATED alonzoEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
137134
alonzoEraOnwardsToShelleyBasedEra :: AlonzoEraOnwards era -> ShelleyBasedEra era

cardano-api/src/Cardano/Api/Experimental/Era.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ type EraCommonConstraints era =
309309
, L.EraTxOut (LedgerEra era)
310310
, L.EraUTxO (LedgerEra era)
311311
, FromCBOR (ChainDepState (ConsensusProtocol era))
312-
, L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era)
313312
, PraosProtocolSupportsNode (ConsensusProtocol era)
314313
, ShelleyLedgerEra era ~ LedgerEra era
315314
, ToJSON (ChainDepState (ConsensusProtocol era))

cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Cardano.Binary qualified as CBOR
3737
import Cardano.Ledger.Alonzo.Scripts qualified as L
3838
import Cardano.Ledger.BaseTypes (Version)
3939
import Cardano.Ledger.Core qualified as L
40+
import Cardano.Ledger.Dijkstra.Scripts qualified as Dijkstra
4041
import Cardano.Ledger.Plutus.Language qualified as L
4142

4243
import Data.Text qualified as Text
@@ -96,7 +97,11 @@ convertToNewScriptWitness eon (Old.SimpleScriptWitness _ scriptOrRefInput) witne
9697

9798
convertTotimelock
9899
:: AlonzoEraOnwards era -> Old.SimpleScript -> L.NativeScript (ShelleyLedgerEra era)
99-
convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
100+
convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ case eon of
101+
AlonzoEraOnwardsAlonzo -> Old.toAllegraTimelock s
102+
AlonzoEraOnwardsBabbage -> Old.toAllegraTimelock s
103+
AlonzoEraOnwardsConway -> Old.toAllegraTimelock s
104+
AlonzoEraOnwardsDijkstra -> Dijkstra.upgradeTimelock (Old.toAllegraTimelock s)
100105

101106
createPlutusScriptDatum
102107
:: Witnessable thing era

cardano-api/src/Cardano/Api/LedgerState.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{-# LANGUAGE ScopedTypeVariables #-}
1111
{-# LANGUAGE TypeApplications #-}
1212
{-# LANGUAGE TypeOperators #-}
13+
{-# OPTIONS_GHC -Wno-x-ord-preserving-coercions #-}
1314

1415
module Cardano.Api.LedgerState
1516
( -- * Initialization / Accumulation
@@ -207,6 +208,7 @@ import Ouroboros.Consensus.Shelley.HFEras qualified as Shelley
207208
import Ouroboros.Consensus.Shelley.Ledger.Block qualified as Shelley
208209
import Ouroboros.Consensus.Shelley.Ledger.Ledger qualified as Shelley
209210
import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent))
211+
import Ouroboros.Consensus.Util (coerceMapKeys)
210212
import Ouroboros.Network.Block (blockNo)
211213
import Ouroboros.Network.Block qualified
212214
import Ouroboros.Network.Protocol.ChainSync.Client qualified as CS
@@ -2285,7 +2287,7 @@ getLedgerTablesUTxOValues sbe tbs =
22852287
-> Map TxIn (TxOut CtxUTxO era)
22862288
ejectTables idx =
22872289
let Consensus.LedgerTables (Ledger.ValuesMK values) = HFC.ejectLedgerTables idx tbs
2288-
in Map.mapKeys fromShelleyTxIn $ Map.map (fromShelleyTxOut sbe) values
2290+
in Map.mapKeys fromShelleyTxIn $ coerceMapKeys $ Map.map (fromShelleyTxOut sbe) values
22892291
in
22902292
case sbe of
22912293
ShelleyBasedEraShelley -> ejectTables (IS IZ)

cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ toShelleyScript (ScriptInEra langInEra (SimpleScript script)) =
12421242
SimpleScriptInAlonzo -> Alonzo.NativeScript (toAllegraTimelock script)
12431243
SimpleScriptInBabbage -> Alonzo.NativeScript (toAllegraTimelock script)
12441244
SimpleScriptInConway -> Alonzo.NativeScript (toAllegraTimelock script)
1245-
SimpleScriptInDijkstra -> Alonzo.NativeScript (toAllegraTimelock script)
1245+
SimpleScriptInDijkstra -> Alonzo.NativeScript (Dijkstra.upgradeTimelock (toAllegraTimelock script))
12461246
toShelleyScript
12471247
( ScriptInEra
12481248
langInEra

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)