Skip to content
Open
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
Comment thread
f-f marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: |
Integration for cardano-node 11.1. Highlights:

Breaking:
- `initialLedgerState`, `foldBlocks`, `foldEpochState`, `mkProtocolInfoCardano` and `genesisConfigToEnv` (all in `Cardano.Api.LedgerState`) take a new `SomeHasFS IO` argument, used by consensus to stream genesis data from disk.
- In `Cardano.Api.Consensus`, the `ProtocolInfoArgs` data family is now parameterised by the monad (`ProtocolInfoArgs m blk`) and `protocolInfo` returns its result monadically. The `ProtocolInfoArgsCardano` and `ProtocolInfoArgsShelley` constructors gain a `SomeHasFS m` field.
- The first type parameter of `Ledger.LedgerTables` is now the block (e.g. `HardForkBlock (CardanoEras StandardCrypto)`) rather than `LedgerState` of the block. This propagates through exported `Cardano.Api.LedgerState` items including `AnyNewEpochState`, `getLedgerTablesUTxOValues`, `toLedgerStateEvents`, `tickThenReapplyCheckHash` and `tickThenApply`.
- Removed orphan `ToJSON` instances (previously made visible by `import Cardano.Api`) for `NonEmptyMap`, `NonEmptySet`, `Ledger.StakeSnapshots` and `Ledger.StakeSnapshot`. These instances are now provided upstream.
- Dependency bound bumps: `cardano-crypto-class ^>=2.5`, `small-steps ^>=1.2`, `fs-api ^>=0.4`.

Compatible:
- `shelleyGenesisDefaults` and `conwayGenesisDefaults` populate the new `sgExtraConfig` / `cgExtraConfig` ledger fields with their default values.
kind:
- breaking
- compatible
pr: 1221
project: cardano-api
Comment thread
f-f marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: |
`Cardano.Rpc.Server.Internal.UtxoRpc.Type.txInTxOutToAnyUtxoData` now serialises the UTxO RPC `nativeBytes` for tx outputs using the era's ledger CBOR (`L.serialize' (eraProtVerHigh era)`) instead of the unversioned `Cardano.Binary.serialize'`. Downstream gRPC consumers will see the era's canonical encoding rather than the previous era-agnostic bytes.
kind:
- bugfix
pr: 1221
project: cardano-rpc
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2024-07-26"
CABAL_CACHE_VERSION: "2026-06-26"
# these two are msys2 env vars, they have no effect on non-msys2 installs.
MSYS2_PATH_TYPE: inherit
MSYSTEM: MINGW64
Expand Down
75 changes: 69 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ 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-05-28T20:13:41Z
, cardano-haskell-packages 2026-05-28T08:12:31Z

active-repositories:
, :rest
, cardano-haskell-packages:override
, hackage.haskell.org 2026-06-29T22:49:53Z
, cardano-haskell-packages 2026-07-02T10:10:00Z

packages:
cardano-api
Expand Down Expand Up @@ -156,7 +152,74 @@ if impl(ghc >=9.14)
, serialise:base
, serialise:containers
, serialise:time
, tdigest:base
, time-locale-compat:time
, with-utf8:base
-- cabal-allow-newer end

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 5399cc5f2f22e9ebd1f1326813b51e208794af21
--sha256: sha256-KNsv/ryAZoxip8UGCvbkI7ThHqnXYpjDlk3pXrSiKU8=
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-ma/test-suite
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/f-f/kes-agent.git
tag: 32c1ed675d22a30735d9f22f7afa436a3ef3e64a
--sha256: sha256-o7hFX1JnraS6Xq0WoXQwd9Z8GsPPv0Ls2DWvZ08o0ZU=
subdir:
kes-agent
kes-agent-crypto

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus.git
tag: 646329f75dbda374794ce5c0d767ef59f84705d7
--sha256: sha256-P/ZJIkng/SibhbG1vaoSMXy3OCOJgn5mZkS7kHJPIgc=
subdir:
.

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network.git
tag: 0a614a36c8969e53fd6a1c3890b36da5aff3b0a2
--sha256: sha256-p32/Y6jXwiSwa0yVspdx246KHaCBmqe2zB+UpxudeJc=
subdir:
./cardano-diffusion
./monoidal-synchronisation
./network-mux
./ouroboros-network

