Skip to content

Commit f1c7d61

Browse files
committed
Bump dependencies
* Increase lower bound on aeson >= 2.3 to avoid a DoS vulnerability in earlier versions: https://haskell.github.io/security-advisories/advisory/HSEC-2026-0007.html * Make it compatible with QuickCheck == 2.18.* and earlier.
1 parent ce31ed3 commit f1c7d61

45 files changed

Lines changed: 172 additions & 129 deletions

File tree

Some content is hidden

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

cabal.project

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ packages: cardano-constitution
3131
plutus-metatheory
3232
plutus-tx
3333
plutus-tx-plugin
34-
doc/docusaurus/docusaurus-examples.cabal
34+
doc/docusaurus
3535

3636
-- We never, ever, want this.
3737
write-ghc-environment-files: never
@@ -93,9 +93,15 @@ allow-newer:
9393
, inline-r:containers
9494
, inline-r:primitive
9595

96-
-- https://github.com/IntersectMBO/plutus/pull/7236
97-
constraints: setup.optparse-applicative >=0.19.0.0
98-
allow-newer: turtle:optparse-applicative
96+
constraints:
97+
-- https://github.com/IntersectMBO/plutus/pull/7236
98+
, setup.optparse-applicative >=0.19.0.0
99+
100+
allow-newer:
101+
, deriving-aeson:aeson
102+
, microstache:aeson
103+
, turtle:containers
104+
, turtle:optparse-applicative
99105

100106
if impl (ghc >= 9.14)
101107
-- https://github.com/snowleopard/alga/issues/322
@@ -104,24 +110,18 @@ if impl (ghc >= 9.14)
104110
location: https://github.com/snowleopard/alga
105111
tag: d4e43fb42db05413459fb2df493361d5a666588a
106112

107-
-- cabal-allow-newer begin
108-
if impl(ghc >= 9.14)
109113
allow-newer:
110-
, binary:containers
111114
, canonical-json:containers
112115
, cborg:base
113116
, cborg:containers
114117
, config-ini:containers
115118
, dependent-map:containers
119+
, dependent-sum:some
116120
, dictionary-sharing:containers
117-
, hedgehog-quickcheck:QuickCheck
121+
, monad-control:transformers-compat
118122
, ordered-containers:containers
119123
, serialise:base
120124
, serialise:containers
121125
, serialise:time
122-
, tree-diff:time
123-
, turtle:containers
124126
, turtle:time
125127
, with-utf8:base
126-
-- cabal-allow-newer end
127-

cardano-constitution/cardano-constitution.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ library
8282
PlutusTx.NonCanonicalRational
8383

8484
build-depends:
85-
, aeson
85+
, aeson >=2.3
8686
, base >=4.9 && <5
8787
, containers
8888
, filepath

plutus-benchmark/plutus-benchmark.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ executable uplc-evaluator
926926
hs-source-dirs: uplc-evaluator
927927
ghc-options: -rtsopts -with-rtsopts=-I0
928928
build-depends:
929-
, aeson >=2.0
929+
, aeson >=2.3
930930
, base >=4.9 && <5
931931
, bytestring
932932
, containers
@@ -952,7 +952,7 @@ test-suite uplc-evaluator-integration-tests
952952
ghc-options: -threaded -rtsopts -with-rtsopts=-N1
953953
build-tool-depends: plutus-benchmark:uplc-evaluator
954954
build-depends:
955-
, aeson >=2.0
955+
, aeson >=2.3
956956
, base >=4.9 && <5
957957
, bytestring
958958
, directory

plutus-conformance/plutus-conformance.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test-suite agda-conformance
102102
hs-source-dirs: agda test-cases
103103
other-modules:
104104
build-depends:
105-
, aeson
105+
, aeson >=2.3
106106
, base >=4.9 && <5
107107
, plutus-conformance
108108
, plutus-core ^>=1.65

