Skip to content

Commit

Permalink
Bump to use latest released cardano-base and cardano-prelude packages (
Browse files Browse the repository at this point in the history
…#3080)

* Bump to use latest released cardano-base and cardano-prelude packages

The release branch is using an unreleased commit of `cardano-base` which
contains the SECP primitives but is before the `heapwords` split. This
makes it incompatible with either of the released versions:
- The previous version doesn't have the SECP primitives
- The next version has the heapwords split

In order to make the release branch usable via CHaP, I think the
simplest thing is to backport the changes for the newer `cardano-base`
packages, i.e. the `heapwords` split. This is a bit tedious but not too
bad overall.

Afterwards I'll release another version from this branch.

* ormolise

* Bump minor version

1.0.0 -> 1.1.1
1.3.0 -> 1.4.1

* Move to CHaP

I think we might have a few over-specified constraints here.

Co-authored-by: Moritz Angermann <[email protected]>
  • Loading branch information
michaelpj and angerman authored Nov 9, 2022
1 parent 2684919 commit 99b8c5d
Show file tree
Hide file tree
Showing 52 changed files with 143 additions and 150 deletions.
119 changes: 58 additions & 61 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
index-state: 2022-07-01T00:00:00Z
-- Custom repository for cardano haskell packages, see CONTRIBUTING for more
repository cardano-haskell-packages
url: https://input-output-hk.github.io/cardano-haskell-packages
secure: True
root-keys:
3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them

index-state: 2022-11-01T00:00:00Z
index-state: cardano-haskell-packages 2022-11-01T20:00:00Z

packages:
eras/alonzo/impl
Expand Down Expand Up @@ -40,63 +56,7 @@ benchmarks: true
-- The only sensible test display option
test-show-details: streaming

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 631cb6cf1fa01ab346233b610a38b3b4cba6e6ab
--sha256: 0944wg2nqazmhlmsynwgdwxxj6ay0hb9qig9l128isb2cjia0hlp
subdir:
base-deriving-via
binary
binary/test
cardano-crypto-class
cardano-crypto-praos
measures
slotting
strict-containers

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-crypto
tag: f73079303f663e028288f9f4a9e08bcca39a923e
--sha256: 1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: 533aec85c1ca05c7d171da44b89341fb736ecfe5
--sha256: 0z2y3wzppc12bpn9bl48776ms3nszw8j58xfsdxf97nzjgrmd62g
subdir:
cardano-prelude
cardano-prelude-test

source-repository-package
type: git
location: https://github.com/input-output-hk/goblins
tag: cde90a2b27f79187ca8310b6549331e59595e7ba
--sha256: 17c88rbva3iw82yg9srlxjv2ia5wjb9cyqw44hik565f5v9svnyg

source-repository-package
type: git
location: https://github.com/input-output-hk/plutus
tag: 8ab4c3355c5fdf67dcf6acc1f5a14668d5e6f0a9
--sha256: coD/Kpl7tutwXb6ukQCH5XojBjquYkW7ob0BWZtdpok=
subdir:
plutus-ledger-api
plutus-tx
plutus-tx-plugin
plutus-core
prettyprinter-configurable
word-array

-- https://github.com/Quid2/flat/pull/22 fixes a potential exception
-- when decoding invalid (e.g. malicious) text literals.
source-repository-package
type: git
location: https://github.com/Quid2/flat.git
tag: ee59880f47ab835dbd73bea0847dab7869fc20d8
--sha256: 1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm

-- https://github.com/fpco/weigh/pull/43
source-repository-package
type: git
location: https://github.com/fpco/weigh.git
Expand All @@ -106,19 +66,56 @@ source-repository-package
allow-newer:
monoidal-containers:aeson,
size-based:template-haskell,
Unique:hashable,
ral:hashable,
fin:hashable,
bin:hashable,

constraints:
-- bizarre issue: in earlier versions they define their own 'GEq', in newer
-- ones they reuse the one from 'some', but there isn't e.g. a proper version
-- constraint from dependent-sum-template (which is the library we actually use).
, dependent-sum > 0.6.2.0

-- Plutus dependency
, hedgehog >= 1.0
, bimap >= 0.4.0
, libsystemd-journal >= 1.4.4
, systemd >= 2.3.0
-- systemd-2.3.0 requires at least network 3.1.1.0 but it doesn't declare
-- that dependency
, network >= 3.1.1.0
, HSOpenSSL >= 0.11.7.2
, algebraic-graphs < 0.7

, persistent < 2.14
-- Just sanity checks to make sure we've actually pinned the latest versions
, cardano-binary >= 1.5.0.1
, cardano-prelude >= 0.1.0.1
, heapwords >= 0.1.0.1
, protolude >= 0.3.2
-- cardano-crypto-class does not work with vector>0.13 see https://github.com/input-output-hk/cardano-base/issues/327
, vector < 0.13

-- TODO: these should be set in cabal files, but avoiding setting them in lower dependencies for initial CHaP release
, base-deriving-via == 0.1.0.0
, cardano-crypto-class == 2.0.0.1
, cardano-crypto-praos == 2.0.0.0.1
, cardano-crypto-tests == 2.0.0.0.1
, cardano-slotting == 0.1.0.0
, measures == 0.1.0.0
, orphans-deriving-via == 0.1.0.0
, strict-containers == 0.1.0.0
, plutus-core == 1.0.0.1
, plutus-ledger-api == 1.0.0.1
, plutus-tx == 1.0.0.0
, plutus-tx-plugin == 1.0.0.0
, prettyprinter-configurable == 0.1.0.0
, plutus-ghc-stub == 8.6.5
, word-array == 0.1.0.0
, word-array == 0.1.0.0
, io-classes == 0.2.0.0
, typed-protocols == 0.1.0.0
, typed-protocols-examples == 0.1.0.0

, persistent < 2.14

-- Have to specify '-Werror' for each package until this is taken care of:
-- https://github.com/haskell/cabal/issues/3579
Expand Down
5 changes: 3 additions & 2 deletions eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-ledger-alonzo
version: 0.1.0.0
version: 0.1.1.1
synopsis: Cardano ledger introducing Plutus Core
description:
This package builds upon the Mary ledger with support for extended UTxO
Expand Down Expand Up @@ -74,6 +74,7 @@ library
containers,
data-default,
deepseq,
heapwords,
measures,
mtl,
microlens,
Expand All @@ -87,7 +88,7 @@ library
cardano-ledger-shelley,
scientific,
small-steps,
strict-containers,
cardano-strict-containers,
text,
time,
transformers,
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import Cardano.Binary
withSlice,
)
import Cardano.Crypto.Hash.Class (HashAlgorithm)
import Cardano.HeapWords (HeapWords (..), heapWords0, heapWords1)
import Cardano.Ledger.Alonzo.Era
import Cardano.Ledger.Alonzo.Language (Language (..))
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript (..), validScript)
Expand All @@ -69,7 +70,6 @@ import Cardano.Ledger.SafeHash
)
import Cardano.Ledger.Serialization (mapFromCBOR)
import Cardano.Ledger.Shelley.Metadata (Metadatum, validMetadatum)
import Cardano.Prelude (HeapWords (..), heapWords0, heapWords1)
import qualified Codec.Serialise as Cborg (Serialise (..))
import Control.DeepSeq (NFData)
import Data.ByteString.Lazy (fromStrict, toStrict)
Expand Down
6 changes: 3 additions & 3 deletions eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-ledger-alonzo-test
version: 0.1.0.0
version: 0.1.1.1
synopsis: Tests for Cardano ledger introducing Plutus Core
description:
This package builds upon the Mary ledger with support for extended UTxO
Expand Down Expand Up @@ -71,7 +71,7 @@ library
microlens,
small-steps,
small-steps-test,
strict-containers,
cardano-strict-containers,
text,
transformers,
hs-source-dirs:
Expand Down Expand Up @@ -117,7 +117,7 @@ test-suite cardano-ledger-alonzo-test
cardano-ledger-shelley,
cardano-ledger-shelley-test,
microlens,
strict-containers,
cardano-strict-containers,
tasty,
tasty-hunit,
tasty-quickcheck,
Expand Down
4 changes: 2 additions & 2 deletions eras/babbage/impl/cardano-ledger-babbage.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-ledger-babbage
version: 0.1.0.0
version: 0.1.1.1
synopsis: TODO
description: TODO
bug-reports: https://github.com/input-output-hk/cardano-ledger/issues
Expand Down Expand Up @@ -69,7 +69,7 @@ library
plutus-tx ^>= 1.0,
set-algebra,
small-steps,
strict-containers,
cardano-strict-containers,
text,
transformers,
validation-selective
Expand Down
6 changes: 3 additions & 3 deletions eras/babbage/test-suite/cardano-ledger-babbage-test.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-ledger-babbage-test
version: 0.1.0.0
version: 0.1.1.1
synopsis: Tests for Cardano ledger babbage era
description:
This package builds upon the Alonzo ledger
Expand Down Expand Up @@ -64,7 +64,7 @@ library
cardano-ledger-shelley-test,
cardano-ledger-shelley,
small-steps,
strict-containers,
cardano-strict-containers,
text,
hs-source-dirs:
src
Expand Down Expand Up @@ -108,7 +108,7 @@ test-suite cardano-ledger-babbage-test
plutus-tx,
small-steps,
small-steps-test,
strict-containers,
cardano-strict-containers,
tasty,
tasty-hunit,
tasty-quickcheck,
Expand Down
2 changes: 1 addition & 1 deletion eras/byron/chain/executable-spec/byron-spec-chain.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: byron-spec-chain
version: 0.1.0.0
version: 0.1.1.1
synopsis: Executable specification of the Cardano blockchain
-- description:
homepage: https://github.com/input-output-hk/cardano-legder-specs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,3 @@ coverInvalidBlockProofs coverPercentage =
InvalidUpdateProposalHash,
InvalidUtxoHash
]

