Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5625233
wip: cardano-api with kes-agent support
fraser-iohk Jun 25, 2025
156d119
Add `DijkstraEra era` to `CardanoEra era`
Jimbo4350 Jul 30, 2025
2872eda
Add `ShelleyBasedEraDijkstra` to `ShelleyBasedEra era`
Jimbo4350 Jul 30, 2025
dda8797
Add Dijkstra era to eons
Jimbo4350 Jul 30, 2025
704d11d
Add `DijkstraEra` to `Era era`
Jimbo4350 Jul 30, 2025
7a86381
COMBINE ME: cabal file updates
Jimbo4350 Jul 30, 2025
5be60e0
Update `QueryInShelleyBasedEra era result`
Jimbo4350 Jul 30, 2025
3a8826d
Update `makeShelleyTransactionBody` with Dijkstra era
Jimbo4350 Jul 30, 2025
e63bb2c
Update ledger types `PParamUpdatePurpose`, `CommitteePurpose` and
Jimbo4350 Jul 30, 2025
63ad603
Propagate `ChainAccountState`
Jimbo4350 Jul 30, 2025
b483de7
Consensus related Dijkstra changes
Jimbo4350 Jul 30, 2025
0d8ee49
Temporary Cardano.Api.LedgerState Dijkstra update
Jimbo4350 Jul 30, 2025
730ff11
Update TxOut rendering to handle Dijkstra era
Jimbo4350 Jul 30, 2025
ca28c36
Update `eraSpecificLedgerTxBody` with Dijkstra era
Jimbo4350 Jul 30, 2025
d91aedc
Update `decodeBigLedgerPeerSnapshot` to support snapshot SRV names
Jimbo4350 Jul 30, 2025
338a657
Update generators with PlutusScriptV4
Jimbo4350 Jul 30, 2025
acdff31
Introduce PlutusScriptV4
Jimbo4350 Jul 30, 2025
3437b94
Propagate Dijkstra era
Jimbo4350 Jul 30, 2025
0a737a6
Merge with PlutusV4 intro
Jimbo4350 Jul 30, 2025
5229ec3
Merge with propagate Dikstra
Jimbo4350 Jul 30, 2025
6e832cb
REMOVE ME: Add ledger and consensus SRPs
Jimbo4350 Jul 30, 2025
8330132
Update nix flake
Jimbo4350 Jul 30, 2025
f3ca538
Update cardano-rpc with PlutusV4
Jimbo4350 Jul 31, 2025
6d81484
Implement `executeLocalStateQueryExprWithVersion`
Jimbo4350 Jul 31, 2025
4904a0d
Fix parseHardForkTriggers
Jimbo4350 Jul 31, 2025
2da81eb
Fix cardano-rpc-test for protocol parameters roundtrip
carbolymer Aug 1, 2025
673e4a8
Update flake lock and ouroboros-network and plutus patches
palas Aug 1, 2025
65013af
Update wasm cache
palas Aug 1, 2025
1efbb74
Merge with: Consensus related Dijkstra change
Aug 7, 2025
faab1c2
Use exampleDijkstraGenesis value
Aug 7, 2025
7b8fa12
Fix cabal-gild CI failure
Aug 7, 2025
0eeff17
Run formolu
Aug 7, 2025
a93eab2
Fix HLS CI job
carbolymer Aug 11, 2025
79b9c02
Address lints
palas Aug 12, 2025
64e62e7
Update `ouroboros-consensus` stanza
palas Aug 12, 2025
bb549c0
Merge remote-tracking branch 'origin/ana/v2-node-release-10.6' into a…
ana-pantilie Aug 20, 2025
ff4b7ca
Merge remote-tracking branch 'origin/fraser-iohk/cardano-api-kes-agen…
ana-pantilie Aug 20, 2025
7ae44e9
WIP: update ledger and index-state
ana-pantilie Aug 21, 2025
f18e5cb
Fix most compilation errors
ana-pantilie Aug 25, 2025
764c708
Upgrade plutus to 1.52
ana-pantilie Aug 25, 2025
c21f792
Add bounds to quickcheck
ana-pantilie Aug 26, 2025
ee5eccf
Add another quickcheck bound
ana-pantilie Aug 26, 2025
f3de953
Fill in undefineds
Jimbo4350 Aug 26, 2025
22b76a1
Bump CHaP in nix flake
Jimbo4350 Sep 9, 2025
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
117 changes: 73 additions & 44 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 2025-07-22T09:13:54Z
, hackage.haskell.org 2025-06-22T20:18:27Z
, cardano-haskell-packages 2025-07-28T14:33:19Z

