Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changes/20260910_200246_cardano-api_kolam_prepare_11_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: |
Compatibility updates for ouroboros-consensus 4.0, cardano-ledger, and plutus 1.68:
fix `SerialisedPoolState` to carry an era type parameter, add `individualPoolStakeBls`
field to `IndividualPoolStake`, update `History.Bound` to the new Peras API
(`PerasRoundNo`, `NoPerasEnabled`), and bump dependency bounds accordingly.
kind:
- release
pr: 1328
project: cardano-api
8 changes: 8 additions & 0 deletions .changes/20260910_200246_cardano-rpc_kolam_prepare_11_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: |
Compatibility updates for grapesy and cardano-ledger: replace `memory` with `ram`,
update `exceptionToClient` to the new `ExactException` handler signature, and adapt
`PoolCert`/`StakePoolParams` usages to their new era type parameter.
kind:
- release
pr: 1328
project: cardano-rpc
73 changes: 71 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2026-08-02T17:21:34Z
, hackage.haskell.org 2026-09-02T14:05:07Z
, cardano-haskell-packages 2026-09-03T10:20:53Z

packages:
Expand Down Expand Up @@ -50,7 +50,7 @@ semaphore: True

constraints:
-- haskell.nix patch does not work for 1.6.8
, any.crypton-x509-system < 1.6.8
, any.crypton-x509-system (< 1.6.8 || >= 1.7)


-- WASM compilation specific
Expand Down Expand Up @@ -132,6 +132,8 @@ allow-newer:
, microstache:aeson
, monad-control:transformers
, http-api-data:text-iso8601
-- cardano-addresses-4.0.x bounds crypton < 1.1 but we have 1.1.4
, cardano-addresses:crypton

-- cabal-allow-newer begin
if impl(ghc >=9.14)
Expand Down Expand Up @@ -166,3 +168,70 @@ if impl(ghc >=9.14)
, time-locale-compat:time
, with-utf8:base
-- cabal-allow-newer end

source-repository-package
type: git
location: https://github.com/input-output-hk/kes-agent
tag: 4625f3cf543566517d08882e659c97932d106d86
--sha256: sha256-CSHWndpeJFqCEFNT6ysfyN6x+O4vZ9TtYOOsZKcLnIA=
subdir:
kes-agent
kes-agent-crypto

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: fb723848a28256fe372ea9ba692eccded6a12a53
--sha256: sha256-iL61RTn4OPRNzzPn/2YcVJNMJYolXghaQ9cDG/DOOWM=
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/babbage/impl
eras/byron/chain/executable-spec
eras/byron/crypto
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/conway/impl
eras/dijkstra/impl
eras/mary/impl
eras/shelley/impl
eras/shelley/test-suite
libs/cardano-data
libs/cardano-ledger-api
libs/cardano-ledger-binary
libs/cardano-ledger-core
libs/cardano-protocol
libs/cardano-protocol-tpraos
libs/non-integral
libs/small-steps
libs/vector-map

source-repository-package
type: git
location: https://github.com/intersectmbo/cardano-base.git
--sha256: sha256-WUBluY6UqvBkS5cNsJnKMOaW+1dTfL3mg8iq/kVPV0o=
tag: d92e2e3841eaad354c5e1ef77b458b347f471271
subdir: cardano-crypto-leios

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 835d3747eb2fbd6b7d69e73245ec7c9703faec21
--sha256: sha256-ZDAPypcfLn7xzUyxcI7ktHxnvUKtPEHcPR522+c04Ao=
subdir:
.