--------------------------------------------------------------------------------
-- FieldX instances for a 6-tuple
--------------------------------------------------------------------------------

instance Field1 (a, b, c, d, e, f) (a', b, c, d, e, f) a a' where
_1 k ~(a, b, c, d, e, f) = (\a' -> (a', b, c, d, e, f)) <$> k a
{-# INLINE _1 #-}

instance Field5 (a, b, c, d, e, f) (a, b, c, d, e', f) e e' where
_5 k ~(a, b, c, d, e, f) = (\e' -> (a, b, c, d, e', f)) <$> k e
{-# INLINE _5 #-}
3 changes: 2 additions & 1 deletion eras/byron/crypto/cardano-crypto-wrapper.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: cardano-crypto-wrapper
version: 1.3.0
version: 1.4.1
synopsis: Cryptographic primitives used in the Cardano project
description: Cryptographic primitives used in the Cardano project
license: Apache-2.0
Expand Down Expand Up @@ -93,6 +93,7 @@ library
, cryptonite
, data-default
, formatting
, heapwords
, memory
, mtl
, nothunks
Expand Down
1 change: 1 addition & 0 deletions eras/byron/crypto/src/Cardano/Crypto/Hashing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import Cardano.Binary
serialize,
withWordSize,
)
import Cardano.HeapWords
import Cardano.Prelude
import Crypto.Hash (Blake2b_256, Digest, HashAlgorithm, hashDigestSize)
import qualified Crypto.Hash as Hash
Expand Down
2 changes: 1 addition & 1 deletion eras/byron/crypto/test/cardano-crypto-test.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: cardano-crypto-test
version: 1.3.0
version: 1.4.1
synopsis: Test helpers from cardano-crypto exposed to other packages
description: Test helpers from cardano-crypto exposed to other packages
license: Apache-2.0
Expand Down
3 changes: 2 additions & 1 deletion eras/byron/ledger/executable-spec/byron-spec-ledger.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: byron-spec-ledger
version: 0.1.0.0
version: 0.1.1.1
synopsis: Executable specification of Cardano ledger
-- description:
homepage: https://github.com/input-output-hk/cardano-legder-specs
Expand Down Expand Up @@ -62,6 +62,7 @@ library
, Unique >= 0.4.7.6
-- IOHK deps
, cardano-binary
, cardano-prelude
-- Local deps
, small-steps
, small-steps-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import qualified Byron.Spec.Ledger.Core.Generators as CoreGen
import Byron.Spec.Ledger.Core.Omniscient (skey)
import qualified Byron.Spec.Ledger.GlobalParams as GP
import Byron.Spec.Ledger.Util (mkGoblinGens)
import Cardano.Prelude ()
import Control.Arrow (second, (&&&))
import Control.Monad (mzero)
import Control.State.Transition
Expand Down Expand Up @@ -86,7 +87,6 @@ import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Lens.Micro
import Lens.Micro.Extras (view)
import Lens.Micro.Internal (Field1 (..), Field2 (..), Field3 (..))
import Lens.Micro.TH (makeLenses)
import NoThunks.Class (NoThunks (..))
import Numeric.Natural
Expand Down Expand Up @@ -2130,19 +2130,3 @@ tamperWithVote vote =
pure $! vote & vSig .~ Core.sign (skey vk) (vote ^. vPropId),
pure $! vote
]