packages:
Expand Down Expand Up @@ -61,49 +61,6 @@ if impl (ghc >= 9.12)
-- https://github.com/kapralVV/Unique/issues/11
, Unique:hashable

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 5aac28bec41b7709f75a5c9f20e2431259cf237f
--sha256: sha256-PXnD7mAIZgnodqbMU3ImCb/uoat61vLsqnc6dUyTRIw=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol
sop-extras
strict-sop-core

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: 20485948f78ab139d246695e540f9ec00963a16e
--sha256: sha256-SHnyp+GvNeR82UXoKeDEgsp1AUE2yF5dGL4HIZm0zK8=
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/babbage/test-suite
eras/byron/chain/executable-spec
eras/byron/crypto
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/conway/impl
eras/dijkstra
eras/mary/impl
eras/shelley/impl
eras/shelley-ma/test-suite
eras/shelley/test-suite
libs/cardano-data
libs/cardano-ledger-api
libs/cardano-ledger-binary
libs/cardano-ledger-core
libs/cardano-protocol-tpraos
libs/non-integral
libs/set-algebra
libs/small-steps
libs/vector-map

-- WASM compilation specific

Expand Down Expand Up @@ -211,3 +168,75 @@ allow-newer:
, ral:QuickCheck
, fin:QuickCheck
, bin:QuickCheck
, cardano-ledger-core
, cardano-ledger-byron
, serdoc-core:tasty-quickcheck

, kes-agent:containers
-- , hedgehog-quickcheck:QuickCheck
, *:QuickCheck

source-repository-package
type: git
location: https://github.com/input-output-hk/kes-agent
tag: 60acf5d1c949695dc7822945b18fc916e7ef4391
--sha256: sha256-oTsxaFAs1c/H0oYLhiivO5mr48oHNsPi5k2XyXxwCJg=
subdir:
kes-agent

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network
tag: 253316ae1c5ec0eaf79f306eac1986969b7842a4
--sha256: sha256-0HZ49kIgCrv/H9I/aUb+wFfRiVuZMrUofJFdgWPG17o=
subdir: ouroboros-network-api
ouroboros-network
ouroboros-network-framework
ouroboros-network-protocols

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

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 26c831eb40bd15750ef8243285466fe9bd582cf7
--sha256: sha256-oTsxaFAs1c/H0oYLhiivO5mr48oHNsPi5k2XyXxwCJg=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol
sop-extras
strict-sop-core
6 changes: 3 additions & 3 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ library
ouroboros-consensus-diffusion ^>=0.23,
ouroboros-consensus-protocol ^>=0.12,
ouroboros-network,
ouroboros-network-api >=0.14,
ouroboros-network-api >=0.15,
ouroboros-network-framework,
ouroboros-network-protocols >=0.14,
ouroboros-network-protocols >=0.15,
parsec,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.50,
pretty-simple,
Expand Down Expand Up @@ -313,7 +313,7 @@ library gen
cardano-crypto-class ^>=2.2.1,
cardano-crypto-test ^>=1.6,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.8.1,
cardano-ledger-byron-test >=1.5,
cardano-ledger-byron:{testlib} >=1.1,
cardano-ledger-conway:testlib,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-shelley >=1.13,
Expand Down
1 change: 1 addition & 0 deletions cardano-api/src/Cardano/Api/Consensus/Internal/InMode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,4 @@ fromConsensusApplyTxErr = \case
TxValidationErrorInCardanoMode $ ShelleyTxValidationError ShelleyBasedEraDijkstra err
Consensus.ApplyTxErrWrongEra err ->
TxValidationEraMismatch err
_ -> undefined
15 changes: 11 additions & 4 deletions cardano-api/src/Cardano/Api/Consensus/Internal/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ where

