Skip to content

Commit

Permalink
Bump version and CHANGELOG for cardano-ledger-core
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Dec 10, 2024
1 parent 76a0681 commit c0de4cb
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 59 deletions.
2 changes: 1 addition & 1 deletion eras/allegra/impl/cardano-ledger-allegra.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ library
aeson,
bytestring,
cardano-ledger-binary >=1.4,
cardano-ledger-core >=1.16 && <1.17,
cardano-ledger-core >=1.17 && <1.18,
cardano-ledger-shelley ^>=1.15,
cardano-strict-containers,
cardano-slotting,
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ library
cardano-ledger-allegra ^>=1.6.1,
cardano-crypto-class,
cardano-ledger-binary ^>=1.5,
cardano-ledger-core ^>=1.16,
cardano-ledger-core ^>=1.17,
cardano-ledger-mary ^>=1.7,
cardano-ledger-shelley ^>=1.15,
cardano-slotting,
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ library
base >=4.14 && <5,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.7,
cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.15,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-allegra >=1.2,
cardano-ledger-shelley:{cardano-ledger-shelley, testlib} >=1.14,
cardano-ledger-shelley-test >=1.4.1,
Expand Down
2 changes: 1 addition & 1 deletion eras/babbage/impl/cardano-ledger-babbage.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ library
cardano-ledger-allegra ^>=1.6.1,
cardano-ledger-alonzo >=1.12,
cardano-ledger-binary >=1.4,
cardano-ledger-core >=1.16 && <1.17,
cardano-ledger-core >=1.17 && <1.18,
cardano-ledger-mary ^>=1.7,
cardano-ledger-shelley ^>=1.15,
cardano-strict-containers,
Expand Down
2 changes: 1 addition & 1 deletion eras/babbage/test-suite/cardano-ledger-babbage-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ library
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.12,
cardano-ledger-alonzo-test >=1.1,
cardano-ledger-babbage >=1.10.1 && <1.11,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.11,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-shelley-ma-test >=1.1,
cardano-ledger-mary >=1.4,
cardano-ledger-shelley-test >=1.1,
Expand Down
2 changes: 1 addition & 1 deletion eras/conway/impl/cardano-ledger-conway.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ library
cardano-ledger-allegra ^>=1.6.1,
cardano-ledger-alonzo ^>=1.12,
cardano-ledger-babbage ^>=1.10.1,
cardano-ledger-core ^>=1.16,
cardano-ledger-core ^>=1.17,
cardano-ledger-mary ^>=1.7,
cardano-ledger-shelley ^>=1.15,
cardano-slotting,
Expand Down
2 changes: 1 addition & 1 deletion eras/conway/test-suite/cardano-ledger-conway-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library
cardano-ledger-babbage >=1.10.1,
cardano-ledger-binary >=1.0,
cardano-ledger-conway:{cardano-ledger-conway, testlib} >=1.16.1 && <1.19,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.11,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-mary >=1.4,
cardano-ledger-shelley-ma-test >=1.1,
cardano-ledger-shelley-test >=1.1,
Expand Down
2 changes: 1 addition & 1 deletion eras/mary/impl/cardano-ledger-mary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ library
cardano-data ^>=1.2,
cardano-ledger-allegra ^>=1.6.1,
cardano-ledger-binary >=1.4,
cardano-ledger-core >=1.16 && <1.17,
cardano-ledger-core >=1.17 && <1.18,
cardano-ledger-shelley ^>=1.15,
containers,
deepseq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ library
base >=4.14 && <5,
bytestring,
cardano-ledger-binary:{cardano-ledger-binary, testlib} ^>=1.5,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-allegra:{cardano-ledger-allegra, testlib} >=1.6 && <1.7,
cardano-ledger-mary:{cardano-ledger-mary, testlib} >=1.7 && <1.8,
cardano-slotting,
Expand Down
2 changes: 1 addition & 1 deletion eras/shelley/impl/cardano-ledger-shelley.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ library
cardano-data ^>=1.2.2,
cardano-ledger-binary ^>=1.5,
cardano-ledger-byron,
cardano-ledger-core ^>=1.16,
cardano-ledger-core ^>=1.17,
cardano-slotting,
vector-map ^>=1.1,
containers,
Expand Down
2 changes: 1 addition & 1 deletion eras/shelley/test-suite/cardano-ledger-shelley-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ library
cardano-data >=1.2,
cardano-ledger-binary:{cardano-ledger-binary, testlib} ^>=1.5,
cardano-ledger-byron,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.15,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-shelley:{cardano-ledger-shelley, testlib} >=1.14,
cardano-protocol-tpraos:{cardano-protocol-tpraos, testlib} >=1.0.1,
cardano-slotting:{cardano-slotting, testlib},
Expand Down
2 changes: 1 addition & 1 deletion libs/cardano-ledger-api/cardano-ledger-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ library
cardano-ledger-babbage >=1.10.1 && <=1.11,
cardano-ledger-binary >=1.4,
cardano-ledger-conway >=1.13 && <1.19,
cardano-ledger-core >=1.16 && <1.17,
cardano-ledger-core >=1.17 && <1.18,
cardano-ledger-mary ^>=1.7,
cardano-ledger-shelley ^>=1.15,
cardano-strict-containers,
Expand Down
34 changes: 34 additions & 0 deletions libs/cardano-ledger-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Version history for `cardano-ledger-core`

