Skip to content

Commit 9017d91

Browse files
authored
Merge pull request #6050 from IntersectMBO/nm/release-srp
Release 10.2.0
2 parents 6308039 + 91cf3f1 commit 9017d91

File tree

131 files changed

+5312
-3585
lines changed

Some content is hidden

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

131 files changed

+5312
-3585
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ configuration/cardano/mainnet-alonzo-genesis.json text eol=lf
55
configuration/cardano/mainnet-byron-genesis.json text eol=lf
66
configuration/cardano/mainnet-conway-genesis.json text eol=lf
77
configuration/cardano/mainnet-shelley-genesis.json text eol=lf
8+
cardano-testnet/test/cardano-testnet-test/files/sample-proposal-anchor text eol=lf
9+
cardano-testnet/test/cardano-testnet-test/files/sample-constitution-anchor text eol=lf

bench/locli/locli.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ library
119119
, hashable
120120
, optparse-applicative-fork >= 0.18.1
121121
, ouroboros-consensus
122-
, ouroboros-network-api ^>= 0.10
122+
, ouroboros-network-api ^>= 0.12
123123
, sop-core
124124
, split
125125
, sqlite-easy >= 1.1.0.1
@@ -189,7 +189,7 @@ test-suite test-locli
189189
build-depends: cardano-prelude
190190
, containers
191191
, hedgehog
192-
, hedgehog-extras ^>= 0.6.4
192+
, hedgehog-extras ^>= 0.7
193193
, locli
194194
, text
195195

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ library
8282
-- IOG dependencies
8383
--------------------------
8484
build-depends:
85-
, cardano-api ^>=10.1
86-
, plutus-ledger-api ^>=1.36
87-
, plutus-tx ^>=1.36
88-
, plutus-tx-plugin ^>=1.36
85+
, cardano-api ^>=10.6
86+
, plutus-ledger-api ^>=1.37
87+
, plutus-tx ^>=1.37
88+
, plutus-tx-plugin ^>=1.37
8989

9090
------------------------
9191
-- Non-IOG dependencies

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Cardano.Benchmarking.GeneratorTx.NodeToNode
1313
, benchmarkConnectTxSubmit
1414
) where
1515

16-
import Cardano.Prelude (forever, liftIO)
16+
import Cardano.Prelude (forever, liftIO, throwIO)
1717
import Prelude
1818

1919
import "contra-tracer" Control.Tracer (Tracer (..))
@@ -25,7 +25,8 @@ import Data.ByteString.Lazy (ByteString)
2525
import Data.Foldable (fold)
2626
import qualified Data.Map.Strict as Map
2727
import Data.Proxy (Proxy (..))
28-
import Data.Void (Void)
28+
import Data.Void (Void, absurd)
29+
import qualified Network.Mux as Mux
2930
import Network.Socket (AddrInfo (..))
3031
import System.Random (newStdGen)
3132

