Skip to content

Commit

Permalink
Update dependency versions (cardano-api, cardano-cli, ouroboros-netwo…
Browse files Browse the repository at this point in the history
…rk, plutus-ledger-api)
  • Loading branch information
Unisay committed Jun 20, 2024
1 parent 9706eb0 commit 68b0ada
Show file tree
Hide file tree
Showing 56 changed files with 2,303 additions and 2,592 deletions.
2 changes: 1 addition & 1 deletion bench/locli/locli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ library
, optparse-generic
, ouroboros-consensus
-- for Data.SOP.Strict:
, ouroboros-network ^>= 0.16
, ouroboros-network ^>= 0.16.1
, ouroboros-network-api
, process
, quiet
Expand Down
2 changes: 1 addition & 1 deletion bench/locli/src/Cardano/Analysis/API/Ground.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Cardano.Analysis.API.Ground
where

import Prelude (show)
import Cardano.Prelude hiding (head)
import Cardano.Prelude hiding (head, toText)
import Unsafe.Coerce qualified as Unsafe

import Data.Aeson
Expand Down
2 changes: 1 addition & 1 deletion bench/locli/src/Cardano/Analysis/MachPerf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

module Cardano.Analysis.MachPerf (module Cardano.Analysis.MachPerf) where

import Cardano.Prelude hiding (head)
import Cardano.Prelude hiding (head, toText)
import Cardano.Prelude qualified as CP

import Data.List ((!!))
Expand Down
2 changes: 1 addition & 1 deletion bench/locli/src/Cardano/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# OPTIONS_GHC -fmax-pmcheck-models=25000 #-}
module Cardano.Command (module Cardano.Command) where

import Cardano.Prelude hiding (State)
import Cardano.Prelude hiding (State, toText)

import Data.Aeson qualified as Aeson
import Data.Aeson.Text qualified as Aeson
Expand Down
2 changes: 1 addition & 1 deletion bench/locli/src/Cardano/Unlog/LogObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Cardano.Unlog.LogObject
)
where

import Cardano.Prelude hiding (Text, show)
import Cardano.Prelude hiding (Text, show, toText)
import GHC.Conc (numCapabilities)
import Prelude (id, show, unzip3)

Expand Down
8 changes: 4 additions & 4 deletions bench/plutus-scripts-bench/plutus-scripts-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ library
-- IOG dependencies
--------------------------
build-depends:
, cardano-api ^>= 8.46
, plutus-ledger-api >=1.0.0
, plutus-tx >=1.0.0
, plutus-tx-plugin ^>=1.27
, cardano-api ^>=8.48.0.1
, plutus-ledger-api ^>=1.30
, plutus-tx ^>=1.30
, plutus-tx-plugin ^>=1.30

------------------------
-- Non-IOG dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import GHC.ByteOrder (ByteOrder(LittleEndian))
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import qualified PlutusTx
import qualified PlutusTx.Builtins.Internal as BI (unitval)
import PlutusTx.Prelude as Tx hiding (Semigroup (..), (.), (<$>))


Expand All @@ -36,7 +37,7 @@ script :: PlutusBenchScript
script = mkPlutusBenchScript scriptName (toScriptInAnyLang (PlutusScript PlutusScriptV3 scriptSerialized))