## 1.17.0.0

* Remove `HASH`, `ADDRHASH` and `DSIGN` type families out of `Crypto` type class and turn
them into type synonyms for the exact algorithms previously being used in
`StandardCrypto`
* Remove crypto parametrization from types:
* `Addr`, `BootstrapAddress`, `RewardAccount`, `CompactAddr` and `Withdrawals`
* `AuxiliaryDataHash`
* `BlocksMade`, `Anchor`
* `FutureGenDeleg`, `InstantaneousRewards`, `CommitteeAuthorization`
* `ByronEra` and `VoidEra`
* `PoolCert`
* `Credential`, `StakeReference` and `GenesisCredential`
* `DRep` and `DRepState`
* `Stake`, `SnapShot` and `SnapShots`
* `DataHash`, `ScriptHash`
* `BootstrapWitness`
* `VKey`, `KeyHash`, `GenDelegPair`, `GenDelegs`, `VRFVerKeyHash`
* `PlutusWithConext`, `ScriptFailure`, `ScriptResult`, `PlutusDebugInfo`
* `TxOutSource`
* `IndividualPoolStake`, `PoolDistr`
* `PoolParams`
* `Reward`
* `SafeHash` and `SafeToHash`
* `TxId`, `TxIn`
* `UMElem`, `RewardDelegation`, `StakeCredentials`, `UView` and `UMap`
* Remove `HashWithCrypto` as no longer needed.
* Deprecate `hashAnchorData`

### `testlib`

* Remove crypto parametrization from types: `KeyPair` and `KeyPairs`


## 1.16.0.0

* Add `toVRFVerKeyHash` and `fromVRFVerKeyHash`
Expand Down
2 changes: 1 addition & 1 deletion libs/cardano-ledger-core/cardano-ledger-core.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: cardano-ledger-core
version: 1.16.0.0
version: 1.17.0.0
license: Apache-2.0
maintainer: [email protected]
author: IOHK
Expand Down
5 changes: 1 addition & 4 deletions libs/cardano-ledger-core/src/Cardano/Ledger/Credential.hs
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,5 @@ newtype GenesisCredential = GenesisCredential
{ unGenesisCredential :: KeyHash 'Genesis
}
deriving (Generic)
deriving newtype (Eq, ToCBOR, EncCBOR)
deriving newtype (Eq, Ord, ToCBOR, EncCBOR)
deriving (Show) via Quiet GenesisCredential

instance Ord GenesisCredential where
compare (GenesisCredential gh) (GenesisCredential gh') = compare gh gh'
1 change: 0 additions & 1 deletion libs/cardano-ledger-core/src/Cardano/Ledger/Hashes.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}

-- | Various identifiers in the ledger are hashes of particular structures.
-- While the structures may change from era to era, the hash will remain the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ unpackByronVKey
Just vk -> (VKey vk, ChainCode chainCodeBytes)

verifyBootstrapWit ::
forall.
Hash EraIndependentTxBody ->
BootstrapWitness ->
Bool
Expand Down
32 changes: 9 additions & 23 deletions libs/cardano-ledger-core/src/Cardano/Ledger/SafeHash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,11 @@ import NoThunks.Class (NoThunks (..))
-- or for some other reason store their original bytes.
--
-- We do NOT export the constructor 'SafeHash', but instead export other functions
-- such as 'hashWithCrypto, 'hashAnnotated' and 'extractHash' which have constraints
-- such as 'hashAnnotated' and 'extractHash' which have constraints
-- that limit their application to types which preserve their original serialization
-- bytes.
newtype SafeHash i = SafeHash (Hash.Hash HASH i)
deriving (Show, Eq, Ord, NoThunks, NFData)

deriving newtype instance
Hash.HashAlgorithm HASH =>
SafeToHash (SafeHash i)

deriving newtype instance HeapWords (SafeHash i)

deriving instance Typeable i => ToCBOR (SafeHash i)

deriving instance Typeable i => FromCBOR (SafeHash i)

deriving instance Typeable i => EncCBOR (SafeHash i)

deriving instance Typeable i => DecCBOR (SafeHash i)
deriving (Show, Eq, Ord, NoThunks, NFData, SafeToHash, HeapWords, ToCBOR, FromCBOR, EncCBOR, DecCBOR)