import Cardano.Api.Consensus.Internal.Mode

import qualified Control.Tracer as Tracer
import Ouroboros.Consensus.Block.Forging (BlockForging)
import Ouroboros.Consensus.Byron.ByronHFC (ByronBlockHFC)
import Ouroboros.Consensus.Cardano
Expand All @@ -31,6 +32,7 @@ import Ouroboros.Consensus.HardFork.Combinator.Embed.Unary
import Ouroboros.Consensus.Ledger.SupportsProtocol qualified as Consensus (LedgerSupportsProtocol)
import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolClientInfo (..), ProtocolInfo (..))
import Ouroboros.Consensus.Node.Run (RunNode)
import Ouroboros.Consensus.Protocol.Praos.AgentClient
import Ouroboros.Consensus.Protocol.TPraos qualified as Consensus
import Ouroboros.Consensus.Shelley.Eras qualified as Consensus (ShelleyEra)
import Ouroboros.Consensus.Shelley.Ledger.Block qualified as Consensus (ShelleyBlock)
Expand All @@ -44,7 +46,11 @@ import Type.Reflection ((:~:) (..))

class (RunNode blk, IOLike m) => Protocol m blk where
data ProtocolInfoArgs blk
protocolInfo :: ProtocolInfoArgs blk -> (ProtocolInfo blk, m [BlockForging m blk])
protocolInfo
:: ProtocolInfoArgs blk
-> ( ProtocolInfo blk
, Tracer.Tracer m KESAgentClientTrace -> m [BlockForging m blk]
)

-- | Node client support for each consensus protocol.
--
Expand All @@ -59,10 +65,10 @@ instance IOLike m => Protocol m ByronBlockHFC where
data ProtocolInfoArgs ByronBlockHFC = ProtocolInfoArgsByron ProtocolParamsByron
protocolInfo (ProtocolInfoArgsByron params) =
( inject $ protocolInfoByron params
, pure . map inject $ blockForgingByron params
, \_ -> pure . map inject $ blockForgingByron params
)

instance (CardanoHardForkConstraints StandardCrypto, IOLike m) => Protocol m (CardanoBlock StandardCrypto) where
instance (CardanoHardForkConstraints StandardCrypto, IOLike m, MonadKESAgent m) => Protocol m (CardanoBlock StandardCrypto) where
data ProtocolInfoArgs (CardanoBlock StandardCrypto)
= ProtocolInfoArgsCardano
(CardanoProtocolParams StandardCrypto)
Expand All @@ -89,6 +95,7 @@ instance
(Consensus.TPraos StandardCrypto)
ShelleyEra
)
, MonadKESAgent m
)
=> Protocol m (ShelleyBlockHFC (Consensus.TPraos StandardCrypto) ShelleyEra)
where
Expand All @@ -98,7 +105,7 @@ instance
(ProtocolParamsShelleyBased StandardCrypto)
ProtVer
protocolInfo (ProtocolInfoArgsShelley genesis paramsShelleyBased_ paramsShelley_) =
bimap inject (fmap $ map inject) $
bimap inject (fmap $ fmap $ map inject) $
protocolInfoShelley genesis paramsShelleyBased_ paramsShelley_

instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,5 @@ getPlutusDatum L.SPlutusV3 (SpendingScriptDatum d) = d
getPlutusDatum L.SPlutusV4 (SpendingScriptDatum _d) = error "dijkstra"
getPlutusDatum _ InlineDatum = Nothing
getPlutusDatum _ NoScriptDatum = Nothing
getPlutusDatum _ _ = undefined