plutus-core/plutus-core.cabal

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ library
313313
-- * This bound also includes support for the bls12-381 msm primitives (see CIP-133)
314314
-- * The bound on 'dependent-sum' is needed to avoid https://github.com/obsidiansystems/dependent-sum/issues/72
315315
build-depends:
316-
, aeson
316+
, aeson >=2.3
317317
, array
318318
, barbies
319319
, base >=4.9 && <5
@@ -398,10 +398,11 @@ test-suite plutus-core-test
398398

399399
default-language: Haskell2010
400400
build-depends:
401-
, aeson
401+
, aeson >=2.3
402402
, base >=4.9 && <5
403403
, base16-bytestring ^>=1.0
404404
, bytestring
405+
, cardano-base:testlib >=0.1.5
405406
, containers
406407
, data-default-class
407408
, extra
@@ -499,6 +500,7 @@ library untyped-plutus-core-testlib
499500
, base >=4.9 && <5
500501
, base16-bytestring
501502
, bytestring
503+
, cardano-base:testlib >=0.1.5
502504
, cardano-crypto-class
503505
, data-default-class
504506
, dlist
@@ -674,6 +676,7 @@ test-suite plutus-ir-test
674676
build-tool-depends: tasty-discover:tasty-discover
675677
build-depends:
676678
, base >=4.9 && <5
679+
, cardano-base:testlib >=0.1.5
677680
, containers
678681
, filepath
679682
, hashable
@@ -942,7 +945,7 @@ executable print-cost-model
942945
hs-source-dirs: cost-model/print-cost-model
943946
other-modules: Paths_plutus_core
944947
build-depends:
945-
, aeson
948+
, aeson >=2.3
946949
, base >=4.9 && <5
947950
, bytestring
948951
, plutus-core ^>=1.65
@@ -957,7 +960,7 @@ library satint
957960
exposed-modules: Data.SatInt
958961
hs-source-dirs: satint/src
959962
build-depends:
960-
, aeson
963+
, aeson >=2.3
961964
, base >=4.9 && <5
962965
, cassava
963966
, deepseq
@@ -971,7 +974,8 @@ test-suite satint-test
971974
type: exitcode-stdio-1.0
972975
main-is: TestSatInt.hs
973976
build-depends:
974-
, base >=4.9 && <5
977+
, base >=4.9 && <5
978+
, cardano-base:testlib >=0.1.5
975979
, HUnit
976980
, QuickCheck
977981
, satint

plutus-core/plutus-core/test/Generators/QuickCheck/Utils.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import PlutusCore.Generators.QuickCheck.Utils
1010

1111
import Test.Tasty
1212
import Test.Tasty.QuickCheck
13+
import qualified Test.Cardano.Base.QuickCheck as BaseQC
1314

1415
{-| Test that both 'multiSplit1' and 'multiSplit0' produce a list such that 'concat'ing it gives
1516
back the input. -}
@@ -21,14 +22,14 @@ test_multiSplitSound =
2122
, ("multiSplit0", multiSplit0 0.1)
2223
]
2324
pure . testProperty name $ \(xs :: [Int]) ->
24-
withMaxSuccess 10000 . forAll (split xs) $ \aSplit ->
25+
BaseQC.withNumTests 10000 . forAll (split xs) $ \aSplit ->
2526
xs === concat aSplit
2627

2728
-- | Show the distribution of lists generated by a split function for a list of the given length.
2829
test_listDistribution :: Int -> ([()] -> Gen [[()]]) -> Int -> TestTree
2930
test_listDistribution numRuns split n =
3031
testProperty ("for a list of length " ++ show n) $
31-
withMaxSuccess numRuns . forAll (split $ replicate n ()) $ \aSplit ->
32+
BaseQC.withNumTests numRuns . forAll (split $ replicate n ()) $ \aSplit ->
3233
label (show $ map length aSplit) True
3334

