Skip to content

Commit 24e37ff

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 f202864 commit 24e37ff

44 files changed

Lines changed: 142 additions & 128 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: 16 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,19 @@ 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/mrkkrp/megaparsec/issues/605
98+
, megaparsec <9.8.0
99+
100+
-- https://github.com/IntersectMBO/plutus/pull/7236
101+
, setup.optparse-applicative >=0.19.0.0
102+
103+
allow-newer:
104+
, deriving-aeson:aeson
105+
, microstache:aeson
106+
, monoidal-containers:aeson
107+
, turtle:containers
108+
, turtle:optparse-applicative
99109

100110
if impl (ghc >= 9.14)
101111
-- https://github.com/snowleopard/alga/issues/322
@@ -104,24 +114,18 @@ if impl (ghc >= 9.14)
104114
location: https://github.com/snowleopard/alga
105115
tag: d4e43fb42db05413459fb2df493361d5a666588a
106116

107-
-- cabal-allow-newer begin
108-
if impl(ghc >= 9.14)
109117
allow-newer:
110-
, binary:containers
111118
, canonical-json:containers
112119
, cborg:base
113120
, cborg:containers
114121
, config-ini:containers
115122
, dependent-map:containers
123+
, dependent-sum:some
116124
, dictionary-sharing:containers
117-
, hedgehog-quickcheck:QuickCheck
125+
, monad-control:transformers-compat
118126
, ordered-containers:containers
119127
, serialise:base
120128
, serialise:containers
121129
, serialise:time
122-
, tree-diff:time
123-
, turtle:containers
124130
, turtle:time
125131
, 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: 4 additions & 4 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,7 +398,7 @@ 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
@@ -942,7 +942,7 @@ executable print-cost-model
942942
hs-source-dirs: cost-model/print-cost-model
943943
other-modules: Paths_plutus_core
944944
build-depends:
945-
, aeson
945+
, aeson >=2.3
946946
, base >=4.9 && <5
947947
, bytestring
948948
, plutus-core ^>=1.65
@@ -957,7 +957,7 @@ library satint
957957
exposed-modules: Data.SatInt
958958
hs-source-dirs: satint/src
959959
build-depends:
960-
, aeson
960+
, aeson >=2.3
961961
, base >=4.9 && <5
962962
, cassava
963963
, deepseq

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE TypeApplications #-}
23

34
module Generators.QuickCheck.Utils where
@@ -8,6 +9,8 @@ import PlutusCore.Data
89
import PlutusCore.Generators.QuickCheck.Builtin
910
import PlutusCore.Generators.QuickCheck.Utils
1011

12+
import qualified Test.QuickCheck as QC
13+
1114
import Test.Tasty
1215
import Test.Tasty.QuickCheck
1316

@@ -21,14 +24,14 @@ test_multiSplitSound =
2124
, ("multiSplit0", multiSplit0 0.1)
2225
]
2326
pure . testProperty name $ \(xs :: [Int]) ->
24-
withMaxSuccess 10000 . forAll (split xs) $ \aSplit ->
27+
withNumTests 10000 . forAll (split xs) $ \aSplit ->
2528
xs === concat aSplit
2629

2730
-- | Show the distribution of lists generated by a split function for a list of the given length.
2831
test_listDistribution :: Int -> ([()] -> Gen [[()]]) -> Int -> TestTree
2932
test_listDistribution numRuns split n =
3033
testProperty ("for a list of length " ++ show n) $
31-
withMaxSuccess numRuns . forAll (split $ replicate n ()) $ \aSplit ->
34+
withNumTests numRuns . forAll (split $ replicate n ()) $ \aSplit ->
3235
label (show $ map length aSplit) True
3336

3437
-- | Count the number of 'I' and 'B' nodes in a 'Data' object.
@@ -48,7 +51,7 @@ length of the spine. Ensures that the 'Data' generator is not exponential in 'B'
4851
test_arbitraryDataExpectedLeafs :: TestTree
4952
test_arbitraryDataExpectedLeafs =
5053
testProperty "'arbitrary @Data' has the expected number of 'B' and 'I' leaves" $
51-
withMaxSuccess 1000 . mapSize (* 5) $ \spine ->
54+
withNumTests 1000 . mapSize (* 5) $ \spine ->
5255
forAll (genDataFromSpine spine) $ \dat ->
5356
countIandBs dat === length spine
5457