deriving instance ToJSON (SafeHash i)

Expand Down Expand Up @@ -122,7 +108,7 @@ unsafeMakeSafeHash = SafeHash
-- The only exceptions are the legacy Shelley types: @Metadata@ and @ShelleyTx@, that
-- preserve their serialization bytes
-- using a different mechanism than the use of 'MemoBytes'. 'SafeToHash' is a superclass
-- requirement of the classes 'HashAnnotated' and 'HashWithCrypto' (below) which
-- requirement of the classes 'HashAnnotated' which
-- provide more convenient ways to construct SafeHashes than using 'makeHashWithExplicitProxys'.
class SafeToHash t where
-- | Extract the original bytes from 't'
Expand All @@ -133,7 +119,7 @@ class SafeToHash t where

makeHashWithExplicitProxys :: Proxy i -> t -> SafeHash i

-- | Build a @(SafeHashrypto index)@ value given to proxies (determining @i@ and @crypto@), and the
-- | Build a @(SafeHash index)@ value given a proxy determining @i@, and the
-- value to be hashed.
makeHashWithExplicitProxys _ x = SafeHash $ Hash.castHash (Hash.hashWith originalBytes x)

Expand Down Expand Up @@ -163,15 +149,15 @@ instance Hash.HashAlgorithm h => SafeToHash (Hash.Hash h i) where
-- The 'SafeToHash' and the 'HashAnnotated' classes are designed so that their
-- instances can be easily derived (because their methods have default methods
-- when the type is a newtype around a type that is 'SafeToHash'). For example,
class SafeToHash x => HashAnnotated x index | x -> index where
indexProxy :: x -> Proxy index
indexProxy _ = Proxy @index
class SafeToHash x => HashAnnotated x i | x -> i where
indexProxy :: x -> Proxy i
indexProxy _ = Proxy @i

-- | Create a @('SafeHash' i crypto)@,
-- given @(Hash.HashAlgorithm (HASH crypto))@
-- and @(HashAnnotated x i crypto)@ instances.
hashAnnotated :: x -> SafeHash index
hashAnnotated = makeHashWithExplicitProxys (Proxy @index)
hashAnnotated :: x -> SafeHash i
hashAnnotated = makeHashWithExplicitProxys (Proxy @i)
{-# INLINE hashAnnotated #-}

-- OTHER
Expand Down
26 changes: 9 additions & 17 deletions libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{-# OPTIONS_GHC -Wno-orphans #-}

-- | Benchmarks for transaction application
module Bench.Cardano.Ledger.ApplyTx (applyTxBenchmarks, ShelleyBench) where
module Bench.Cardano.Ledger.ApplyTx (applyTxBenchmarks) where

import Bench.Cardano.Ledger.ApplyTx.Gen (ApplyTxEnv (..), generateApplyTxEnvForEra)
import Cardano.Ledger.Allegra (AllegraEra)
Expand Down Expand Up @@ -42,14 +42,6 @@ import Test.Cardano.Ledger.Shelley.Generator.Core (GenEnv)
import Test.Cardano.Ledger.Shelley.Generator.EraGen (EraGen)
import Test.Control.State.Transition.Trace.Generator.QuickCheck (BaseEnv, HasTrace)

type ShelleyBench = ShelleyEra

type AllegraBench = AllegraEra

type MaryBench = MaryEra

type AlonzoBench = AlonzoEra

--------------------------------------------------------------------------------
-- Applying a Shelley transaction in multiple eras.
--
Expand Down Expand Up @@ -138,16 +130,16 @@ applyTxBenchmarks =
"applyTxBenchmarks"
[ bgroup
"ApplyTxInEra"
[ benchApplyTx (Proxy @ShelleyBench)
, benchApplyTx (Proxy @AllegraBench)
, benchApplyTx (Proxy @MaryBench)
, benchApplyTx (Proxy @AlonzoBench)
[ benchApplyTx (Proxy @ShelleyEra)
, benchApplyTx (Proxy @AllegraEra)
, benchApplyTx (Proxy @MaryEra)
, benchApplyTx (Proxy @AlonzoEra)
]
, bgroup
"Deserialise Shelley Tx"
[ deserialiseTxEra (Proxy @ShelleyBench)
, deserialiseTxEra (Proxy @AllegraBench)
, deserialiseTxEra (Proxy @MaryBench)
, deserialiseTxEra (Proxy @AlonzoBench)
[ deserialiseTxEra (Proxy @ShelleyEra)
, deserialiseTxEra (Proxy @AllegraEra)
, deserialiseTxEra (Proxy @MaryEra)
, deserialiseTxEra (Proxy @AlonzoEra)
]
]

0 comments on commit c0de4cb

Please sign in to comment.