3435
-- | Count the number of 'I' and 'B' nodes in a 'Data' object.
@@ -48,7 +49,7 @@ length of the spine. Ensures that the 'Data' generator is not exponential in 'B'
4849
test_arbitraryDataExpectedLeafs :: TestTree
4950
test_arbitraryDataExpectedLeafs =
5051
testProperty "'arbitrary @Data' has the expected number of 'B' and 'I' leaves" $
51-
withMaxSuccess 1000 . mapSize (* 5) $ \spine ->
52+
BaseQC.withNumTests 1000 . mapSize (* 5) $ \spine ->
5253
forAll (genDataFromSpine spine) $ \dat ->
5354
countIandBs dat === length spine
5455

plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/BuiltinsTests.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import PlutusCore.Data
44
import PlutusCore.Generators.QuickCheck ()
55

66
import Codec.Serialise
7+
import Test.Cardano.Base.QuickCheck qualified as BaseQC
78
import Test.QuickCheck
89

910
-- | This mainly tests that the `Data` generator isn't non-terminating or too slow.
1011
prop_genData :: Property
11-
prop_genData = withMaxSuccess 800 $ \(d :: Data) -> d === deserialise (serialise d)
12+
prop_genData = BaseQC.withNumTests 800 $ \(d :: Data) -> d === deserialise (serialise d)

plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/SubstitutionTests.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Data.Set qualified as Set
1515
import Data.Set.Lens (setOf)
1616
import Data.String
1717

18+
import Test.Cardano.Base.QuickCheck qualified as BaseQC
1819
import Test.QuickCheck hiding (choose, vectorOf)
1920

2021
-- * Tests for unification and substitution
@@ -38,7 +39,7 @@ The statistics at the time this comment was written are as follows:
3839
So we don't get great coverage, but given that it takes a few seconds to generate dozens of
3940
thousands of (non-filtered) test cases, we do still get some reasonable coverage in the end. -}
4041
prop_unify :: Property
41-
prop_unify = withMaxSuccess 500 $
42+
prop_unify = BaseQC.withNumTests 500 $
4243
forAllDoc "n" arbitrary shrink $ \(NonNegative n) ->
4344
forAllDoc "nSub" (choose (0, n)) shrink $ \nSub ->
4445
-- See Note [Chaotic Good fresh name generation].
@@ -89,7 +90,7 @@ prop_unifyRename =
8990
{-| Check that substitution eliminates from the type all free occurrences of variables present in
9091
the domain of the substitution. -}
9192
prop_substType :: Property
92-
prop_substType = withMaxSuccess 1000 $
93+
prop_substType = BaseQC.withNumTests 1000 $
9394
-- No shrinking because every nested shrink makes properties harder to shrink (because you'd need
9495
-- to regenerate the stuff that depends on the context, meaning you don't have the same
9596
-- counterexample as you did before) and context minimality doesn't help readability very much.

plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/TypesTests.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Control.Monad
1212
import Data.Bifunctor
1313
import Data.Either
1414
import Data.Map.Strict qualified as Map
15+
import Test.Cardano.Base.QuickCheck qualified as BaseQC
1516
import Test.QuickCheck
1617

1718
prop_genKindCorrect :: Property
@@ -21,7 +22,7 @@ prop_genKindCorrect = p_genKindCorrect False
2122
See Note [Debugging generators that don't generate well-typed/kinded terms/types]
2223
and see the utility tests below when this property fails. -}
2324
p_genKindCorrect :: Bool -> Property
24-
p_genKindCorrect debug = withMaxSuccess 1000 $
25+
p_genKindCorrect debug = BaseQC.withNumTests 1000 $
2526
-- Context minimality doesn't help readability, so no shrinking here
2627
forAllDoc "ctx" genCtx (const []) $ \ctx ->
2728
-- Note, no shrinking here because shrinking relies on well-kindedness.
@@ -30,7 +31,7 @@ p_genKindCorrect debug = withMaxSuccess 1000 $
3031