source-repository-package
type: git
location: https://github.com/well-typed/grapesy
tag: bd6af64f69ff89e3a8fc02e2c81262e648f4715d
--sha256: sha256-4F+bUoytvrgOcQ8aIWbOY9uYsPoTZwQOlmh7ckgyK9M=
subdir:
grapesy
grpc-spec

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-crypto
tag: ac2e12a471b735ad80949bcbf0f6f634e5dbef77
--sha256: sha256-NvbMk41W2PQy2H91nkG0GtPyGDwia0y6DQNNf9RtoAc=
34 changes: 17 additions & 17 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ library
cardano-base ^>=0.1,
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.5,
cardano-crypto-wrapper ^>=1.7,
cardano-crypto-class ^>=2.6,
cardano-crypto-wrapper ^>=1.8,
cardano-data >=1.0,
cardano-diffusion:{api, cardano-diffusion} ^>=1.1,
cardano-ledger-allegra >=1.7,
cardano-ledger-alonzo >=1.15,
cardano-ledger-api ^>=1.14,
cardano-ledger-alonzo >=1.17,
cardano-ledger-api ^>=1.15,
cardano-ledger-babbage >=1.11,
cardano-ledger-binary >=1.6,
cardano-ledger-byron >=1.2,
cardano-ledger-conway >=1.19,
cardano-ledger-core >=1.20,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.20,
cardano-ledger-dijkstra >=0.1,
cardano-ledger-mary >=1.8,
cardano-ledger-shelley >=1.16,
Expand Down Expand Up @@ -178,22 +178,22 @@ library
network-mux,
nothunks,
ordered-containers,
ouroboros-consensus:{cardano, diffusion, ouroboros-consensus, protocol} ^>=4.2.1.0,
ouroboros-consensus:{cardano, diffusion, ouroboros-consensus, protocol} ^>=4.0,
ouroboros-network:{api, framework, ouroboros-network, protocols} ^>=1.2,
parsec,
plutus-core ^>=1.65,
plutus-ledger-api ^>=1.65,
plutus-core ^>=1.68,
plutus-ledger-api ^>=1.68,
pretty-simple,
prettyprinter,
prettyprinter-ansi-terminal,
prettyprinter-configurable ^>=1.36,
random,
resource-registry ^>=0.3,
resource-registry ^>=0.4,
safe-exceptions,
scientific,
serialise,
singletons,
small-steps ^>=1.1,
small-steps ^>=1.2,
sop-core,
sop-extras,
stm,
Expand Down Expand Up @@ -329,8 +329,8 @@ library gen
bytestring,
cardano-api,
cardano-binary >=1.6 && <1.10,
cardano-crypto-class ^>=2.5,
cardano-crypto-wrapper:testlib ^>=1.7,
cardano-crypto-class ^>=2.6,
cardano-crypto-wrapper:testlib ^>=1.8,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib},
cardano-ledger-byron:testlib,
cardano-ledger-conway:testlib,
Expand Down Expand Up @@ -373,11 +373,11 @@ test-suite cardano-api-test
cardano-api:gen,
cardano-binary,
cardano-crypto,
cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.5,
cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.6,
cardano-crypto-wrapper:testlib,
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.14,
cardano-ledger-api ^>=1.15,
cardano-ledger-babbage,
cardano-ledger-binary,
cardano-ledger-conway,
Expand Down Expand Up @@ -463,7 +463,7 @@ test-suite cardano-api-golden
cardano-crypto-class,
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.14,
cardano-ledger-api ^>=1.15,
cardano-ledger-binary,
cardano-ledger-core,
cardano-ledger-shelley,
Expand All @@ -475,8 +475,8 @@ test-suite cardano-api-golden
hedgehog >=1.1,
hedgehog-extras ^>=0.10,
microlens,
plutus-core ^>=1.65,
plutus-ledger-api ^>=1.65,
plutus-core ^>=1.68,
plutus-ledger-api ^>=1.68,
tasty,
tasty-discover,
tasty-hedgehog,
Expand Down
5 changes: 3 additions & 2 deletions cardano-api/src/Cardano/Api/Certificate/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ data StakePoolMetadataReference
-- Internal conversion functions
--