source-repository-package
type: git
location: https://github.com/IntersectMBO/plutus.git
tag: b1db04cc425fab303ac3b79d7140dc2a17f29e6d
--sha256: sha256-XtYzjNVx4+IGWpgm+p/YTf56DrJtK0I98umZCTE3U80=
subdir:
plutus-core
plutus-ledger-api
plutus-tx
14 changes: 9 additions & 5 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ library
bytestring,
bytestring-trie,
cardano-addresses ^>=4.0.0,
cardano-base ^>=0.1,
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.3,
cardano-crypto-class ^>=2.5,
cardano-crypto-wrapper ^>=1.7,
cardano-data >=1.0,
cardano-diffusion:{api, cardano-diffusion} ^>=1.0,
Expand All @@ -149,6 +150,7 @@ library
cardano-ledger-dijkstra >=0.1,
cardano-ledger-mary >=1.8,
cardano-ledger-shelley >=1.16,
cardano-protocol ^>=0.1,
cardano-protocol-tpraos >=1.4,
cardano-slotting >=0.2.0.0,
cardano-strict-containers >=0.1,
Expand All @@ -164,10 +166,11 @@ library
extra,
filepath,
formatting,
fs-api ^>=0.4,
iproute,
memory,
mempack,
microlens <0.5,
microlens <0.6,
mono-traversable,
mtl,
network,
Expand Down Expand Up @@ -328,8 +331,8 @@ library gen
base16-bytestring,
bytestring,
cardano-api,
cardano-binary >=1.6 && <1.9,
cardano-crypto-class ^>=2.3,
cardano-binary >=1.6 && <1.10,
cardano-crypto-class ^>=2.5,
cardano-crypto-wrapper:testlib ^>=1.7,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib},
cardano-ledger-byron:testlib,
Expand All @@ -343,6 +346,7 @@ library gen
hedgehog >=1.1,
hedgehog-extras,
hedgehog-quickcheck,
mempack,
ordered-containers,
tasty,
tasty-hedgehog,
Expand All @@ -366,7 +370,7 @@ test-suite cardano-api-test
cardano-api:gen,
cardano-binary,
cardano-crypto,
cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.3,
cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.5,
cardano-crypto-wrapper:testlib,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.13,
Expand Down
7 changes: 6 additions & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import Cardano.Ledger.Plutus.CostModels qualified as Plutus
import Cardano.Ledger.Plutus.Language qualified as Alonzo
import Cardano.Ledger.Shelley.TxAuxData (Metadatum (..), ShelleyTxAuxData (..))

import Data.ByteString.Short qualified as SBS
import Data.Map.Strict qualified as Map
import Data.MemPack.Buffer (byteArrayFromShortByteString)
import Data.Word (Word64)
import GHC.Exts (IsList (..))

Expand All @@ -41,7 +43,10 @@ genMetadata = do
genMetadatum :: Gen Metadatum
genMetadatum = do
int <- Gen.list (Range.linear 1 5) (I <$> Gen.integral (Range.linear 1 100))
bytes <- Gen.list (Range.linear 1 5) (B <$> Gen.bytes (Range.linear 1 20))
bytes <-
Gen.list
(Range.linear 1 5)
(B . byteArrayFromShortByteString . SBS.toShort <$> Gen.bytes (Range.linear 1 20))
str <- Gen.list (Range.linear 1 5) (S <$> Gen.text (Range.linear 1 20) Gen.alphaNum)
let mDatumList = int ++ bytes ++ str

Expand Down
24 changes: 17 additions & 7 deletions cardano-api/gen/Test/Gen/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

module Test.Gen.Cardano.Api.ProtocolParameters where

Expand All @@ -7,6 +9,7 @@ import Cardano.Api.Ledger

import Test.Cardano.Ledger.Alonzo.Arbitrary ()
import Test.Cardano.Ledger.Conway.Arbitrary ()
import Test.Cardano.Ledger.Core.Arbitrary (genEraProtVer)

import Hedgehog (MonadGen)
import Hedgehog.Gen qualified as Gen
Expand Down Expand Up @@ -40,8 +43,15 @@ genCommonProtocolParametersUpdate =
genDeprecatedAfterMaryPParams :: MonadGen m => m (DeprecatedAfterMaryPParams era)
genDeprecatedAfterMaryPParams = DeprecatedAfterMaryPParams <$> genStrictMaybe Q.arbitrary

genDeprecatedAfterBabbagePParams :: MonadGen m => m (DeprecatedAfterBabbagePParams era)
genDeprecatedAfterBabbagePParams = DeprecatedAfterBabbagePParams <$> genStrictMaybe Q.arbitrary
genDeprecatedAfterBabbagePParams
:: forall era ledgerera m
. MonadGen m
=> ShelleyBasedEra era
-> m (DeprecatedAfterBabbagePParams ledgerera)
genDeprecatedAfterBabbagePParams sbe =
shelleyBasedEraConstraints sbe $
DeprecatedAfterBabbagePParams
<$> genStrictMaybe (Q.quickcheck (genEraProtVer @(ShelleyLedgerEra era)))

genShelleyToAlonzoPParams :: MonadGen m => m (ShelleyToAlonzoPParams era)
genShelleyToAlonzoPParams =
Expand Down Expand Up @@ -100,7 +110,7 @@ genShelleyEraBasedProtocolParametersUpdate =
ShelleyEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genDeprecatedAfterBabbagePParams
<*> genDeprecatedAfterBabbagePParams ShelleyBasedEraShelley
<*> genShelleyToAlonzoPParams