@@ -45,7 +46,7 @@ import Ouroboros.Network.DeltaQ (defaultGSV)
4546
import Ouroboros.Network.Driver (runPeer, runPeerWithLimits)
4647
import Ouroboros.Network.KeepAlive
4748
import Ouroboros.Network.Magic
48-
import Ouroboros.Network.Mux (MiniProtocolCb (..), MuxMode (..),
49+
import Ouroboros.Network.Mux (MiniProtocolCb (..),
4950
OuroborosApplication (..), OuroborosBundle, RunMiniProtocol (..))
5051
import Ouroboros.Network.NodeToClient (chainSyncPeerNull)
5152
import Ouroboros.Network.NodeToNode (NetworkConnectTracers (..))
@@ -84,8 +85,8 @@ benchmarkConnectTxSubmit
8485
-- ^ the particular txSubmission peer
8586
-> IO ()
8687

87-
benchmarkConnectTxSubmit EnvConsts { .. } handshakeTracer submissionTracer codecConfig networkMagic remoteAddr myTxSubClient =
88-
NtN.connectTo
88+
benchmarkConnectTxSubmit EnvConsts { .. } handshakeTracer submissionTracer codecConfig networkMagic remoteAddr myTxSubClient = do
89+
done <- NtN.connectTo
8990
(socketSnocket envIOManager)
9091
NetworkConnectTracers {
9192
nctMuxTracer = mempty,
@@ -94,6 +95,11 @@ benchmarkConnectTxSubmit EnvConsts { .. } handshakeTracer submissionTracer codec
9495
peerMultiplex
9596
(addrAddress <$> Nothing)
9697
(addrAddress remoteAddr)
98+
case done of
99+
Left err -> throwIO err
100+
Right choice -> case choice of
101+
Left () -> return ()
102+
Right void -> absurd void
97103
where
98104
ownPeerSharing = PeerSharingDisabled
99105
mkApp :: OuroborosBundle mode initiatorCtx responderCtx bs m a b
@@ -114,7 +120,7 @@ benchmarkConnectTxSubmit EnvConsts { .. } handshakeTracer submissionTracer codec
114120
peerMultiplex :: NtN.Versions NodeToNodeVersion
115121
NtN.NodeToNodeVersionData
116122
(OuroborosApplication
117-
'InitiatorMode
123+
'Mux.InitiatorMode
118124
(MinimalInitiatorContext NtN.RemoteAddress)
119125
(ResponderContext NtN.RemoteAddress)
120126
ByteString IO () Void)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import Cardano.Tracing.OrphanInstances.Consensus ()
4545
import Cardano.Tracing.OrphanInstances.Network ()
4646
import Cardano.Tracing.OrphanInstances.Shelley ()
4747

48-
import Ouroboros.Network.Protocol.TxSubmission2.Type (TokBlockingStyle (..))
48+
import Ouroboros.Network.Protocol.TxSubmission2.Type (SingBlockingStyle (..))
4949

5050
import Cardano.Api hiding (Active)
5151
import Cardano.TxGenerator.Types (TPSRate, TxGenError)
@@ -124,11 +124,11 @@ mkSubmissionSummary startTime reportsRefs
124124
txStreamSource :: forall era. MVar (StreamState (TxStream IO era)) -> TpsThrottle -> TxSource era
125125
txStreamSource streamRef tpsThrottle = Active worker
126126
where
127-
worker :: forall m blocking . MonadIO m => TokBlockingStyle blocking -> Req -> m (TxSource era, [Tx era])
127+
worker :: forall m blocking . MonadIO m => SingBlockingStyle blocking -> Req -> m (TxSource era, [Tx era])
128128
worker blocking req = do
129129
(done, txCount) <- case blocking of
130-
TokBlocking -> liftIO $ consumeTxsBlocking tpsThrottle req
131-
TokNonBlocking -> liftIO $ consumeTxsNonBlocking tpsThrottle req
130+
SingBlocking -> liftIO $ consumeTxsBlocking tpsThrottle req
131+
SingNonBlocking -> liftIO $ consumeTxsNonBlocking tpsThrottle req
132132
txList <- liftIO $ unFold txCount
133133
case done of
134134
Stop -> return (Exhausted, txList)

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Mempool (TxId (Sh
4646
import Ouroboros.Network.Protocol.TxSubmission2.Client (ClientStIdle (..),
4747
ClientStTxIds (..), ClientStTxs (..), TxSubmissionClient (..))
4848
import Ouroboros.Network.Protocol.TxSubmission2.Type (BlockingReplyList (..),
49-
NumTxIdsToAck (..), NumTxIdsToReq (..), TokBlockingStyle (..))
49+
NumTxIdsToAck (..), NumTxIdsToReq (..), SingBlockingStyle (..))
5050
import Ouroboros.Network.SizeInBytes
5151

5252
import Prelude (error, fail)
@@ -71,14 +71,14 @@ data TxSource era
7171
= Exhausted
7272
| Active (ProduceNextTxs era)
7373

74-
type ProduceNextTxs era = (forall m blocking . MonadIO m => TokBlockingStyle blocking -> Req -> m (TxSource era, [Tx era]))
74+
type ProduceNextTxs era = (forall m blocking . MonadIO m => SingBlockingStyle blocking -> Req -> m (TxSource era, [Tx era]))
7575

76-
produceNextTxs :: forall m blocking era . MonadIO m => TokBlockingStyle blocking -> Req -> LocalState era -> m (LocalState era, [Tx era])
76+
produceNextTxs :: forall m blocking era . MonadIO m => SingBlockingStyle blocking -> Req -> LocalState era -> m (LocalState era, [Tx era])
7777
produceNextTxs blocking req (txProducer, unack, stats) = do
7878
(newTxProducer, txList) <- produceNextTxs' blocking req txProducer
7979
return ((newTxProducer, unack, stats), txList)
8080

81-
produceNextTxs' :: forall m blocking era . MonadIO m => TokBlockingStyle blocking -> Req -> TxSource era -> m (TxSource era, [Tx era])
81+
produceNextTxs' :: forall m blocking era . MonadIO m => SingBlockingStyle blocking -> Req -> TxSource era -> m (TxSource era, [Tx era])
8282
produceNextTxs' _ _ Exhausted = return (Exhausted, [])
8383
produceNextTxs' blocking req (Active callback) = callback blocking req
8484

@@ -99,10 +99,10 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
9999
TxSubmissionClient $
100100
pure $ client (initialTxSource, UnAcked [], SubmissionThreadStats 0 0 0)
101101
where
102-
discardAcknowledged :: TokBlockingStyle a -> Ack -> LocalState era -> m (LocalState era)
102+
discardAcknowledged :: SingBlockingStyle a -> Ack -> LocalState era -> m (LocalState era)
103103
discardAcknowledged blocking (Ack ack) (txSource, UnAcked unAcked, stats) = do
104104
when (tokIsBlocking blocking && ack /= length unAcked) $ do
105-
let err = "decideAnnouncement: TokBlocking, but length unAcked != ack"
105+
let err = "decideAnnouncement: SingBlocking, but length unAcked != ack"
106106
traceWith bmtr (TraceBenchTxSubError err)
107107
fail (T.unpack err)
108108
let (stillUnacked, acked) = L.splitAtEnd ack unAcked
@@ -123,7 +123,7 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
123123

124124
requestTxIds :: forall blocking.
125125
LocalState era
126-
-> TokBlockingStyle blocking
126+
-> SingBlockingStyle blocking
127127
-> NumTxIdsToAck
128128
-> NumTxIdsToReq
129129
-> m (ClientStTxIds blocking (GenTxId CardanoBlock) (GenTx CardanoBlock) m ())
@@ -140,15 +140,15 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
140140
traceWith bmtr $ SubmissionClientUnAcked (getTxId . getTxBody <$> outs)
141141

142142
case blocking of
143-
TokBlocking -> case NE.nonEmpty newTxs of
143+
SingBlocking -> case NE.nonEmpty newTxs of
144144
Nothing -> do
145145
traceWith tr EndOfProtocol
146146
endOfProtocolCallback stats
147147
pure $ SendMsgDone ()
148148
(Just txs) -> pure $ SendMsgReplyTxIds
149149
(BlockingReply $ txToIdSize <$> txs)
150150
(client stateC)
151-
TokNonBlocking -> pure $ SendMsgReplyTxIds
151+
SingNonBlocking -> pure $ SendMsgReplyTxIds
152152
(NonBlockingReply $ txToIdSize <$> newTxs)
153153
(client stateC)
154154

@@ -196,17 +196,17 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
196196
fromGenTxId (Block.GenTxIdConway (Mempool.ShelleyTxId i)) = fromShelleyTxId i
197197
fromGenTxId _ = error "TODO: fix incomplete match"
198198

199-
tokIsBlocking :: TokBlockingStyle a -> Bool
199+
tokIsBlocking :: SingBlockingStyle a -> Bool
200200
tokIsBlocking = \case
201-
TokBlocking -> True
202-
TokNonBlocking -> False
201+
SingBlocking -> True
202+
SingNonBlocking -> False
203203

204-
reqIdsTrace :: Ack -> Req -> TokBlockingStyle a -> NodeToNodeSubmissionTrace
204+
reqIdsTrace :: Ack -> Req -> SingBlockingStyle a -> NodeToNodeSubmissionTrace
205205
reqIdsTrace ack req = \case
206-
TokBlocking -> ReqIdsBlocking ack req
207-
TokNonBlocking -> ReqIdsNonBlocking ack req
206+
SingBlocking -> ReqIdsBlocking ack req
207+
SingNonBlocking -> ReqIdsNonBlocking ack req
208208

209-
idListTrace :: ToAnnce tx -> TokBlockingStyle a -> NodeToNodeSubmissionTrace
209+
idListTrace :: ToAnnce tx -> SingBlockingStyle a -> NodeToNodeSubmissionTrace
210210
idListTrace (ToAnnce toAnn) = \case
211-
TokBlocking -> IdsListBlocking $ length toAnn
212-
TokNonBlocking -> IdsListNonBlocking $ length toAnn
211+
SingBlocking -> IdsListBlocking $ length toAnn
212+
SingNonBlocking -> IdsListNonBlocking $ length toAnn

bench/tx-generator/src/Cardano/Benchmarking/LogTypes.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import qualified Control.Concurrent.STM as STM (TVar)
5151
import Data.Text
5252
import Data.Time.Clock (DiffTime, NominalDiffTime)
5353
import GHC.Generics
54-
import Network.Mux (WithMuxBearer (..))
54+
import qualified Network.Mux as Mux
5555

5656
data AsyncBenchmarkControl =
5757
AsyncBenchmarkControl
@@ -149,7 +149,7 @@ data NodeToNodeSubmissionTrace
149149

150150
type SendRecvTxSubmission2 = TraceSendRecv (TxSubmission2 (GenTxId CardanoBlock) (GenTx CardanoBlock))
151151

152-
type SendRecvConnect = WithMuxBearer
152+
type SendRecvConnect = Mux.WithBearer
153153
RemoteConnectionId
154154
(TraceSendRecv (Handshake
155155
NodeToNodeVersion

bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE BangPatterns #-}
12
{-# LANGUAGE ConstraintKinds #-}
23
{-# LANGUAGE DataKinds #-}
34
{-# LANGUAGE DerivingStrategies #-}
@@ -123,17 +124,19 @@ initTxGenTracers mbForwarding = do
123124
prepareForwardingTracer = forM mbForwarding $
124125
\(iomgr, networkId, tracerSocket) -> do
125126
let forwardingConf = fromMaybe defaultForwarder (tcForwarder initialTraceConfig)
126-
(forwardSink :: ForwardSink TraceObject, dpStore) <-
127-
initForwarding iomgr forwardingConf (toNetworkMagic networkId) Nothing $ Just (tracerSocket, Initiator)
127+
(forwardSink :: ForwardSink TraceObject, dpStore, kickoffForwarder) <-
128+
initForwardingDelayed iomgr forwardingConf (toNetworkMagic networkId) Nothing $ Just (tracerSocket, Initiator)
128129

129130
-- we need to provide NodeInfo DataPoint, to forward generator's name
130131
-- to the acceptor application (for example, 'cardano-tracer').
131132
let
132133
dpt :: Trace IO DataPoint
133134
dpt = dataPointTracer dpStore
134135
nodeInfoTracer <- mkDataPointTracer dpt
135-
prepareGenInfo >>= traceWith nodeInfoTracer
136+
!genInfo <- prepareGenInfo
137+
traceWith nodeInfoTracer genInfo
136138

139+
kickoffForwarder
137140
pure $ forwardTracer forwardSink
138141

139142
prepareGenInfo :: IO NodeInfo

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ preExecutePlutusV3 (major, _minor) (PlutusScript _ (PlutusScriptSerialised (scri
259259
{ PlutusV3.txInfoInputs = []
260260
, PlutusV3.txInfoOutputs = []
261261
, PlutusV3.txInfoFee = 0
262-
, PlutusV3.txInfoMint = mempty
262+
, PlutusV3.txInfoMint = PlutusV3.emptyMintValue
263263
, PlutusV3.txInfoTxCerts = []
264264
, PlutusV3.txInfoWdrl = PlutusV3.unsafeFromList []
265265
, PlutusV3.txInfoValidRange = PlutusV3.always

bench/tx-generator/tx-generator.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ library
106106
, attoparsec-aeson
107107
, base16-bytestring
108108
, bytestring
109-
, cardano-api ^>= 10.1
109+
, cardano-api ^>= 10.6
110110
, cardano-binary
111-
, cardano-cli ^>= 10.1
111+
, cardano-cli ^>= 10.3
112112
, cardano-crypto-class
113113
, cardano-crypto-wrapper
114114
, cardano-data
@@ -158,6 +158,7 @@ library
158158
, transformers-except
159159
, unordered-containers
160160
, yaml
161+
, microlens
161162

162163
default-language: Haskell2010
163164
default-extensions: OverloadedStrings

0 commit comments

Comments
 (0)