Skip to content

Commit 2109940

Browse files
authored
Update to ledger-api-1.6 and ledger-conway-1.9 (#352)
Next major ledger release should be soon-ish and will likely be not too different from what is being integrated here. - Most of the diff is due to integrating the new `TransitionConfig` concept from Ledger, see IntersectMBO/cardano-ledger#3737. - Every Shelley-based era `XEra c` has a `TransitionConfig (XEra c)` that contains all Genesis information up until this era. In particular, one can get all previous `TranslationContext`s and `TransitionConfig`s up until this era from it. - They can be used to register initial funds and staking (benchmarking features whose implementation has now been moved to Ledger), and to create initial Shelley ledger states for pure Shelley-based chains. - We could keep the current interface to `protocolInfoCardano` the same (by assembling a Conway `TransitionConfig` from the given `TranslationContext`s), but Ledger wants to push the construction of the `TransitionConfig` downwards to Node etc (eg in order to be able to add more information to it, or even consolidate all Genesis files into one). This also actually makes things easier on our end, as this allows us to simplify the `ProtocolTransitionParams`. - Ledger state serialization and the Conway Genesis file format changed.
2 parents 7cdbb15 + a1ae570 commit 2109940

File tree

87 files changed

+378
-676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+378
-676
lines changed

cabal.project

Lines changed: 1 addition & 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 2023-08-02T14:18:01Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2023-09-05T08:50:43Z
19+
, cardano-haskell-packages 2023-09-27T09:51:59Z
2020

2121
packages:
2222
ouroboros-consensus

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.
Lines changed: 20 additions & 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion6/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.

ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion7/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion7/GenTxId_Conway

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion10/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion11/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTxId_Conway

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

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Conway_LedgerTip

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

ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion9/GenTxId_Babbage

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ library
7878
Ouroboros.Consensus.Cardano.CanHardFork
7979
Ouroboros.Consensus.Cardano.Condense
8080
Ouroboros.Consensus.Cardano.Node
81-
Ouroboros.Consensus.Cardano.ShelleyBased
8281
Ouroboros.Consensus.Shelley.Crypto
8382
Ouroboros.Consensus.Shelley.Eras
8483
Ouroboros.Consensus.Shelley.HFEras
@@ -116,15 +115,14 @@ library
116115
, cardano-crypto
117116
, cardano-crypto-class
118117
, cardano-crypto-wrapper
119-
, cardano-data
120118
, cardano-ledger-allegra
121119
, cardano-ledger-alonzo ^>=1.4.1
122-
, cardano-ledger-api ^>=1.5
120+
, cardano-ledger-api ^>=1.6
123121
, cardano-ledger-babbage ^>=1.4.4
124122
, cardano-ledger-binary
125123
, cardano-ledger-byron
126-
, cardano-ledger-conway ^>=1.8
127-
, cardano-ledger-core ^>=1.6
124+
, cardano-ledger-conway ^>=1.9
125+
, cardano-ledger-core ^>=1.7
128126
, cardano-ledger-mary
129127
, cardano-ledger-shelley ^>=1.6
130128
, cardano-prelude
@@ -359,6 +357,7 @@ library unstable-cardano-testlib
359357
, cardano-crypto-class
360358
, cardano-crypto-wrapper
361359
, cardano-ledger-alonzo-test
360+
, cardano-ledger-api
362361
, cardano-ledger-byron
363362
, cardano-ledger-conway-test ^>=1.2.0.5
364363
, cardano-ledger-core:{cardano-ledger-core, testlib}
@@ -404,6 +403,7 @@ test-suite cardano-test
404403
, cardano-crypto-class
405404
, cardano-ledger-alonzo
406405
, cardano-ledger-alonzo-test
406+
, cardano-ledger-api
407407
, cardano-ledger-byron
408408
, cardano-ledger-core
409409
, cardano-ledger-shelley
@@ -484,6 +484,7 @@ library unstable-cardano-tools
484484
, cardano-crypto-wrapper
485485
, cardano-ledger-allegra
486486
, cardano-ledger-alonzo
487+
, cardano-ledger-api
487488
, cardano-ledger-babbage
488489
, cardano-ledger-binary
489490
, cardano-ledger-byron

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module Ouroboros.Consensus.Cardano (
88
, ProtocolCardano
99
, ProtocolShelley
1010
-- * Abstract over the various protocols
11+
, CardanoHardForkTriggers (..)
1112
, ProtocolParams (..)
12-
, ProtocolTransitionParams (..)
1313
, module X
1414
) where
1515

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import qualified Cardano.Ledger.Era as SL
3636
import Cardano.Ledger.Hashes (EraIndependentTxBody)
3737
import Cardano.Ledger.Keys (DSignable, Hash)
3838
import qualified Cardano.Ledger.Shelley.API as SL
39-
import qualified Cardano.Ledger.Shelley.Governance as SL
4039
import qualified Cardano.Ledger.Shelley.LedgerState as SL
4140
import Cardano.Ledger.Shelley.Translation
4241
(toFromByronTranslationContext)
@@ -61,7 +60,7 @@ import qualified Data.SOP.Tails as Tails
6160
import Data.Void
6261
import Data.Word
6362
import GHC.Generics (Generic)
64-
import Lens.Micro (Lens', (.~))
63+
import Lens.Micro ((.~))
6564
import Lens.Micro.Extras (view)
6665
import NoThunks.Class (NoThunks)
6766
import Ouroboros.Consensus.Block
@@ -727,17 +726,11 @@ translateLedgerStateBabbageToConwayWrapper =
727726
-> LedgerState (ShelleyBlock proto (BabbageEra c))
728727
patchGovState st =
729728
st { shelleyLedgerState = shelleyLedgerState st
730-
& newEpochStateGovStateL .~ newGovState
729+
& SL.newEpochStateGovStateL .~ newGovState
731730
}
732731
where
733-
-- next ledger release already provides this
734-
newEpochStateGovStateL ::
735-
Lens' (SL.NewEpochState era) (SL.GovState era)
736-
newEpochStateGovStateL =
737-
SL.nesEsL . SL.esLStateL . SL.lsUTxOStateL . SL.utxosGovStateL
738-
739732
newGovState =
740-
view newEpochStateGovStateL
733+
view SL.newEpochStateGovStateL
741734
. tickedShelleyLedgerState
742735
. applyChainTick
743736
(unwrapLedgerConfig cfgBabbage)

0 commit comments

Comments
 (0)