--------------------------------------------------------------------------------
-- FieldX instances for a 9-tuple
--------------------------------------------------------------------------------

instance Field1 (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' where
_1 k ~(a, b, c, d, e, f, g, h, i) = (\a' -> (a', b, c, d, e, f, g, h, i)) <$> k a
{-# INLINE _1 #-}

instance Field2 (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' where
_2 k ~(a, b, c, d, e, f, g, h, i) = (\b' -> (a, b', c, d, e, f, g, h, i)) <$> k b
{-# INLINE _2 #-}

instance Field3 (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' where
_3 k ~(a, b, c, d, e, f, g, h, i) = (\c' -> (a, b, c', d, e, f, g, h, i)) <$> k c
{-# INLINE _3 #-}
4 changes: 3 additions & 1 deletion eras/byron/ledger/impl/cardano-ledger-byron.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: cardano-ledger-byron
version: 0.1.0.0
version: 0.1.1.1
synopsis: The blockchain layer of Cardano during the Byron era
description: The blockchain layer of Cardano during the Byron era
license: Apache-2.0
Expand Down Expand Up @@ -262,6 +262,7 @@ library
, directory
, filepath
, formatting
, heapwords
, mtl
, nothunks
, quiet
Expand Down Expand Up @@ -370,6 +371,7 @@ test-suite cardano-ledger-byron-test
, filepath
, formatting
, generic-monoid
, heapwords
, hedgehog >= 1.0.4
, microlens
, resourcet
Expand Down
Loading

0 comments on commit 99b8c5d

Please sign in to comment.