{-# INLINABLE mkValidator #-}
mkValidator :: BuiltinData -> BuiltinData -> BuiltinData -> ()
mkValidator :: BuiltinData -> BuiltinData -> BuiltinData -> BuiltinUnit
mkValidator _datum red _txContext =
case PlutusV3.fromBuiltinData red of
Nothing -> Tx.traceError "invalid redeemer"
Expand All @@ -51,7 +52,7 @@ mkValidator _datum red _txContext =
where go [] !acc = acc
go (q:qs) !acc = go qs $ Tx.bls12_381_G2_add (Tx.bls12_381_G2_hashToGroup q (integerToByteString LittleEndian 0 i)) acc
loop i l
| i == 1000000 = ()
| i == 1000000 = BI.unitval
| otherwise = let !_ = hashAndAddG2 l i in loop (pred i) l

hashAndAddG2ShortBs :: SBS.ShortByteString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import qualified Data.ByteString.Short as SBS
import qualified PlutusLedgerApi.V3 as PlutusV3
import PlutusTx
import PlutusTx.Builtins (unsafeDataAsI)
import qualified PlutusTx.Builtins.Internal as BI (unitval)
import PlutusTx.Prelude hiding (Semigroup (..), unless, (.), (<$>))


Expand All @@ -30,14 +31,14 @@ script = mkPlutusBenchScript scriptName (toScriptInAnyLang (PlutusScript PlutusS


{-# INLINABLE mkValidator #-}
mkValidator :: BuiltinData -> BuiltinData -> BuiltinData -> ()
mkValidator :: BuiltinData -> BuiltinData -> BuiltinData -> BuiltinUnit
mkValidator _datum redeemer _txContext
= if n < 1000000
then traceError "redeemer is < 1000000"
else loop n
where
n = unsafeDataAsI redeemer
loop i = if i == 1000000 then () else loop $ pred i
loop i = if i == 1000000 then BI.unitval else loop $ pred i

loopScriptShortBs :: SBS.ShortByteString
loopScriptShortBs = PlutusV3.serialiseCompiledCode $$(PlutusTx.compile [|| mkValidator ||])
Expand Down
38 changes: 28 additions & 10 deletions bench/tx-generator/data/protocol-parameters-conway.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,13 @@
"decodeUtf8-memory-arguments-intercept": 4,
"decodeUtf8-memory-arguments-slope": 2,
"divideInteger-cpu-arguments-constant": 85848,
"divideInteger-cpu-arguments-model-arguments-intercept": 228465,
"divideInteger-cpu-arguments-model-arguments-slope": 122,
"divideInteger-cpu-arguments-model-arguments-c00": 123203,
"divideInteger-cpu-arguments-model-arguments-c01": 7305,
"divideInteger-cpu-arguments-model-arguments-c02": -900,
"divideInteger-cpu-arguments-model-arguments-c10": 1716,
"divideInteger-cpu-arguments-model-arguments-c11": 549,
"divideInteger-cpu-arguments-model-arguments-c20": 57,
"divideInteger-cpu-arguments-model-arguments-minimum": 85848,
"divideInteger-memory-arguments-intercept": 0,
"divideInteger-memory-arguments-minimum": 1,
"divideInteger-memory-arguments-slope": 1,
Expand Down Expand Up @@ -515,10 +520,14 @@
"mkPairData-cpu-arguments": 11546,
"mkPairData-memory-arguments": 32,
"modInteger-cpu-arguments-constant": 85848,
"modInteger-cpu-arguments-model-arguments-intercept": 228465,
"modInteger-cpu-arguments-model-arguments-slope": 122,
"modInteger-cpu-arguments-model-arguments-c00": 123203,
"modInteger-cpu-arguments-model-arguments-c01": 7305,
"modInteger-cpu-arguments-model-arguments-c02": -900,
"modInteger-cpu-arguments-model-arguments-c10": 1716,
"modInteger-cpu-arguments-model-arguments-c11": 549,
"modInteger-cpu-arguments-model-arguments-c20": 57,
"modInteger-cpu-arguments-model-arguments-minimum": 85848,
"modInteger-memory-arguments-intercept": 0,
"modInteger-memory-arguments-minimum": 1,
"modInteger-memory-arguments-slope": 1,
"multiplyInteger-cpu-arguments-intercept": 90434,
"multiplyInteger-cpu-arguments-slope": 519,
Expand All @@ -527,16 +536,25 @@
"nullList-cpu-arguments": 74433,
"nullList-memory-arguments": 32,
"quotientInteger-cpu-arguments-constant": 85848,
"quotientInteger-cpu-arguments-model-arguments-intercept": 228465,
"quotientInteger-cpu-arguments-model-arguments-slope": 122,
"quotientInteger-cpu-arguments-model-arguments-c00": 123203,
"quotientInteger-cpu-arguments-model-arguments-c01": 7305,
"quotientInteger-cpu-arguments-model-arguments-c02": -900,
"quotientInteger-cpu-arguments-model-arguments-c10": 1716,
"quotientInteger-cpu-arguments-model-arguments-c11": 549,
"quotientInteger-cpu-arguments-model-arguments-c20": 57,
"quotientInteger-cpu-arguments-model-arguments-minimum": 85848,
"quotientInteger-memory-arguments-intercept": 0,
"quotientInteger-memory-arguments-minimum": 1,
"quotientInteger-memory-arguments-slope": 1,
"remainderInteger-cpu-arguments-constant": 85848,
"remainderInteger-cpu-arguments-model-arguments-intercept": 228465,
"remainderInteger-cpu-arguments-model-arguments-slope": 122,
"remainderInteger-cpu-arguments-model-arguments-c00": 123203,
"remainderInteger-cpu-arguments-model-arguments-c01": 7305,
"remainderInteger-cpu-arguments-model-arguments-c02": -900,
"remainderInteger-cpu-arguments-model-arguments-c10": 1716,
"remainderInteger-cpu-arguments-model-arguments-c11": 549,
"remainderInteger-cpu-arguments-model-arguments-c20": 57,
"remainderInteger-cpu-arguments-model-arguments-minimum": 85848,
"remainderInteger-memory-arguments-intercept": 0,
"remainderInteger-memory-arguments-minimum": 1,
"remainderInteger-memory-arguments-slope": 1,
"serialiseData-cpu-arguments-intercept": 955506,
"serialiseData-cpu-arguments-slope": 213312,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "",
"cborHex": "59020e59020b010100323232322225329333333006003225333573466e1d200000215933335573e00250022800c004d5d08014d5d1001100090c800c8964cccccc02c0088a0045002280114004004500290ac9999aab9f00228011191940040086ae88010d5d0801c00242b266666601a00245002280100614008a00521800c00400e002460048c009180111801060045002280114008a005219001912999ab9a33710004904044bd0980224811572656465656d6572206973203c20313030303030300013300a00200144c005240110696e76616c69642072656465656d657200119319ab9c0018001801911999aab9f0012800c0004b26666660086ae840088a0045002280114008a00200290ac98021aba200390c0060060050012300244ca00460066ae880090002222223333333574800c4646600e6aae74004d55cf0009baa00723005375600e460086eb001c8c00cdd6803918011bae0078001800911912999ab9a3370e904044bd0018c0004c8cc014cdc080224004004660040026f09220160c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003003222590028800c884cc014004cdde99bc3002333792941200000600311918008009119801980100100081"
"cborHex": "59020d59020a010100323232322225329333333006003225333573466e1d200000215933335573e00250022800c004d5d08014d5d1001100090c800c8964cccccc02c0088a0045002280114004004500290ac9999aab9f00228011191940040086ae88010d5d0801c00242b266666601a00245002280100614008a00521800c00400e002460048c009180111801060045002280114008a005219001912999ab9a33710004904044bd0980224811572656465656d6572206973203c20313030303030300013300a00200144c005240110696e76616c69642072656465656d657200119319ab9c0018001801911999aab9f0012800c0004b26666660086ae840088a0045002280114008a00200290ac98021aba200390c0060060050012300244ca00460066ae880090002222223333333574800c4646600e6aae74004d55cf0009baa00723005375600e460086eb001c8c00cdd6803918011bae0078001800911912999ab9a3370e904044bd0018a4c2646600a66e04011200200233002001378491160c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003003222590028800c884cc014004cdde99bc3002333792941200000600311918008009180111980100100081"
}
2 changes: 1 addition & 1 deletion bench/tx-generator/scripts-fallback/LoopV3.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "",
"cborHex": "583e583c010100322225333573466e20dd68012410112f42c260086eb4008c8c00400488c94ccd5cd19b874820225e800860002600266e040092002300200201"
"cborHex": "583e583c01010032222325333573466e200052080897a1613005001375a00464600200244a666ae68cdc3a410112f40022930991980180180099b81001480081"
}
18 changes: 12 additions & 6 deletions bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,23 @@ preExecutePlutusV3 (major, _minor) (PlutusScript _ (PlutusScriptSerialised (scri
exBudget <- firstExceptT PlutusError $
hoistEither .
snd $ PlutusV3.evaluateScriptCounting protocolVersion PlutusV3.Verbose evaluationContext scriptForEval
[ toPlutusData datum
, toPlutusData (getScriptData redeemer)
, PlutusV3.toData dummyContext
]
(PlutusV3.toData scriptContext)

x <- hoistMaybe (TxGenError "preExecutePlutusV3: could not convert to execution units") $
exBudgetToExUnits exBudget
return $ fromAlonzoExUnits x

dummyContext :: PlutusV3.ScriptContext
dummyContext = PlutusV3.ScriptContext dummyTxInfo (PlutusV3.Spending dummyOutRef)
r :: PlutusV3.Redeemer
r = PlutusV3.Redeemer $ PlutusV3.dataToBuiltinData $ toPlutusData $ getScriptData redeemer

d :: PlutusV3.Datum
d = PlutusV3.Datum $ PlutusV3.dataToBuiltinData $ toPlutusData datum

scriptContext :: PlutusV3.ScriptContext
scriptContext = PlutusV3.ScriptContext dummyTxInfo r scriptInfo

scriptInfo :: PlutusV3.ScriptInfo
scriptInfo = PlutusV3.SpendingScript dummyOutRef (Just d)

dummyOutRef :: PlutusV3.TxOutRef
dummyOutRef = PlutusV3.TxOutRef (PlutusV3.TxId "") 0
Expand Down
40 changes: 11 additions & 29 deletions bench/tx-generator/tx-generator.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: tx-generator
version: 2.12
version: 2.13
synopsis: A transaction workload generator for Cardano clusters
description: A transaction workload generator for Cardano clusters.
category: Cardano,
Expand Down Expand Up @@ -41,7 +41,13 @@ library
-Wno-unticked-promoted-constructors
-Wpartial-fields
-Wredundant-constraints
-Wwarn=deprecations
-fno-warn-safe
-fno-warn-unsafe
-fno-warn-missing-import-lists
-fobject-code -fno-ignore-interface-pragmas
-fno-omit-interface-pragmas
-- TODO: switch back to -Wwarn=deprecations having dropped Cardano.Api.ProtocolParameters.ProtocolParameters in favour of Cardano.Api.Ledger.PParams
-Wno-deprecations

exposed-modules: Cardano.Benchmarking.Command
Cardano.Benchmarking.Compiler
Expand Down Expand Up @@ -96,9 +102,9 @@ library
, attoparsec-aeson
, base16-bytestring
, bytestring
, cardano-api ^>= 8.46
, cardano-api ^>= 8.48.0.1
, cardano-binary
, cardano-cli ^>= 8.23
, cardano-cli ^>= 8.24
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-data
Expand Down Expand Up @@ -151,19 +157,6 @@ library
default-language: Haskell2010
default-extensions: OverloadedStrings

ghc-options: -Wall
-fno-warn-safe
-fno-warn-unsafe
-fno-warn-missing-import-lists
-Wno-unticked-promoted-constructors
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wpartial-fields
-Wcompat
-fobject-code -fno-ignore-interface-pragmas
-fno-omit-interface-pragmas

executable tx-generator
import: project-config
hs-source-dirs: app
Expand All @@ -188,6 +181,7 @@ test-suite tx-generator-apitest
-Wall
-rtsopts
"-with-rtsopts=-T"
-Wno-deprecations

build-depends: base
, aeson
Expand All @@ -207,18 +201,6 @@ test-suite tx-generator-apitest
other-modules: Paths_tx_generator
autogen-modules: Paths_tx_generator

build-depends: base
, aeson
, bytestring
, filepath
, optparse-applicative-fork
, cardano-api
, cardano-cli
, cardano-node
, transformers
, transformers-except
, tx-generator

test-suite tx-generator-test
import: project-config
hs-source-dirs: test
Expand Down
6 changes: 4 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ packages:
trace-resources
trace-forward

extra-packages: Cabal

program-options
ghc-options: -Werror

Expand All @@ -57,8 +59,8 @@ package plutus-scripts-bench
constraints:
wai-extra < 3.1.15,

allow-newer: katip:Win32

-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

-- `smtp-mail` should depend on `crypton-connection` rather than `connection`!
2 changes: 1 addition & 1 deletion cardano-node-chairman/cardano-node-chairman.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ test-suite chairman-tests
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -T"

build-tool-depends: cardano-node:cardano-node
, cardano-cli:cardano-cli ^>= 8.23.0.0
, cardano-cli:cardano-cli ^>= 8.24.0.0
, cardano-node-chairman:cardano-node-chairman
20 changes: 10 additions & 10 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ library
, async
, base16-bytestring
, bytestring
, cardano-api ^>= 8.46
, cardano-api ^>= 8.48.0.1
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-git-rev ^>=0.2.2
Expand Down Expand Up @@ -186,14 +186,14 @@ library
, network-mux >= 0.4
, nothunks
, optparse-applicative-fork >= 0.18.1
, ouroboros-consensus ^>= 0.18
, ouroboros-consensus-cardano ^>= 0.16
, ouroboros-consensus-diffusion ^>= 0.16
, ouroboros-consensus ^>= 0.19
, ouroboros-consensus-cardano ^>= 0.17
, ouroboros-consensus-diffusion ^>= 0.17
, ouroboros-consensus-protocol
, ouroboros-network-api ^>= 0.7.1
, ouroboros-network ^>= 0.16
, ouroboros-network-api ^>= 0.7.3
, ouroboros-network ^>= 0.16.1
, ouroboros-network-framework
, ouroboros-network-protocols ^>= 0.8
, ouroboros-network-protocols ^>= 0.9
, prettyprinter
, prettyprinter-ansi-terminal
, psqueues
Expand All @@ -205,9 +205,9 @@ library
, strict-sop-core
, strict-stm
, time
, trace-dispatcher ^>= 2.5
, trace-forward ^>= 2.2
, trace-resources ^>= 0.2.1.0
, trace-dispatcher ^>= 2.5.7
, trace-forward ^>= 2.2.5
, trace-resources ^>= 0.2.1
, tracer-transformers
, transformers
, transformers-except
Expand Down
8 changes: 4 additions & 4 deletions cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ instance LogFormatting (Conway.ConwayGovCertPredFailure era) where

instance LogFormatting (Conway.ConwayDelegPredFailure era) where
forMachine _dtal = mconcat . \case
Conway.DelegateeNotRegisteredDELEG poolID ->
[ "kind" .= String "DelegateeNotRegisteredDELEG"
, "poolID" .= String (textShow poolID)
]
Conway.IncorrectDepositDELEG coin ->
[ "kind" .= String "IncorrectDepositDELEG"
, "amount" .= coin
Expand Down Expand Up @@ -1164,10 +1168,6 @@ instance
( Consensus.ShelleyBasedEra era
, LogFormatting (PredicateFailure (Ledger.EraRule "CERT" era))
) => LogFormatting (Conway.ConwayCertsPredFailure era) where
forMachine _ (Conway.DelegateeNotRegisteredDELEG poolID) =
mconcat [ "kind" .= String "DelegateeNotRegisteredDELEG"
, "poolID" .= String (textShow poolID)
]
forMachine _ (Conway.WithdrawalsNotInRewardsCERTS rs) =
mconcat [ "kind" .= String "WithdrawalsNotInRewardsCERTS"
, "rewardAccounts" .= rs
Expand Down
Loading

0 comments on commit 68b0ada

Please sign in to comment.