Skip to content

Commit 9be6ad5

Browse files
authored
Integrate Ledger for Node 9.0 (#1173)
2 parents 9b99d5c + 7c140c5 commit 9be6ad5

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
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 2024-06-23T23:01:13Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2024-06-26T21:39:58Z
19+
, cardano-haskell-packages 2024-07-02T04:22:05Z
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Non-Breaking
2+
3+
- Update ledger packages:
4+
- `cardano-ledger-alonzo`: `^>=1.10`
5+
- `cardano-ledger-babbage`: `^>=1.8.2`
6+
- `cardano-ledger-conway`: `^>=1.16.0`
7+
- `cardano-ledger-core`: `^>=1.13.2`
8+
9+
### Breaking
10+
11+
- Update N2C part of `latestReleasedNodeVersion` to `NodeToClientV_16`.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ library
135135
cardano-crypto-class,
136136
cardano-crypto-wrapper,
137137
cardano-ledger-allegra ^>=1.5,
138-
cardano-ledger-alonzo ^>=1.9,
138+
cardano-ledger-alonzo ^>=1.10,
139139
cardano-ledger-api ^>=1.9.2,
140-
cardano-ledger-babbage ^>=1.8.1,
140+
cardano-ledger-babbage ^>=1.8.2,
141141
cardano-ledger-binary ^>=1.3.3,
142142
cardano-ledger-byron ^>=1.0.1,
143-
cardano-ledger-conway ^>=1.15.1,
144-
cardano-ledger-core ^>=1.13,
143+
cardano-ledger-conway ^>=1.16.0,
144+
cardano-ledger-core ^>=1.13.2,
145145
cardano-ledger-mary ^>=1.6.1,
146146
cardano-ledger-shelley ^>=1.12,
147147
cardano-prelude,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ instance CardanoHardForkConstraints c
484484
, (NodeToClientV_16, CardanoNodeToClientVersion12)
485485
]
486486

487-
latestReleasedNodeVersion _prx = (Just NodeToNodeV_13, Just NodeToClientV_15)
487+
latestReleasedNodeVersion _prx = (Just NodeToNodeV_13, Just NodeToClientV_16)
488488

489489
{-------------------------------------------------------------------------------
490490
ProtocolInfo

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import qualified Cardano.Ledger.Api as L
4444
import Cardano.Ledger.Binary (Annotator (..), DecCBOR (..),
4545
EncCBOR (..), FromCBOR (..), FullByteString (..),
4646
ToCBOR (..), toPlainDecoder)
47+
import qualified Cardano.Ledger.Conway.Rules as SL
4748
import qualified Cardano.Ledger.Conway.UTxO as SL
4849
import qualified Cardano.Ledger.Core as SL (txIdTxBody)
4950
import Cardano.Ledger.Crypto (Crypto)
@@ -387,10 +388,9 @@ instance ( ShelleyCompatible p (ConwayEra c)
387388
txsBlockCapacity st =
388389
ConwayMeasure {
389390
alonzoMeasure = txsBlockCapacityAlonzo st
390-
, refScriptsSize =
391-
-- TODO use maxRefScriptSizePerBlock from
392-
-- https://github.com/IntersectMBO/cardano-ledger/pull/4450
393-
Mempool.ByteSize $ 2560 * 1024 -- 2.5 MB
391+
, refScriptsSize = Mempool.ByteSize $ fromIntegral $
392+
-- For post-Conway eras, this will become a protocol parameter.
393+
SL.maxRefScriptSizePerBlock
394394
}
395395

396396
{-------------------------------------------------------------------------------

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol/Cardano.hs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ mkConsensusProtocolCardano NodeByronProtocolConfiguration {
102102
npcConwayGenesisFileHash
103103
}
104104
NodeHardForkProtocolConfiguration {
105-
npcTestEnableDevelopmentHardForkEras,
106-
-- During testing of the Alonzo era, we conditionally declared that we
107-
-- knew about the Alonzo era. We do so only when a config option for
108-
-- testing development/unstable eras is used. This lets us include
105+
npcTestEnableDevelopmentHardForkEras = _,
106+
-- During testing of the latest unreleased era, we conditionally
107+
-- declared that we knew about it. We do so only when a config option
108+
-- for testing development/unstable eras is used. This lets us include
109109
-- not-yet-ready eras in released node versions without mainnet nodes
110110
-- prematurely advertising that they could hard fork into the new era.
111111
npcTestShelleyHardForkAtEpoch,
@@ -224,26 +224,23 @@ mkConsensusProtocolCardano NodeByronProtocolConfiguration {
224224
-- version that this node will declare that it understands, when it
225225
-- is in the Alonzo era. That is, it is the version of protocol
226226
-- /after/ Alonzo, i.e. Babbage.
227-
alonzoProtVer = ProtVer (natVersion @6) 0,
227+
alonzoProtVer = ProtVer (natVersion @7) 0,
228228
alonzoMaxTxCapacityOverrides =
229229
Mempool.mkOverrides Mempool.noOverridesMeasure
230230
}
231231
Consensus.ProtocolParamsBabbage {
232232
-- This is /not/ the Babbage protocol version. It is the protocol
233233
-- version that this node will declare that it understands, when it
234234
-- is in the Babbage era.
235-
Consensus.babbageProtVer = ProtVer (natVersion @7) 0,
235+
Consensus.babbageProtVer = ProtVer (natVersion @9) 0,
236236
Consensus.babbageMaxTxCapacityOverrides =
237237
Mempool.mkOverrides Mempool.noOverridesMeasure
238238
}
239239
Consensus.ProtocolParamsConway {
240240
-- This is /not/ the Conway protocol version. It is the protocol
241241
-- version that this node will declare that it understands, when it
242242
-- is in the Conway era.
243-
Consensus.conwayProtVer =
244-
if npcTestEnableDevelopmentHardForkEras
245-
then ProtVer (natVersion @9) 0 -- Advertise we can support Conway
246-
else ProtVer (natVersion @8) 0, -- Otherwise we only advertise we know about Babbage
243+
Consensus.conwayProtVer = ProtVer (natVersion @9) 0,
247244
Consensus.conwayMaxTxCapacityOverrides =
248245
Mempool.mkOverrides Mempool.noOverridesMeasure
249246
}

0 commit comments

Comments
 (0)