Skip to content

Commit ddbd238

Browse files
committed
Update dependencies to node 8.2.0-pre
1 parent 1dc84fd commit ddbd238

Some content is hidden

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

45 files changed

+545
-350
lines changed

cabal.project

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ repository cardano-haskell-packages
1010
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
1111

1212
index-state:
13-
, hackage.haskell.org 2023-07-10T14:55:34Z
14-
, cardano-haskell-packages 2023-07-16T00:00:00Z
13+
, hackage.haskell.org 2023-07-27T01:34:31Z
14+
, cardano-haskell-packages 2023-07-27T07:20:05Z
1515

1616
packages:
1717
cardano-db
@@ -21,11 +21,13 @@ packages:
2121
cardano-smash-server
2222
cardano-chain-gen
2323

24+
allow-newer:
25+
text,
26+
ekg-forward
2427

2528
constraints:
2629
persistent-postgresql >= 2.11.0.1,
27-
optparse-applicative >= 0.16.0 && < 0.16.1,
28-
cardano-api < 8.8.1
30+
optparse-applicative >= 0.16.0 && < 0.16.1
2931

3032
package cardano-db
3133
ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -Wunused-imports -Wunused-packages
@@ -69,8 +71,8 @@ package snap-server
6971
source-repository-package
7072
type: git
7173
location: https://github.com/input-output-hk/cardano-node
72-
tag: 6f79e5c3ea109a70cd01910368e011635767305a
73-
--sha256: 1yaf3jk6rgmivgi730ljd8sjpdnzasncxnj8ypgzcdshyp1id25q
74+
tag: 408d8ae10a2792ace3a822e312433960e47de4e9
75+
--sha256: sha256-LF8whQABPpSkmyuJrTlK5barYuTiG609yGusHD0fDYQ=
7476
subdir:
7577
cardano-git-rev
7678
cardano-node

cardano-chain-gen/cardano-chain-gen.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ test-suite cardano-chain-gen
216216
, text
217217
, transformers
218218
, transformers-except
219-
, tree-diff
220219
, tasty-hunit
221220
, monad-logger
222221
, ouroboros-consensus

