Skip to content

Commit 2353df1

Browse files
Lucsanszkydisassembler
authored andcommitted
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 1fc53f3 commit 2353df1

File tree

8 files changed

+62
-31
lines changed

8 files changed

+62
-31
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Patch
2+
3+
- Update `SupportsTwoPhaseValidation` instance for `Conway`:
4+
`ConwayUtxowFailure` was changed upstream
5+
6+
### Non-Breaking
7+
8+
- Update ledger packages:
9+
- `cardano-ledger-alonzo`: `^>=1.8`
10+
- `cardano-ledger-babbage`: `^>=1.8`
11+
- `cardano-ledger-conway`: `^>=1.14`
12+
- `cardano-ledger-core`: `^>=1.12`
13+
- `cardano-ledger-mary`: `^>=1.6`
14+
- `cardano-ledger-shelley`: `^>=1.11`
15+
16+
### Breaking
17+
18+
- Add `c ~ StandardCrypto` constraint to:
19+
- `mkSimpleTestProtocolInfo`
20+
- `mkTestProtocolInfo`
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
-->
6+
7+
<!--
8+
### Patch
9+
10+
- A bullet item for the Patch category.
11+
12+
-->
13+
<!--
14+
### Non-Breaking
15+
16+
- A bullet item for the Non-Breaking category.
17+
18+
-->
19+
20+
### Breaking
21+
22+
- Remove `getProposedProtocolVersion` and `defaultGetProposedProtocolVersion`
23+
- Remove `ProtocolUpdate`, `UpdateProposal`, `UpdateState` and `protocolUpdates`
24+
- Add `pparamsUpdate`
25+
- Change `ShelleyLedgerUpdate` by replacing `ShelleyUpdatedProtocolUpdates` with `ShelleyUpdatedPParams`

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ 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,
144-
cardano-ledger-mary ^>=1.5,
145-
cardano-ledger-shelley ^>=1.10,
142+
cardano-ledger-conway ^>=1.14,
143+
cardano-ledger-core ^>=1.12,
144+
cardano-ledger-mary ^>=1.6,
145+
cardano-ledger-shelley ^>=1.11,
146146
cardano-prelude,
147147
cardano-protocol-tpraos ^>=1.2,
148148
cardano-slotting,

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/shelley/Ouroboros/Consensus/Shelley/Ledger/SupportsProtocol.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ instance
5454
protocolLedgerView _cfg = SL.currentLedgerView . tickedShelleyLedgerState
5555

5656
-- Extra context available in
57-
-- https://github.com/IntersectMBO/ouroboros-network/blob/master/ouroboros-consensus/docs/HardWonWisdom.md#why-doesnt-ledger-code-ever-return-pasthorizonexception
57+
-- https://github.com/IntersectMBO/ouroboros-consensus/blob/main/docs/website/contents/for-developers/HardWonWisdom.md#why-doesnt-ledger-code-ever-return-pasthorizonexception
5858
ledgerViewForecastAt cfg ledgerState = Forecast at $ \for ->
5959
if
6060
| NotOrigin for == at ->

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)