toShelleyPoolParams :: StakePoolParameters -> Ledger.StakePoolParams
toShelleyPoolParams :: StakePoolParameters -> Ledger.StakePoolParams era
toShelleyPoolParams
StakePoolParameters
{ stakePoolId = StakePoolKeyHash poolkh
Expand All @@ -104,6 +104,7 @@ toShelleyPoolParams
Ledger.StakePoolParams
{ Ledger.sppId = poolkh
, Ledger.sppVrf = Ledger.toVRFVerKeyHash vrfkh
, Ledger.sppBlsKey = Ledger.SNothing
, Ledger.sppPledge = stakePoolPledge
, Ledger.sppCost = stakePoolCost
, Ledger.sppMargin =
Expand Down Expand Up @@ -159,7 +160,7 @@ toShelleyPoolParams
Ledger.textToUrl (Text.length url) url

fromShelleyPoolParams
:: Ledger.StakePoolParams
:: Ledger.StakePoolParams era
-> StakePoolParameters
fromShelleyPoolParams
Ledger.StakePoolParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableSuperClasses #-}

module Cardano.Api.Consensus.Internal.Protocol
( BlockType (..)
Expand Down
20 changes: 14 additions & 6 deletions cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Cardano.Crypto.Util (SignableRepresentation (..))
import Cardano.Crypto.Wallet qualified as CC

import Control.DeepSeq (NFData)
import Data.ByteArray as BA (ByteArrayAccess, ScrubbedBytes, convert)
import Data.ByteArray as BA (ByteArrayAccess, convert, length, withByteArray)
import Data.ByteString (ByteString)
import Data.ByteString qualified as BS
import GHC.Generics (Generic)
Expand Down Expand Up @@ -59,12 +59,12 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where
deriving NoThunks via InspectHeap CC.XPub

newtype SignKeyDSIGN Ed25519Bip32DSIGN = SignKeyEd25519Bip32DSIGN CC.XPrv
deriving (Generic, ByteArrayAccess)
deriving Generic
deriving newtype NFData
deriving NoThunks via InspectHeap CC.XPrv

newtype SigDSIGN Ed25519Bip32DSIGN = SigEd25519Bip32DSIGN CC.XSignature
deriving (Show, Eq, Generic, ByteArrayAccess)
deriving (Show, Eq, Generic)
deriving NoThunks via InspectHeap CC.XSignature

--
Expand All @@ -84,7 +84,7 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where

signDSIGN () a (SignKeyEd25519Bip32DSIGN sk) =
SigEd25519Bip32DSIGN $
CC.sign (mempty :: ScrubbedBytes) sk (getSignableRepresentation a)
CC.sign (mempty :: ByteString) sk (getSignableRepresentation a)

verifyDSIGN () (VerKeyEd25519Bip32DSIGN vk) a (SigEd25519Bip32DSIGN sig) =
if CC.verify vk (getSignableRepresentation a) sig
Expand All @@ -99,8 +99,16 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where
SignKeyEd25519Bip32DSIGN $
CC.generateNew
(getSeedBytes seed)
(mempty :: ScrubbedBytes)
(mempty :: ScrubbedBytes)
(mempty :: ByteString)
(mempty :: ByteString)

instance ByteArrayAccess (SignKeyDSIGN Ed25519Bip32DSIGN) where
length (SignKeyEd25519Bip32DSIGN sk) = BA.length (CC.unXPrv sk)
withByteArray (SignKeyEd25519Bip32DSIGN sk) = BA.withByteArray (CC.unXPrv sk)

instance ByteArrayAccess (SigDSIGN Ed25519Bip32DSIGN) where
length (SigEd25519Bip32DSIGN sig) = BA.length (CC.unXSignature sig)
withByteArray (SigEd25519Bip32DSIGN sig) = BA.withByteArray (CC.unXSignature sig)

instance FixedSizeCodec (VerKeyDSIGN Ed25519Bip32DSIGN) where
type FixedSize (VerKeyDSIGN Ed25519Bip32DSIGN) = 64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ makeStakeAddressUnregistrationCertificate scred deposit =
makeStakePoolRegistrationCertificate
:: forall era
. IsEra era
=> Ledger.StakePoolParams
=> Ledger.StakePoolParams (LedgerEra era)
-> Certificate (LedgerEra era)
makeStakePoolRegistrationCertificate poolParams =
obtainCommonConstraints (useEra @era) $
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ makeStakeAddressUnregistrationCertificate scred =
makeStakePoolRegistrationCertificate
:: forall era
. IsShelleyBasedEra era
=> Ledger.StakePoolParams
=> Ledger.StakePoolParams (ShelleyLedgerEra era)
-> Certificate (ShelleyLedgerEra era)
makeStakePoolRegistrationCertificate poolParams =
shelleyBasedEraConstraints (shelleyBasedEra @era) $
Expand Down
Loading
Loading