Skip to content

Commit 3d33855

Browse files
committed
Update to LSM
1 parent 4c5b798 commit 3d33855

File tree

8 files changed

+73
-27
lines changed

8 files changed

+73
-27
lines changed

cabal.project

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ 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-11-05T09:40:54Z
16+
, hackage.haskell.org 2025-12-03T15:53:31Z
1717
, cardano-haskell-packages 2025-11-24T10:27:41Z
1818

1919
packages:
2020
cardano-api
2121
cardano-api-gen
2222
cardano-wasm
23-
cardano-rpc
23+
-- cardano-rpc
2424

2525
extra-packages: Cabal
2626

@@ -51,12 +51,6 @@ write-ghc-environment-files: always
5151
jobs: $ncpus
5252
semaphore: True
5353

54-
if impl (ghc >= 9.12)
55-
allow-newer:
56-
-- https://github.com/kapralVV/Unique/issues/11
57-
, Unique:hashable
58-
59-
6054
-- WASM compilation specific
6155

6256
if arch(wasm32)
@@ -164,3 +158,52 @@ if arch(wasm32)
164158
-- IMPORTANT
165159
-- Do NOT add more source-repository-package stanzas here unless they are strictly
166160
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
161+
source-repository-package
162+
type: git
163+
location: https://github.com/IntersectMBO/ouroboros-consensus
164+
tag: baf4ebbd924433543f8c5142b370b1061ac2e7bb
165+
--sha256: sha256-dCNFxrLF7MPqNRc9aIwl2AZpjHqw9dGerTudo7GQzao=
166+
subdir:
167+
ouroboros-consensus
168+
ouroboros-consensus-cardano
169+
ouroboros-consensus-diffusion
170+
171+
source-repository-package
172+
type: git
173+
location: https://github.com/IntersectMBO/cardano-ledger
174+
tag: fb09078fa55015c881303a2ddb609c024cec258f
175+
--sha256: sha256-9Y9CRiyMn0AWD+C4aNVMaJgrj3FDAYfCX4VrLvtoMaI=
176+
subdir:
177+
eras/allegra/impl
178+
eras/alonzo/impl
179+
eras/alonzo/test-suite
180+
eras/babbage/impl
181+
eras/conway/impl
182+
eras/dijkstra/impl
183+
eras/mary/impl
184+
eras/shelley/impl
185+
eras/shelley/test-suite
186+
eras/shelley-ma/test-suite
187+
libs/cardano-ledger-api
188+
libs/cardano-ledger-core
189+
libs/cardano-ledger-binary
190+
libs/cardano-protocol-tpraos
191+
libs/non-integral
192+
libs/small-steps
193+
libs/cardano-data
194+
libs/set-algebra
195+
libs/vector-map
196+
eras/byron/chain/executable-spec
197+
eras/byron/ledger/executable-spec
198+
eras/byron/ledger/impl
199+
eras/byron/crypto
200+
201+
-- Backported version of https://github.com/IntersectMBO/ouroboros-network/pull/5161
202+
source-repository-package
203+
type: git
204+
location: https://github.com/IntersectMBO/ouroboros-network
205+
tag: dfcb1f9c578ec8cd5114fea9696e7be6c9001323
206+
--sha256: sha256-omXPdi/T/f3gq9rOH20zX+x3WvaxlB704g07RF/13Nk=
207+
subdir:
208+
ouroboros-network-api
209+
ouroboros-network

cardano-api/cardano-api.cabal

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ library
129129
cardano-data >=1.0,
130130
cardano-ledger-allegra >=1.7,
131131
cardano-ledger-alonzo >=1.13,
132-
cardano-ledger-api ^>=1.12.1,
132+
cardano-ledger-api ^>=1.13,
133133
cardano-ledger-babbage >=1.11,
134134
cardano-ledger-binary >=1.6,
135135
cardano-ledger-byron >=1.2,
136136
cardano-ledger-conway >=1.19,
137-
cardano-ledger-core >=1.17 && <1.19,
137+
cardano-ledger-core >=1.17 && <1.20,
138138
cardano-ledger-dijkstra >=0.1,
139139
cardano-ledger-mary >=1.8,
140140
cardano-ledger-shelley >=1.16,
@@ -172,8 +172,8 @@ library
172172
ouroboros-network-framework,
173173
ouroboros-network-protocols >=0.15,
174174
parsec,
175-
plutus-core ^>=1.53,
176-
plutus-ledger-api ^>=1.53,
175+
plutus-core ^>=1.53.1,
176+
plutus-ledger-api ^>=1.53.1,
177177
pretty-simple,
178178
prettyprinter,
179179
prettyprinter-ansi-terminal,
@@ -318,7 +318,7 @@ library gen
318318

319319
build-depends:
320320
FailT,
321-
QuickCheck <2.16,
321+
QuickCheck,
322322
aeson >=1.5.6.0,
323323
base16-bytestring,
324324
bytestring,
@@ -359,7 +359,7 @@ test-suite cardano-api-test
359359
buildable: False
360360
build-depends:
361361
FailT,
362-
QuickCheck <2.16,
362+
QuickCheck,
363363
aeson >=1.5.6.0,
364364
base16-bytestring,
365365
bytestring,
@@ -371,7 +371,7 @@ test-suite cardano-api-test
371371
cardano-crypto-tests ^>=2.2,
372372
cardano-crypto-wrapper,
373373
cardano-ledger-alonzo,
374-
cardano-ledger-api ^>=1.12.1,
374+
cardano-ledger-api ^>=1.13,
375375
cardano-ledger-binary,
376376
cardano-ledger-conway,
377377
cardano-ledger-core >=1.14,
@@ -446,7 +446,7 @@ test-suite cardano-api-golden
446446
cardano-crypto-class,
447447
cardano-data >=1.0,
448448
cardano-ledger-alonzo,
449-
cardano-ledger-api ^>=1.12.1,
449+
cardano-ledger-api ^>=1.13,
450450
cardano-ledger-binary,
451451
cardano-ledger-core >=1.14,
452452
cardano-ledger-shelley,

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
@@ -311,7 +311,6 @@ type EraCommonConstraints era =
311311
, L.EraUTxO (LedgerEra era)
312312
, L.Value (LedgerEra era) ~ L.MaryValue
313313
, FromCBOR (ChainDepState (ConsensusProtocol era))
314-
, L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era)
315314
, PraosProtocolSupportsNode (ConsensusProtocol era)
316315
, ShelleyLedgerEra era ~ LedgerEra era
317316
, 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)