3132
-- | Check that shrinking types maintains kinds.
3233
prop_shrinkTypeSound :: Property
33-
prop_shrinkTypeSound = withMaxSuccess 500 $
34+
prop_shrinkTypeSound = BaseQC.withNumTests 500 $
3435
forAllDoc "ctx" genCtx (const []) $ \ctx ->
3536
forAllDoc "k,ty" (genKindAndTypeWithCtx ctx) (shrinkKindAndType ctx) $ \(k, ty) ->
3637
-- See discussion about the same trick in 'prop_shrinkTermSound'.
@@ -45,7 +46,7 @@ prop_shrinkTypeSound = withMaxSuccess 500 $
4546

4647
-- | Test that shrinking a type results in a type of a smaller kind. Useful for debugging shrinking.
4748
prop_shrinkTypeSmallerKind :: Property
48-
prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
49+
prop_shrinkTypeSmallerKind = BaseQC.withNumTests 3000 $
4950
forAllDoc "k,ty" genKindAndType (shrinkKindAndType Map.empty) $ \(k, ty) ->
5051
assertNoCounterexamples
5152
[ (k', ty')
@@ -55,13 +56,13 @@ prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
5556

5657
-- | Test that shrinking kinds generates smaller kinds.
5758
prop_shrinkKindSmaller :: Property
58-
prop_shrinkKindSmaller = withMaxSuccess 30000 $
59+
prop_shrinkKindSmaller = BaseQC.withNumTests 30000 $
5960
forAllDoc "k" arbitrary shrink $ \k ->
6061
assertNoCounterexamples [k' | k' <- shrink k, not $ leKind k' k]
6162

6263
-- | Test that fixKind actually gives you something of the right kind.
6364
prop_fixKind :: Property
64-
prop_fixKind = withMaxSuccess 10000 $
65+
prop_fixKind = BaseQC.withNumTests 10000 $
6566
forAllDoc "ctx" genCtx (const []) $ \ctx ->
6667
forAllDoc "k,ty" genKindAndType (shrinkKindAndType ctx) $ \(k, ty) ->
6768
-- Note, fixKind only works on smaller kinds, so we use shrink to get a definitely smaller kind
@@ -74,7 +75,7 @@ prop_fixKind = withMaxSuccess 10000 $
7475

7576
-- | Check that 'normalizeType' returns a normal type.
7677
prop_normalizedTypeIsNormal :: Property
77-
prop_normalizedTypeIsNormal = withMaxSuccess 1000 $
78+
prop_normalizedTypeIsNormal = BaseQC.withNumTests 1000 $
7879
forAllDoc "k,ty" genKindAndType (shrinkKindAndType Map.empty) $ \(_, ty) ->
7980
unless (isNormalType . unNormalized . runQuote $ normalizeType ty) $
8081
Left "'normalizeType' returned a non-normal type"

plutus-core/plutus-ir/test/PlutusIR/Compiler/Let/Tests.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import PlutusIR.Compiler qualified as PIR
1515
import PlutusIR.Compiler.Let
1616
import PlutusIR.Pass.Test
1717
import PlutusIR.Test
18+
import Test.Cardano.Base.QuickCheck qualified as BaseQC
1819
import Test.QuickCheck
1920
import Test.Tasty
2021
import Test.Tasty.ExpectedFailure (ignoreTest)
@@ -36,7 +37,7 @@ test_lets =
3637
test_propLets :: TestTree
3738
test_propLets =
3839
ignoreTest $ testProperty "lets" $ \letKind ->
39-
withMaxSuccess 40000 $
40+
BaseQC.withNumTests 40000 $
4041
testPassProp' @_ @_ @_ @(Provenance ())
4142
(Original ())
4243
(\t -> fmap Original t)

0 commit comments

Comments
 (0)