1 change: 1 addition & 0 deletions cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ module Cardano.Api.Ledger.Internal.Reexport
-- Shelley
, secondsToNominalDiffTimeMicro
, AccountState
, ChainAccountState (..)
, NewEpochState (..)
, ShelleyGenesisStaking (..)
-- Babbage
Expand Down
8 changes: 7 additions & 1 deletion cardano-api/src/Cardano/Api/LedgerState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
import Ouroboros.Consensus.Node.ProtocolInfo qualified as Consensus
import Ouroboros.Consensus.Protocol.Abstract (ChainDepState, ConsensusProtocol (..))
import Ouroboros.Consensus.Protocol.Praos qualified as Praos
import Ouroboros.Consensus.Protocol.Praos.AgentClient
import Ouroboros.Consensus.Protocol.Praos.Common qualified as Consensus
import Ouroboros.Consensus.Protocol.Praos.VRF (mkInputVRF, vrfLeaderValue)
import Ouroboros.Consensus.Protocol.TPraos qualified as TPraos
Expand All @@ -214,6 +215,7 @@
import Control.Exception.Safe
import Control.Monad
import Control.Monad.State.Strict
import qualified Control.Tracer as Tracer
import Data.Aeson as Aeson
( FromJSON (parseJSON)
, Object
Expand Down Expand Up @@ -1399,8 +1401,12 @@
2 <- CBOR.decodeListLen
hst <-
HFC.HardForkLedgerState
<<<<<<< HEAD
<$> HFC.decodeTelescope
(byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* dijkstra :* Nil)
=======
<$> HFC.decodeTelescope (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* undefined :* Nil)
>>>>>>> origin/fraser-iohk/cardano-api-kes-agent
tbs <- Ledger.valuesMKDecoder hst
pure (LedgerState hst tbs)
where
Expand Down Expand Up @@ -1454,7 +1460,7 @@
:: GenesisConfig
-> ( Consensus.ProtocolInfo
(Consensus.CardanoBlock Consensus.StandardCrypto)
, IO [BlockForging IO (Consensus.CardanoBlock Consensus.StandardCrypto)]
, Tracer.Tracer IO KESAgentClientTrace -> IO [BlockForging IO (Consensus.CardanoBlock Consensus.StandardCrypto)]
)
mkProtocolInfoCardano (GenesisCardano dnc byronGenesis shelleyGenesisHash transCfg) =
Consensus.protocolInfoCardano
Expand Down
4 changes: 0 additions & 4 deletions cardano-api/src/Cardano/Api/Query/Internal/Convenience.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ import Cardano.Ledger.Coin qualified as L
import Cardano.Ledger.Conway.State (ChainAccountState (..), DRepState (..))
import Cardano.Ledger.Credential qualified as L
import Cardano.Ledger.Keys qualified as L
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch (..))
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..))

import Control.Exception.Safe (SomeException, displayException)
import Control.Monad
import Data.Bifunctor (first)
import Data.Function ((&))
Expand Down
14 changes: 8 additions & 6 deletions cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import Data.Text qualified as Text
import Data.Word (Word64)
import GHC.Exts (IsList (..))
import GHC.Stack
import Data.Coerce (coerce)

-- ----------------------------------------------------------------------------
-- Queries
Expand Down Expand Up @@ -643,7 +644,7 @@ toConsensusQueryShelleyBased sbe = \case
)
(const $ Some (consensusQueryInEraInMode era Consensus.GetFuturePParams))
sbe
QueryDRepState creds ->
QueryDRepState _creds ->
caseShelleyToBabbageOrConwayEraOnwards
(const $ error "toConsensusQueryShelleyBased: QueryDRepState is only available in the Conway era")
( \w ->
Expand All @@ -664,15 +665,16 @@ toConsensusQueryShelleyBased sbe = \case
)
(const $ Some (consensusQueryInEraInMode era (Consensus.GetSPOStakeDistr spos)))
sbe
QueryCommitteeMembersState coldCreds hotCreds statuses ->
QueryCommitteeMembersState _coldCreds _hotCreds _statuses ->
caseShelleyToBabbageOrConwayEraOnwards
( const $
error "toConsensusQueryShelleyBased: QueryCommitteeMembersState is only available in the Conway era"
)
( const $
Some
(consensusQueryInEraInMode era (Consensus.GetCommitteeMembersState coldCreds hotCreds statuses))
)
undefined
-- ( const $
-- Some
-- (consensusQueryInEraInMode era (Consensus.GetCommitteeMembersState coldCreds hotCreds statuses))
-- )
sbe
QueryStakeVoteDelegatees creds ->
caseShelleyToBabbageOrConwayEraOnwards
Expand Down
Loading