cardano-chain-gen/src/Cardano/Mock/Forging/Interpreter.hs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ import Ouroboros.Consensus.Ledger.SupportsMempool (
9797
import Ouroboros.Consensus.Ledger.SupportsProtocol (ledgerViewForecastAt)
9898
import Ouroboros.Consensus.Node.ProtocolInfo (
9999
ProtocolInfo,
100-
pInfoBlockForging,
101100
pInfoConfig,
102101
pInfoInitLedger,
103102
)
@@ -114,22 +113,25 @@ import Ouroboros.Consensus.Shelley.Ledger (ShelleyBlock, Ticked, shelleyLedgerSt
114113
import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Consensus
115114
import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol ()
116115
import qualified Ouroboros.Consensus.TypeFamilyWrappers as Consensus
116+
import Control.Concurrent.Class.MonadSTM.Strict (
117+
StrictTVar,
118+
atomically,
119+
newTVarIO,
120+
readTVarIO,
121+
modifyTVar,
122+
swapTVar,
123+
)
117124
import Ouroboros.Consensus.Util.IOLike (
118125
Exception,
119126
NoThunks,
120-
StrictMVar,
121-
modifyMVar,
122-
newMVar,
123-
readMVar,
124-
swapMVar,
125127
)
126128
import Ouroboros.Consensus.Util.Orphans ()
127129
import Ouroboros.Network.Block
128130
import System.Directory (doesPathExist)
129131

130132
data Interpreter = Interpreter
131133
{ interpForging :: !(Map Int (BlockForging IO CardanoBlock))
132-
, interpState :: !(StrictMVar IO InterpreterState)
134+
, interpState :: !(StrictTVar IO InterpreterState)
133135
, interpTracerForge :: !(Tracer IO (ForgeStateInfo CardanoBlock))
134136
, interpTopLeverConfig :: !(TopLevelConfig CardanoBlock)
135137
, interpFingerMode :: !FingerprintMode
@@ -221,18 +223,18 @@ finalizeFingerprint inter = do
221223
_ -> pure ()
222224

223225
initInterpreter ::
224-
ProtocolInfo IO CardanoBlock ->
226+
ProtocolInfo CardanoBlock ->
227+
[BlockForging IO CardanoBlock] ->
225228
Tracer IO (ForgeStateInfo CardanoBlock) ->
226229
Maybe FilePath ->
227230
IO Interpreter
228-
initInterpreter pinfo traceForge mFingerprintFile = do
229-
forging <- pInfoBlockForging pinfo
231+
initInterpreter pinfo forging traceForge mFingerprintFile = do
230232
let topLeverCfg = pInfoConfig pinfo
231233
let initSt = pInfoInitLedger pinfo
232234
let ledgerView = mkForecast topLeverCfg initSt
233235
(mode, fingerprint) <- mkFingerprint mFingerprintFile
234236
stvar <-
235-
newMVar $
237+
newTVarIO $
236238
InterpreterState
237239
{ istChain = initChainDB topLeverCfg initSt
238240
, istForecast = ledgerView
@@ -252,13 +254,14 @@ initInterpreter pinfo traceForge mFingerprintFile = do
252254
}
253255

254256
withInterpreter ::
255-
ProtocolInfo IO CardanoBlock ->
257+
ProtocolInfo CardanoBlock ->
258+
[BlockForging IO CardanoBlock] ->
256259
Tracer IO (ForgeStateInfo CardanoBlock) ->
257260
Maybe FilePath ->
258261
(Interpreter -> IO a) ->
259262
IO a
260-
withInterpreter p t f action = do
261-
interp <- initInterpreter p t f
263+
withInterpreter p f t mf action = do
264+
interp <- initInterpreter p f t mf
262265
a <- action interp
263266
finalizeFingerprint interp
264267
pure a
@@ -296,8 +299,8 @@ forgeWithStakeCreds inter = do
296299

297300
forgeNextAfter :: Interpreter -> Word64 -> [TxEra] -> IO CardanoBlock
298301
forgeNextAfter interpreter skipSlots txes = do
299-
modifyMVar (interpState interpreter) $ \st ->
300-
pure (st {istSlot = istSlot st + SlotNo skipSlots}, ())
302+
atomically $ modifyTVar (interpState interpreter) $ \st ->
303+
(st {istSlot = istSlot st + SlotNo skipSlots})
301304
forgeNextFindLeader interpreter txes
302305

303306
forgeNextFindLeader :: Interpreter -> [TxEra] -> IO CardanoBlock
@@ -324,7 +327,7 @@ forgeNextLeaders interpreter txes possibleLeaders = do
324327
, istNextBlockNo = blockNo blk + 1
325328
, istFingerprint = fingerprint
326329
}
327-
void $ swapMVar (interpState interpreter) newInterState
330+
void $ atomically $ swapTVar (interpState interpreter) newInterState
328331
pure blk
329332
where
330333
cfg :: TopLevelConfig CardanoBlock
@@ -457,13 +460,13 @@ rollbackInterpreter interpreter pnt = do
457460
, istNextBlockNo = nextBlock
458461
, istFingerprint = istFingerprint interState
459462
}
460-
void $ swapMVar (interpState interpreter) newInterState
463+
void $ atomically $ swapTVar (interpState interpreter) newInterState
461464
where
462465
cfg :: TopLevelConfig CardanoBlock
463466
cfg = interpTopLeverConfig interpreter
464467

465468
getCurrentInterpreterState :: Interpreter -> IO InterpreterState
466-
getCurrentInterpreterState = readMVar . interpState
469+
getCurrentInterpreterState = readTVarIO . interpState
467470

468471
getCurrentLedgerState :: Interpreter -> IO (ExtLedgerState CardanoBlock)
469472
getCurrentLedgerState = fmap (currentState . istChain) . getCurrentInterpreterState
@@ -484,7 +487,7 @@ getCurrentEpoch inter = do
484487
_ -> throwIO UnexpectedEra
485488

486489
getCurrentSlot :: Interpreter -> IO SlotNo
487-
getCurrentSlot interp = istSlot <$> readMVar (interpState interp)
490+
getCurrentSlot interp = istSlot <$> readTVarIO (interpState interp)
488491

489492
withBabbageLedgerState ::
490493
Interpreter ->

cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Alonzo.hs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ import Cardano.Ledger.Hashes
5151
import Cardano.Ledger.Keys
5252
import Cardano.Ledger.Mary.Value
5353
import Cardano.Ledger.Shelley.TxBody (
54-
DCert (..),
55-
PoolCert (..),
5654
PoolMetadata (..),
5755
PoolParams (..),
5856
StakePoolRelay (..),
@@ -73,6 +71,7 @@ import Lens.Micro
7371
import Ouroboros.Consensus.Cardano.Block (LedgerState, StandardAlonzo)
7472
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto)
7573
import Ouroboros.Consensus.Shelley.Ledger (ShelleyBlock)
74+
import Cardano.Ledger.Shelley.TxCert
7675

7776
type AlonzoUTxOIndex = UTxOIndex StandardAlonzo
7877

@@ -84,7 +83,7 @@ consTxBody ::
8483
StrictSeq (AlonzoTxOut StandardAlonzo) ->
8584
Coin ->
8685
MultiAsset StandardCrypto ->
87-
[DCert StandardCrypto] ->
86+
[ShelleyTxCert StandardAlonzo] ->
8887
Withdrawals StandardCrypto ->
8988
AlonzoTxBody StandardAlonzo
9089
consTxBody ins cols outs fees minted certs wdrl =
@@ -124,7 +123,7 @@ consPaymentTxBody ::
124123
AlonzoTxBody StandardAlonzo
125124
consPaymentTxBody ins cols outs fees minted = consTxBody ins cols outs fees minted mempty (Withdrawals mempty)
126125

127-
consCertTxBody :: [DCert StandardCrypto] -> Withdrawals StandardCrypto -> AlonzoTxBody StandardAlonzo
126+
consCertTxBody :: [ShelleyTxCert StandardAlonzo] -> Withdrawals StandardCrypto -> AlonzoTxBody StandardAlonzo
128127
consCertTxBody = consTxBody mempty mempty mempty (Coin 0) mempty
129128

130129
mkPaymentTx ::
@@ -267,13 +266,13 @@ mkMAssetsScriptTx inputIndex colInputIndex outputIndex minted succeeds fees sta
267266
Right $ AlonzoTxOut addr vl (Strict.SJust (hashData @StandardAlonzo plutusDataList))
268267

269268
mkDCertTx ::
270-
[DCert StandardCrypto] ->
269+
[ShelleyTxCert StandardAlonzo] ->
271270
Withdrawals StandardCrypto ->
272271
Either ForgingError (AlonzoTx StandardAlonzo)
273272
mkDCertTx certs wdrl = Right $ mkSimpleTx True $ consCertTxBody certs wdrl
274273

275274
mkSimpleDCertTx ::
276-
[(StakeIndex, StakeCredential StandardCrypto -> DCert StandardCrypto)] ->
275+
[(StakeIndex, StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo)] ->
277276
AlonzoLedgerState ->
278277
Either ForgingError (AlonzoTx StandardAlonzo)
279278
mkSimpleDCertTx consDert st = do
@@ -285,7 +284,7 @@ mkSimpleDCertTx consDert st = do
285284
mkDCertPoolTx ::
286285
[ ( [StakeIndex]
287286
, PoolIndex
288-
, [StakeCredential StandardCrypto] -> KeyHash 'StakePool StandardCrypto -> DCert StandardCrypto
287+
, [StakeCredential StandardCrypto] -> KeyHash 'StakePool StandardCrypto -> ShelleyTxCert StandardAlonzo
289288
)
290289
] ->
291290
AlonzoLedgerState ->
@@ -298,7 +297,7 @@ mkDCertPoolTx consDert st = do
298297
mkDCertTx dcerts (Withdrawals mempty)
299298

300299
mkScriptDCertTx ::
301-
[(StakeIndex, Bool, StakeCredential StandardCrypto -> DCert StandardCrypto)] ->
300+
[(StakeIndex, Bool, StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo)] ->
302301
Bool ->
303302
AlonzoLedgerState ->
304303
Either ForgingError (AlonzoTx StandardAlonzo)
@@ -368,9 +367,9 @@ consPoolParams poolId rwCred owners =
368367
consPoolParamsTwoOwners ::
369368
[StakeCredential StandardCrypto] ->
370369
KeyHash 'StakePool StandardCrypto ->
371-
DCert StandardCrypto
370+
ShelleyTxCert StandardAlonzo
372371
consPoolParamsTwoOwners [rwCred, KeyHashObj owner0, KeyHashObj owner1] poolId =
373-
DCertPool $ RegPool $ consPoolParams poolId rwCred [owner0, owner1]
372+
ShelleyTxCertPool $ RegPool $ consPoolParams poolId rwCred [owner0, owner1]
374373
consPoolParamsTwoOwners _ _ = panic "expected 2 pool owners"
375374

376375
mkScriptTx ::

cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Alonzo/Scenarios.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Cardano.Mock.Forging.Tx.Generic
1010
import Cardano.Mock.Forging.Types
1111
import Cardano.Prelude hiding (length, (.))
1212
import Data.List.Extra
13+
import Cardano.Ledger.Shelley.TxCert
1314

1415
delegateAndSendBlocks :: Int -> Interpreter -> IO [CardanoBlock]
1516
delegateAndSendBlocks n interpreter = do
@@ -18,7 +19,7 @@ delegateAndSendBlocks n interpreter = do
1819
blockTxs <- withAlonzoLedgerState interpreter $ \_st ->
1920
forM (chunksOf 10 blockCreds) $ \txCreds ->
2021
-- 10 per tx
21-
Alonzo.mkDCertTx (fmap (DCertDeleg . RegKey) txCreds) (Withdrawals mempty)
22+
Alonzo.mkDCertTx (fmap (ShelleyTxCertDelegCert . ShelleyRegCert) txCreds) (Withdrawals mempty)
2223
forgeNextFindLeader interpreter (TxAlonzo <$> blockTxs)
2324

2425
delegateBlocks <- forM (chunksOf 500 creds) $ \blockCreds -> do
@@ -27,7 +28,7 @@ delegateAndSendBlocks n interpreter = do
2728
-- do -- 10 per tx
2829
Alonzo.mkDCertTx
2930
( fmap
30-
(\(poolIx, cred) -> DCertDeleg $ Delegate $ Delegation cred (resolvePool (PoolIndex poolIx) st))
31+
(\(poolIx, cred) -> ShelleyTxCertDelegCert $ ShelleyDelegCert cred (resolvePool (PoolIndex poolIx) st))
3132
(zip (cycle [0, 1, 2]) txCreds)
3233
)
3334
(Withdrawals mempty)

0 commit comments

Comments
 (0)