Skip to content

Commit ad3720a

Browse files
committed
Account for cardano-ledger changes
* Update `index-state` and affected `cardano-ledger` version bounds: `cardano-ledger` requires `plutus-ledger-api ^>=1.26.0`, hence the `index-state` update * Use `StandardCrypto` in protocol info tests: `exampleConwayGenesis` was made monomorphic here: IntersectMBO/cardano-ledger#4252 The `Crypto c` constraint was removed and now it uses `StandardCrypto`. * Add `plutusV3CostModel` to `Conway` genesis file * Update `SupportsTwoPhaseValidation` instance for `Conway`: `ConwayUtxowFailure` was fixed to get rid of the possibility of injecting `UtxoFailure` in two separate ways (as seen in the code removed by this commit)
1 parent f25ea0b commit ad3720a

File tree

7 files changed

+67
-32
lines changed

7 files changed

+67
-32
lines changed

cabal.project

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ index-state:
1616
-- Bump this if you need newer packages from Hackage
1717
, hackage.haskell.org 2024-03-26T06:28:59Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2024-04-05T13:36:27Z
19+
, cardano-haskell-packages 2024-04-24T00:00:00Z
2020

2121
packages:
2222
ouroboros-consensus
@@ -26,6 +26,55 @@ packages:
2626
sop-extras
2727
strict-sop-core
2828