@@ -80,3 +83,10 @@ test_utils =
8083
, test_multiSplitSound
8184
, test_multiSplitDistribution
8285
]
86+
87+
withNumTests :: QC.Testable prop => Int -> prop -> QC.Property
88+
#if MIN_VERSION_QuickCheck(2, 18, 0)
89+
withNumTests = QC.withNumTests
90+
#else
91+
withNumTests = QC.withMaxSuccess
92+
#endif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import Test.QuickCheck
88

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The statistics at the time this comment was written are as follows:
3838
So we don't get great coverage, but given that it takes a few seconds to generate dozens of
3939
thousands of (non-filtered) test cases, we do still get some reasonable coverage in the end. -}
4040
prop_unify :: Property
41-
prop_unify = withMaxSuccess 500 $
41+
prop_unify = withNumTests 500 $
4242
forAllDoc "n" arbitrary shrink $ \(NonNegative n) ->
4343
forAllDoc "nSub" (choose (0, n)) shrink $ \nSub ->
4444
-- See Note [Chaotic Good fresh name generation].
@@ -89,7 +89,7 @@ prop_unifyRename =
8989
{-| Check that substitution eliminates from the type all free occurrences of variables present in
9090
the domain of the substitution. -}
9191
prop_substType :: Property
92-
prop_substType = withMaxSuccess 1000 $
92+
prop_substType = withNumTests 1000 $
9393
-- No shrinking because every nested shrink makes properties harder to shrink (because you'd need
9494
-- to regenerate the stuff that depends on the context, meaning you don't have the same
9595
-- 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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ prop_genKindCorrect = p_genKindCorrect False
2121
See Note [Debugging generators that don't generate well-typed/kinded terms/types]
2222
and see the utility tests below when this property fails. -}
2323
p_genKindCorrect :: Bool -> Property
24-
p_genKindCorrect debug = withMaxSuccess 1000 $
24+
p_genKindCorrect debug = withNumTests 1000 $
2525
-- Context minimality doesn't help readability, so no shrinking here
2626
forAllDoc "ctx" genCtx (const []) $ \ctx ->
2727
-- Note, no shrinking here because shrinking relies on well-kindedness.
@@ -30,7 +30,7 @@ p_genKindCorrect debug = withMaxSuccess 1000 $
3030

3131
-- | Check that shrinking types maintains kinds.
3232
prop_shrinkTypeSound :: Property
33-
prop_shrinkTypeSound = withMaxSuccess 500 $
33+
prop_shrinkTypeSound = withNumTests 500 $
3434
forAllDoc "ctx" genCtx (const []) $ \ctx ->
3535
forAllDoc "k,ty" (genKindAndTypeWithCtx ctx) (shrinkKindAndType ctx) $ \(k, ty) ->
3636
-- See discussion about the same trick in 'prop_shrinkTermSound'.
@@ -45,7 +45,7 @@ prop_shrinkTypeSound = withMaxSuccess 500 $
4545

4646
-- | Test that shrinking a type results in a type of a smaller kind. Useful for debugging shrinking.
4747
prop_shrinkTypeSmallerKind :: Property
48-
prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
48+
prop_shrinkTypeSmallerKind = withNumTests 3000 $
4949
forAllDoc "k,ty" genKindAndType (shrinkKindAndType Map.empty) $ \(k, ty) ->
5050
assertNoCounterexamples
5151
[ (k', ty')
@@ -55,13 +55,13 @@ prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
5555

5656
-- | Test that shrinking kinds generates smaller kinds.
5757
prop_shrinkKindSmaller :: Property
58-
prop_shrinkKindSmaller = withMaxSuccess 30000 $
58+
prop_shrinkKindSmaller = withNumTests 30000 $
5959
forAllDoc "k" arbitrary shrink $ \k ->
6060
assertNoCounterexamples [k' | k' <- shrink k, not $ leKind k' k]
6161

6262
-- | Test that fixKind actually gives you something of the right kind.
6363
prop_fixKind :: Property
64-
prop_fixKind = withMaxSuccess 10000 $
64+
prop_fixKind = withNumTests 10000 $
6565
forAllDoc "ctx" genCtx (const []) $ \ctx ->
6666
forAllDoc "k,ty" genKindAndType (shrinkKindAndType ctx) $ \(k, ty) ->
6767
-- Note, fixKind only works on smaller kinds, so we use shrink to get a definitely smaller kind
@@ -74,7 +74,7 @@ prop_fixKind = withMaxSuccess 10000 $
7474

7575
-- | Check that 'normalizeType' returns a normal type.
7676
prop_normalizedTypeIsNormal :: Property
77-
prop_normalizedTypeIsNormal = withMaxSuccess 1000 $
77+
prop_normalizedTypeIsNormal = withNumTests 1000 $
7878
forAllDoc "k,ty" genKindAndType (shrinkKindAndType Map.empty) $ \(_, ty) ->
7979
unless (isNormalType . unNormalized . runQuote $ normalizeType ty) $
8080
Left "'normalizeType' returned a non-normal type"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_lets =
3636
test_propLets :: TestTree
3737
test_propLets =
3838
ignoreTest $ testProperty "lets" $ \letKind ->
39-
withMaxSuccess 40000 $
39+
withNumTests 40000 $
4040
testPassProp' @_ @_ @_ @(Provenance ())
4141
(Original ())
4242
(\t -> fmap Original t)

0 commit comments

Comments
 (0)