Skip to content

Commit 735e6c9

Browse files
authored
Merge pull request IntersectMBO#5516 from input-output-hk/td/8.6
Integrate latest ledger, consensus, api and cli for 8.6.0
2 parents 35b427b + 56db275 commit 735e6c9

File tree

31 files changed

+240
-105
lines changed

31 files changed

+240
-105
lines changed

bench/plutus-scripts-bench/plutus-scripts-bench.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: plutus-scripts-bench
3-
version: 1.0.0.4
3+
version: 1.0.0.5
44
synopsis: Plutus scripts used for benchmarking
55
description: Plutus scripts used for benchmarking.
66
category: Cardano,
@@ -72,7 +72,7 @@ library
7272
-- IOG dependencies
7373
--------------------------
7474
build-depends:
75-
, cardano-api ^>= 8.25
75+
, cardano-api ^>= 8.29
7676
, plutus-ledger-api >=1.0.0
7777
, plutus-tx >=1.0.0
7878
, plutus-tx-plugin >=1.0.0

bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SizedMetadata.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,20 @@ metadataSize :: forall era . IsShelleyBasedEra era => AsType era -> Maybe TxMeta
109109
metadataSize p m = dummyTxSize p m - dummyTxSize p Nothing
110110

111111
dummyTxSizeInEra :: forall era . IsShelleyBasedEra era => TxMetadataInEra era -> Int
112-
dummyTxSizeInEra metadata = case createAndValidateTransactionBody dummyTx of
112+
dummyTxSizeInEra metadata = case createAndValidateTransactionBody (cardanoEra @era) dummyTx of
113113
Right b -> BS.length $ serialiseToCBOR b
114114
Left err -> error $ "metaDataSize " ++ show err
115115
where
116116
dummyTx :: TxBodyContent BuildTx era
117-
dummyTx = defaultTxBodyContent
117+
dummyTx = defaultTxBodyContent (cardanoEra @era)
118118
& setTxIns
119119
[ ( TxIn "dbaff4e270cfb55612d9e2ac4658a27c79da4a5271c6f90853042d1403733810" (TxIx 0)
120120
, BuildTxWith $ KeyWitness KeyWitnessForSpending
121121
)
122122
]
123123
& setTxFee (mkTxFee 0)
124-
& setTxValidityRange (TxValidityNoLowerBound, mkTxValidityUpperBound 0)
124+
& setTxValidityLowerBound TxValidityNoLowerBound
125+
& setTxValidityUpperBound (mkTxValidityUpperBound 0)
125126
& setTxMetadata metadata
126127

127128
dummyTxSize :: forall era . IsShelleyBasedEra era => AsType era -> Maybe TxMetadata -> Int

bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/Submission.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import Cardano.Tracing.OrphanInstances.Shelley ()
4747

4848
import Ouroboros.Network.Protocol.TxSubmission2.Type (TokBlockingStyle (..))
4949

50-
import Cardano.Api
50+
import Cardano.Api hiding (Active)
5151
import Cardano.TxGenerator.Types (TPSRate, TxGenError)
5252

5353
import Cardano.Benchmarking.LogTypes

bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/SubmissionClient.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import Ouroboros.Network.Protocol.TxSubmission2.Client (ClientStIdle (
5959
import Ouroboros.Network.Protocol.TxSubmission2.Type (BlockingReplyList (..),
6060
TokBlockingStyle (..), TxSizeInBytes)
6161

62-
import Cardano.Api
62+
import Cardano.Api hiding (Active)
6363
import Cardano.Api.Shelley (fromShelleyTxId, toConsensusGenTx)
6464

6565
import Cardano.Logging

bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ addFund era wallet txIn lovelace keyName = do
111111
fundKey <- getEnvKeys keyName
112112
let
113113
mkOutValue :: forall era. IsShelleyBasedEra era => AsType era -> ActionM (InAnyCardanoEra TxOutValue)
114-
mkOutValue _ = return $ InAnyCardanoEra (cardanoEra @era) (lovelaceToTxOutValue lovelace)
114+
mkOutValue _ = return $ InAnyCardanoEra (cardanoEra @era) (lovelaceToTxOutValue (cardanoEra @era) lovelace)
115115
outValue <- withEra era mkOutValue
116116
addFundToWallet wallet txIn outValue fundKey
117117

@@ -187,7 +187,7 @@ queryRemoteProtocolParameters = do
187187
res <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) (QueryInEra eraInMode query)
188188
case res of
189189
Right (Right pp) -> do
190-
let pp' = fromLedgerPParams shelleyEra pp
190+
let pp' = fromLedgerPParams shelleyEra pp
191191
pparamsFile = "protocol-parameters-queried.json"
192192
liftIO $ BSL.writeFile pparamsFile $ prettyPrintOrdered pp'
193193
traceDebug $ "queryRemoteProtocolParameters : query result saved in: " ++ pparamsFile
@@ -296,7 +296,7 @@ evalGenerator generator txParams@TxGenTxParams{txParamFee = fee} era = do
296296
protocolParameters <- getProtocolParameters
297297
case convertToLedgerProtocolParameters (shelleyBasedEra @era) protocolParameters of
298298
Left err -> throwE (Env.TxGenError (ApiError err))
299-
Right ledgerParameters ->
299+
Right ledgerParameters ->
300300
case generator of
301301
SecureGenesis wallet genesisKeyName destKeyName -> do
302302
genesis <- getEnvGenesis

bench/tx-generator/src/Cardano/TxGenerator/Genesis.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ genesisInitialFunds :: forall era. IsShelleyBasedEra era
6161
-> ShelleyGenesis
6262
-> [(AddressInEra era, Lovelace)]
6363
genesisInitialFunds networkId g
64-
= [ ( shelleyAddressInEra $ makeShelleyAddress networkId (fromShelleyPaymentCredential pcr) (fromShelleyStakeReference stref)
64+
= [ ( shelleyAddressInEra (shelleyBasedEra @era) $
65+
makeShelleyAddress networkId (fromShelleyPaymentCredential pcr) (fromShelleyStakeReference stref)
6566
, fromShelleyLovelace coin
6667
)
6768
| (Addr _ pcr stref, coin) <- ListMap.toList $ sgInitialFunds g
@@ -122,14 +123,15 @@ mkGenesisTransaction :: forall era .
122123
mkGenesisTransaction key ttl fee txins txouts
123124
= bimap
124125
ApiError
125-
(`signShelleyTransaction` [WitnessGenesisUTxOKey key])
126-
(createAndValidateTransactionBody txBodyContent)
126+
(\b -> signShelleyTransaction (shelleyBasedEra @era) b [WitnessGenesisUTxOKey key])
127+
(createAndValidateTransactionBody (cardanoEra @era) txBodyContent)
127128
where
128-
txBodyContent = defaultTxBodyContent
129+
txBodyContent = defaultTxBodyContent (cardanoEra @era)
129130
& setTxIns (zip txins $ repeat $ BuildTxWith $ KeyWitness KeyWitnessForSpending)
130131
& setTxOuts txouts
131132
& setTxFee (mkTxFee fee)
132-
& setTxValidityRange (TxValidityNoLowerBound, mkTxValidityUpperBound ttl)
133+
& setTxValidityLowerBound TxValidityNoLowerBound
134+
& setTxValidityUpperBound (mkTxValidityUpperBound ttl)
133135

134136
castKey :: SigningKey PaymentKey -> SigningKey GenesisUTxOKey
135137
castKey (PaymentSigningKey skey) = GenesisUTxOSigningKey skey

bench/tx-generator/src/Cardano/TxGenerator/PureExample.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ genesisValue :: TxOutValue BabbageEra
7272

7373
(genesisTxIn, genesisValue) =
7474
( TxIn "900fc5da77a0747da53f7675cbb7d149d46779346dea2f879ab811ccc72a2162" (TxIx 0)
75-
, lovelaceToTxOutValue $ Lovelace 90000000000000
75+
, lovelaceToTxOutValue BabbageEra $ Lovelace 90000000000000
7676
)
7777

7878
genesisFund :: Fund

bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ preExecutePlutusV1 ::
101101
preExecutePlutusV1 protocolVersion_ (PlutusScript _ (PlutusScriptSerialised script)) datum redeemer costModel
102102
= fst $ runWriter $ runExceptT go -- for now, we discard warnings (:: PlutusCore.Evaluation.Machine.CostModelInterface.CostModelApplyWarn)
103103
where
104-
protocolVersion = uncurry PlutusV1.ProtocolVersion protocolVersion_
104+
protocolVersion = PlutusV1.MajorProtocolVersion (fst protocolVersion_)
105105
go
106106
= do
107107
evaluationContext <- firstExceptT PlutusError $
108108
PlutusV1.mkEvaluationContext (flattenCostModel costModel)
109109

110+
deserialisedScript <- firstExceptT PlutusError $ PlutusV1.deserialiseScript protocolVersion script
110111
exBudget <- firstExceptT PlutusError $
111112
hoistEither $
112-
snd $ PlutusV1.evaluateScriptCounting protocolVersion PlutusV1.Verbose evaluationContext script
113+
snd $ PlutusV1.evaluateScriptCounting protocolVersion PlutusV1.Verbose evaluationContext deserialisedScript
113114
[ toPlutusData datum
114115
, toPlutusData (getScriptData redeemer)
115116
, PlutusV1.toData dummyContext
@@ -146,18 +147,20 @@ preExecutePlutusV2 ::
146147
-> ScriptRedeemer
147148
-> CostModel
148149
-> Either TxGenError ExecutionUnits
149-
preExecutePlutusV2 protocolVersion_ (PlutusScript _ (PlutusScriptSerialised script)) datum redeemer costModel
150+
preExecutePlutusV2 (major, _minor) (PlutusScript _ (PlutusScriptSerialised script)) datum redeemer costModel
150151
= fst $ runWriter $ runExceptT go -- for now, we discard warnings (:: PlutusCore.Evaluation.Machine.CostModelInterface.CostModelApplyWarn)
151152
where
152-
protocolVersion = uncurry PlutusV2.ProtocolVersion protocolVersion_
153+
protocolVersion = PlutusV2.MajorProtocolVersion major
153154
go
154155
= do
155156
evaluationContext <- firstExceptT PlutusError $
156157
PlutusV2.mkEvaluationContext (flattenCostModel costModel)
157158

159+
deserialisedScript <- firstExceptT PlutusError $ PlutusV2.deserialiseScript protocolVersion script
160+
158161
exBudget <- firstExceptT PlutusError $
159162
hoistEither $
160-
snd $ PlutusV2.evaluateScriptCounting protocolVersion PlutusV2.Verbose evaluationContext script
163+
snd $ PlutusV2.evaluateScriptCounting protocolVersion PlutusV2.Verbose evaluationContext deserialisedScript
161164
[ toPlutusData datum
162165
, toPlutusData (getScriptData redeemer)
163166
, PlutusV2.toData dummyContext

bench/tx-generator/src/Cardano/TxGenerator/Tx.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE GADTs #-}
22
{-# LANGUAGE RankNTypes #-}
33
{-# LANGUAGE ScopedTypeVariables #-}
4+
{-# LANGUAGE TypeApplications #-}
45

56
module Cardano.TxGenerator.Tx
67
(module Cardano.TxGenerator.Tx)
@@ -167,16 +168,17 @@ genTx :: forall era. ()
167168
genTx _era ledgerParameters (collateral, collFunds) fee metadata inFunds outputs
168169
= bimap
169170
ApiError
170-
(\b -> (signShelleyTransaction b $ map WitnessPaymentKey allKeys, getTxId b))
171-
(createAndValidateTransactionBody txBodyContent)
171+
(\b -> (signShelleyTransaction (shelleyBasedEra @era) b $ map WitnessPaymentKey allKeys, getTxId b))
172+
(createAndValidateTransactionBody (cardanoEra @era) txBodyContent)
172173
where
173174
allKeys = mapMaybe getFundKey $ inFunds ++ collFunds
174-
txBodyContent = defaultTxBodyContent
175+
txBodyContent = defaultTxBodyContent (cardanoEra @era)
175176
& setTxIns (map (\f -> (getFundTxIn f, BuildTxWith $ getFundWitness f)) inFunds)
176177
& setTxInsCollateral collateral
177178
& setTxOuts outputs
178179
& setTxFee fee
179-
& setTxValidityRange (TxValidityNoLowerBound, defaultTxValidityUpperBound)
180+
& setTxValidityLowerBound TxValidityNoLowerBound
181+
& setTxValidityUpperBound (defaultTxValidityUpperBound (cardanoEra @era))
180182
& setTxMetadata metadata
181183
& setTxProtocolParams (BuildTxWith (Just ledgerParameters))
182184

bench/tx-generator/src/Cardano/TxGenerator/UTxO.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ mkUTxOVariant networkId key value
3434
, mkNewFund value
3535
)
3636
where
37-
mkTxOut v = TxOut (keyAddress @era networkId key) (lovelaceToTxOutValue v) TxOutDatumNone ReferenceScriptNone
37+
mkTxOut v = TxOut (keyAddress @era networkId key) (lovelaceToTxOutValue (cardanoEra @era) v) TxOutDatumNone ReferenceScriptNone
3838

3939
mkNewFund :: Lovelace -> TxIx -> TxId -> Fund
4040
mkNewFund val txIx txId = Fund $ InAnyCardanoEra (cardanoEra @era) $ FundInEra {
4141
_fundTxIn = TxIn txId txIx
4242
, _fundWitness = KeyWitness KeyWitnessForSpending
43-
, _fundVal = lovelaceToTxOutValue val
43+
, _fundVal = lovelaceToTxOutValue (cardanoEra @era ) val
4444
, _fundSigningKey = Just key
4545
}
4646

@@ -61,6 +61,7 @@ mkUTxOScript networkId (script, txOutDatum) witness value
6161
case scriptLanguageSupportedInEra (cardanoEra @era) lang of
6262
Nothing -> error "mkUtxOScript: scriptLanguageSupportedInEra==Nothing"
6363
Just{} -> makeShelleyAddressInEra
64+
(shelleyBasedEra @era)
6465
networkId
6566
(PaymentCredentialByScript $ hashScript script')
6667
NoStakeAddress
@@ -69,14 +70,14 @@ mkUTxOScript networkId (script, txOutDatum) witness value
6970
Nothing -> error "mkUtxOScript: scriptDataSupportedInEra==Nothing"
7071
Just tag -> TxOut
7172
plutusScriptAddr
72-
(lovelaceToTxOutValue v)
73+
(lovelaceToTxOutValue (cardanoEra @era) v)
7374
(TxOutDatumHash tag $ hashScriptDataBytes $ unsafeHashableScriptData txOutDatum)
7475
ReferenceScriptNone
7576

7677
mkNewFund :: Lovelace -> TxIx -> TxId -> Fund
7778
mkNewFund val txIx txId = Fund $ InAnyCardanoEra (cardanoEra @era) $ FundInEra {
7879
_fundTxIn = TxIn txId txIx
7980
, _fundWitness = witness
80-
, _fundVal = lovelaceToTxOutValue val
81+
, _fundVal = lovelaceToTxOutValue (cardanoEra @era) val
8182
, _fundSigningKey = Nothing
8283
}

bench/tx-generator/src/Cardano/TxGenerator/Utils.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ liftAnyEra f x = case x of
3434
keyAddress :: forall era. IsShelleyBasedEra era => NetworkId -> SigningKey PaymentKey -> AddressInEra era
3535
keyAddress networkId k
3636
= makeShelleyAddressInEra
37+
(shelleyBasedEra @era)
3738
networkId
3839
(PaymentCredentialByKey $ verificationKeyHash $ getVerificationKey k)
3940
NoStakeAddress
@@ -73,8 +74,8 @@ mkTxFee f = caseByronOrShelleyBasedEra
7374
-- | `mkTxValidityUpperBound` rules out needing the
7475
-- `TxValidityNoUpperBound` with the constraint of `IsShelleyBasedEra`.
7576
mkTxValidityUpperBound :: forall era. IsShelleyBasedEra era => SlotNo -> TxValidityUpperBound era
76-
mkTxValidityUpperBound =
77-
TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era))
77+
mkTxValidityUpperBound slotNo =
78+
TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era)) (Just slotNo)
7879

7980
-- | `mkTxOutValueAdaOnly` reinterprets the `Either` returned by
8081
-- `multiAssetSupportedInEra` with `TxOutValue` constructors.

bench/tx-generator/tx-generator.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: tx-generator
4-
version: 2.8
4+
version: 2.9
55
synopsis: A transaction workload generator for Cardano clusters
66
description: A transaction workload generator for Cardano clusters.
77
category: Cardano,
@@ -97,9 +97,9 @@ library
9797
, attoparsec
9898
, base16-bytestring
9999
, bytestring
100-
, cardano-api ^>= 8.25
100+
, cardano-api ^>= 8.29
101101
, cardano-binary
102-
, cardano-cli ^>= 8.12
102+
, cardano-cli ^>= 8.13
103103
, cardano-crypto-class
104104
, cardano-crypto-wrapper
105105
, cardano-data

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository cardano-haskell-packages
1414
-- you need to run if you change them
1515
index-state:
1616
, hackage.haskell.org 2023-09-01T22:19:16Z
17-
, cardano-haskell-packages 2023-10-05T21:00:00Z
17+
, cardano-haskell-packages 2023-10-31T17:10:09Z
1818

1919
packages:
2020
cardano-git-rev

cardano-node-chairman/cardano-node-chairman.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: cardano-node-chairman
4-
version: 8.5.0
4+
version: 8.6.0
55
synopsis: The cardano full node
66
description: The cardano full node.
77
category: Cardano,
@@ -44,7 +44,7 @@ executable cardano-node-chairman
4444
build-depends: cardano-api
4545
, cardano-crypto-class
4646
, cardano-git-rev
47-
, cardano-node ^>= 8.5
47+
, cardano-node ^>= 8.6
4848
, cardano-prelude
4949
, containers
5050
, contra-tracer
@@ -88,5 +88,5 @@ test-suite chairman-tests
8888
ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T
8989

9090
build-tool-depends: cardano-node:cardano-node
91-
, cardano-cli:cardano-cli ^>= 8.12
91+
, cardano-cli:cardano-cli ^>= 8.13
9292
, cardano-node-chairman:cardano-node-chairman

cardano-node/cardano-node.cabal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: cardano-node
4-
version: 8.5.0
4+
version: 8.6.0
55
synopsis: The cardano full node
66
description: The cardano full node.
77
category: Cardano,
@@ -137,7 +137,7 @@ library
137137
, async
138138
, base16-bytestring
139139
, bytestring
140-
, cardano-api ^>= 8.25
140+
, cardano-api ^>= 8.29
141141
, cardano-crypto-class
142142
, cardano-crypto-wrapper
143143
, cardano-git-rev
@@ -176,8 +176,8 @@ library
176176
, network-mux >= 0.4
177177
, nothunks
178178
, optparse-applicative-fork >= 0.18.1
179-
, ouroboros-consensus ^>= 0.12
180-
, ouroboros-consensus-cardano ^>= 0.10
179+
, ouroboros-consensus ^>= 0.13
180+
, ouroboros-consensus-cardano ^>= 0.11
181181
, ouroboros-consensus-diffusion ^>= 0.8
182182
, ouroboros-consensus-protocol
183183
, ouroboros-network-api
@@ -196,7 +196,7 @@ library
196196
, strict-stm
197197
, text >= 2.0
198198
, time
199-
, trace-dispatcher ^>= 2.3
199+
, trace-dispatcher ^>= 2.4
200200
, trace-forward ^>= 2.2
201201
, trace-resources ^>= 0.2.0.2
202202
, tracer-transformers

cardano-node/src/Cardano/Node/TraceConstraints.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, HasTxId
2525
import Ouroboros.Consensus.Node.NetworkProtocolVersion
2626
(HasNetworkProtocolVersion (BlockNodeToClientVersion, BlockNodeToNodeVersion))
2727
import Ouroboros.Consensus.Node.Run (RunNode, SerialiseNodeToNodeConstraints)
28-
import Ouroboros.Consensus.Protocol.Abstract (ValidationErr)
28+
import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr)
2929
import Ouroboros.Consensus.Shelley.Ledger.Mempool (GenTx, TxId)
3030

3131
import Ouroboros.Network.Block (Serialised)
@@ -53,6 +53,7 @@ type TraceConstraints blk =
5353
, ToObject (LedgerError blk)
5454
, ToObject (LedgerEvent blk)
5555
, ToObject (OtherHeaderEnvelopeError blk)
56+
, ToObject (SelectView (BlockProtocol blk))
5657
, ToObject (ValidationErr (BlockProtocol blk))
5758
, ToObject (CannotForge blk)
5859
, ToObject (ForgeStateUpdateError blk)
@@ -67,6 +68,7 @@ type TraceConstraints blk =
6768
, LogFormatting (LedgerUpdate blk)
6869
, LogFormatting (LedgerWarning blk)
6970
, LogFormatting (OtherHeaderEnvelopeError blk)
71+
, LogFormatting (SelectView (BlockProtocol blk))
7072
, LogFormatting (ValidationErr (BlockProtocol blk))
7173
, LogFormatting (CannotForge blk)
7274
, LogFormatting (ForgeStateUpdateError blk)

0 commit comments

Comments
 (0)