29+
source-repository-package
30+
type: git
31+
location: https://github.com/IntersectMBO/cardano-ledger
32+
tag: a6ee7925fa8070497658a2c8b3770dcd79017281
33+
--sha256: sha256-rigDlJcsTYa56/qa+W9TGBu2IbHLndmrHqVzcHoPTBI=
34+
subdir: eras/allegra/impl
35+
eras/alonzo/impl
36+
eras/alonzo/test-suite
37+
eras/babbage/impl
38+
eras/babbage/test-suite
39+
eras/conway/impl
40+
eras/conway/test-suite
41+
eras/mary/impl
42+
eras/shelley/impl
43+
eras/shelley/test-suite
44+
eras/shelley-ma/test-suite
45+
libs/cardano-ledger-api
46+
libs/cardano-ledger-core
47+
libs/cardano-ledger-binary
48+
libs/cardano-protocol-tpraos
49+
libs/non-integral
50+
libs/small-steps
51+
libs/cardano-data
52+
libs/set-algebra
53+
libs/vector-map
54+
eras/byron/chain/executable-spec
55+
eras/byron/ledger/executable-spec
56+
eras/byron/ledger/impl
57+
eras/byron/ledger/impl/test
58+
eras/byron/crypto
59+
eras/byron/crypto/test
60+
61+
source-repository-package
62+
type: git
63+
location: https://github.com/IntersectMBO/ouroboros-network
64+
tag: eb6ac9aa088aa3763e1163824a405fbb21303eb4
65+
--sha256: sha256-KZAxb6Lf9++JtoOTkapvCMpQOwz97zkOO30Bu8Asuak=
66+
subdir: cardano-ping
67+
monoidal-synchronisation
68+
network-mux
69+
ouroboros-network
70+
ouroboros-network-api
71+
ouroboros-network-framework
72+
ouroboros-network-mock
73+
ouroboros-network-protocols
74+
ouroboros-network-testing
75+
ntp-client
76+
cardano-client
77+
2978
-- We want to always build the test-suites and benchmarks
3079
tests: true
3180
benchmarks: true

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.

ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ library
134134
cardano-crypto-class,
135135
cardano-crypto-wrapper,
136136
cardano-ledger-allegra ^>=1.4,
137-
cardano-ledger-alonzo ^>=1.7,
137+
cardano-ledger-alonzo ^>=1.8,
138138
cardano-ledger-api ^>=1.9,
139-
cardano-ledger-babbage ^>=1.7,
139+
cardano-ledger-babbage ^>=1.8,
140140
cardano-ledger-binary ^>=1.3,
141141
cardano-ledger-byron ^>=1.0,
142-
cardano-ledger-conway ^>=1.13,
143-
cardano-ledger-core ^>=1.11,
142+
cardano-ledger-conway ^>=1.14,
143+
cardano-ledger-core ^>=1.12,
144144
cardano-ledger-mary ^>=1.5,
145145
cardano-ledger-shelley ^>=1.10,
146146
cardano-prelude,

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -353,30 +353,13 @@ instance SupportsTwoPhaseValidation (BabbageEra c) where
353353
instance SupportsTwoPhaseValidation (ConwayEra c) where
354354
isIncorrectClaimedFlag _ = \case
355355
SL.ConwayUtxowFailure
356-
( Babbage.AlonzoInBabbageUtxowPredFailure
357-
( Alonzo.ShelleyInAlonzoUtxowPredFailure
358-
( SL.UtxoFailure
359-
( Babbage.AlonzoInBabbageUtxoPredFailure
360-
( Alonzo.UtxosFailure
361-
( Conway.ValidationTagMismatch
362-
(Alonzo.IsValid _claimedFlag)
363-
_validationErrs
364-
)
365-
)
366-
)
367-
)
368-
)
369-
) -> True
370-
SL.ConwayUtxowFailure
371-
( Babbage.UtxoFailure
372-
( Babbage.AlonzoInBabbageUtxoPredFailure
373-
( Alonzo.UtxosFailure
356+
( Conway.UtxoFailure
357+
( Conway.UtxosFailure
374358
( Conway.ValidationTagMismatch
375359
(Alonzo.IsValid _claimedFlag)
376360
_validationErrs
377361
)
378362
)
379-
)
380363
) -> True
381364
_ -> False
382365

ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE NamedFieldPuns #-}
55
{-# LANGUAGE ScopedTypeVariables #-}
66
{-# LANGUAGE TypeApplications #-}
7+
{-# LANGUAGE TypeOperators #-}
78

89
-- | Utility functions to elaborate a Cardano 'ProtocolInfo' from certain parameters.
910
module Test.Consensus.Cardano.ProtocolInfo (
@@ -23,6 +24,7 @@ module Test.Consensus.Cardano.ProtocolInfo (
2324

2425
import qualified Cardano.Chain.Genesis as CC.Genesis
2526
import qualified Cardano.Chain.Update as CC.Update
27+
import Cardano.Ledger.Api.Era (StandardCrypto)
2628
import qualified Cardano.Ledger.Api.Transition as L
2729
import qualified Cardano.Ledger.BaseTypes as SL
2830
import qualified Cardano.Protocol.TPraos.OCert as SL
@@ -177,7 +179,7 @@ hardForkInto Conway =
177179
--
178180
mkSimpleTestProtocolInfo ::
179181
forall c
180-
. CardanoHardForkConstraints c
182+
. (CardanoHardForkConstraints c, c ~ StandardCrypto)
181183
=> Shelley.DecentralizationParam
182184
-- ^ Network decentralization parameter.
183185
-> SecurityParam
@@ -244,7 +246,7 @@ mkSimpleTestProtocolInfo
244246
--
245247
mkTestProtocolInfo ::
246248
forall m c
247-
. (CardanoHardForkConstraints c, IOLike m)
249+
. (CardanoHardForkConstraints c, IOLike m, c ~ StandardCrypto)
248250
=> (CoreNodeId, Shelley.CoreNode c)
249251
-- ^ Id of the node for which the protocol info will be elaborated.
250252
-> ShelleyGenesis c

ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/Cardano.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{-# LANGUAGE NamedFieldPuns #-}
66
{-# LANGUAGE ScopedTypeVariables #-}
77
{-# LANGUAGE TypeApplications #-}
8+
{-# LANGUAGE TypeOperators #-}
89

910
module Test.ThreadNet.Cardano (tests) where
1011

@@ -47,7 +48,6 @@ import Ouroboros.Consensus.Protocol.Praos.Translate ()
4748
import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol ()
4849
import Ouroboros.Consensus.Shelley.Node
4950
import Ouroboros.Consensus.Util.IOLike (IOLike)
50-
import Test.Consensus.Cardano.MockCrypto (MockCryptoCompatByron)
5151
import Test.Consensus.Cardano.ProtocolInfo (HardForkSpec (..),
5252
mkTestProtocolInfo)
5353
import Test.QuickCheck
@@ -73,7 +73,7 @@ import Test.Util.TestEnv
7373

7474
-- | Use 'MockCryptoCompatByron' so that bootstrap addresses and
7575
-- bootstrap witnesses are supported.
76-
type Crypto = MockCryptoCompatByron
76+
type Crypto = StandardCrypto
7777

7878
-- | The varying data of this test
7979
--
@@ -428,7 +428,7 @@ prop_simple_cardano_convergence TestSetup
428428
property $ maxRollbacks setupK >= finalIntersectionDepth
429429

430430
mkProtocolCardanoAndHardForkTxs ::
431-
forall c m. (IOLike m, CardanoHardForkConstraints c)
431+
forall c m. (IOLike m, c ~ StandardCrypto)
432432
-- Byron
433433
=> PBftParams
434434
-> CoreNodeId

ouroboros-consensus-cardano/test/tools-test/disk/config/conway-genesis.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"dRepDeposit": 0,
2626
"dRepActivity": 0,
2727
"minFeeRefScriptCostPerByte": 0,
28+
"plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
2829
"constitution": {
2930
"anchor": {
3031
"url": "",

0 commit comments

Comments
 (0)