genAllegraEraBasedProtocolParametersUpdate
Expand All @@ -110,7 +120,7 @@ genAllegraEraBasedProtocolParametersUpdate =
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genShelleyToAlonzoPParams
<*> genDeprecatedAfterBabbagePParams
<*> genDeprecatedAfterBabbagePParams ShelleyBasedEraAllegra

genMaryEraBasedProtocolParametersUpdate
:: MonadGen m => m (EraBasedProtocolParametersUpdate MaryEra)
Expand All @@ -119,7 +129,7 @@ genMaryEraBasedProtocolParametersUpdate =
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genShelleyToAlonzoPParams
<*> genDeprecatedAfterBabbagePParams
<*> genDeprecatedAfterBabbagePParams ShelleyBasedEraMary

genAlonzoEraBasedProtocolParametersUpdate
:: MonadGen m => m (EraBasedProtocolParametersUpdate AlonzoEra)
Expand All @@ -128,15 +138,15 @@ genAlonzoEraBasedProtocolParametersUpdate =
<$> genCommonProtocolParametersUpdate
<*> genShelleyToAlonzoPParams
<*> genAlonzoOnwardsPParams
<*> genDeprecatedAfterBabbagePParams
<*> genDeprecatedAfterBabbagePParams ShelleyBasedEraAlonzo

genBabbageEraBasedProtocolParametersUpdate
:: MonadGen m => m (EraBasedProtocolParametersUpdate BabbageEra)
genBabbageEraBasedProtocolParametersUpdate =
BabbageEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genAlonzoOnwardsPParams
<*> genDeprecatedAfterBabbagePParams
<*> genDeprecatedAfterBabbagePParams ShelleyBasedEraBabbage
<*> genIntroducedInBabbagePParams

genConwayEraBasedProtocolParametersUpdate
Expand Down
5 changes: 4 additions & 1 deletion cardano-api/src/Cardano/Api/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import Data.Aeson qualified as Aeson
import Data.ByteString qualified as BS
import Data.ByteString.Short qualified as SBS
import Data.Foldable (Foldable (toList))
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import Lens.Micro

Expand Down Expand Up @@ -331,7 +332,9 @@ toConsensusPoint
-> Consensus.Point (Consensus.ShelleyBlock protocol ledgerera)
toConsensusPoint ChainPointAtGenesis = Consensus.GenesisPoint
toConsensusPoint (ChainPoint slot (HeaderHash h)) =
Consensus.BlockPoint slot (Consensus.fromShortRawHash proxy h)
Consensus.BlockPoint
slot
(fromMaybe (error "toConsensusPoint: hash size mismatch") (Consensus.fromShortRawHash proxy h))
where
proxy :: Proxy (Consensus.ShelleyBlock protocol ledgerera)
proxy = Proxy
Expand Down
9 changes: 5 additions & 4 deletions cardano-api/src/Cardano/Api/Certificate/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Cardano.Api.Key.Internal
import Cardano.Api.Key.Internal.Praos
import Cardano.Api.Ledger.Internal.Reexport qualified as Ledger

import Cardano.Base.IP (mkIPv4, mkIPv6, unIPv4, unIPv6)
import Cardano.Ledger.Coin qualified as L
import Cardano.Ledger.State qualified as Ledger

Expand Down Expand Up @@ -125,8 +126,8 @@ toShelleyPoolParams
toShelleyStakePoolRelay (StakePoolRelayIp mipv4 mipv6 mport) =
Ledger.SingleHostAddr
(fromIntegral <$> Ledger.maybeToStrictMaybe mport)
(Ledger.maybeToStrictMaybe mipv4)
(Ledger.maybeToStrictMaybe mipv6)
(Ledger.maybeToStrictMaybe (mkIPv4 <$> mipv4))
(Ledger.maybeToStrictMaybe (mkIPv6 <$> mipv6))
toShelleyStakePoolRelay (StakePoolRelayDnsARecord dnsname mport) =
Ledger.SingleHostName
(fromIntegral <$> Ledger.maybeToStrictMaybe mport)
Expand Down Expand Up @@ -192,8 +193,8 @@ fromShelleyPoolParams
fromShelleyStakePoolRelay :: Ledger.StakePoolRelay -> StakePoolRelay
fromShelleyStakePoolRelay (Ledger.SingleHostAddr mport mipv4 mipv6) =
StakePoolRelayIp
(Ledger.strictMaybeToMaybe mipv4)
(Ledger.strictMaybeToMaybe mipv6)
(fmap unIPv4 (Ledger.strictMaybeToMaybe mipv4))
(fmap unIPv6 (Ledger.strictMaybeToMaybe mipv6))
(fromIntegral . Ledger.portToWord16 <$> Ledger.strictMaybeToMaybe mport)
fromShelleyStakePoolRelay (Ledger.SingleHostName mport dnsname) =
StakePoolRelayDnsARecord
Expand Down
Loading