Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/haskell-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ jobs:

- name: Restore cached deps
run: |
wget "https://agrius.feralhosting.com/palas/wasm-cache/4c200033737be4736cd2a363d64c49a385937d5ea57d8e52773f65d08bbd1342.tar.bz2"
tar -jxf 4c200033737be4736cd2a363d64c49a385937d5ea57d8e52773f65d08bbd1342.tar.bz2
wget "https://agrius.feralhosting.com/palas/wasm-cache/c98ffd34ef84bbd524f7c750e96452c13063b960c05cb2d3361e343377978cc8.tar.xz"
tar -xf c98ffd34ef84bbd524f7c750e96452c13063b960c05cb2d3361e343377978cc8.tar.xz
rm -fr ~/.ghc-wasm/.cabal/store/
mv store ~/.ghc-wasm/.cabal/

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-hls-works:
env:
# Modify this value to "invalidate" the cache.
HLS_CACHE_VERSION: "2025-06-11"
HLS_CACHE_VERSION: "2025-08-12"

runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
69 changes: 63 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2025-06-22T20:18:27Z
, cardano-haskell-packages 2025-06-20T09:11:51Z
, cardano-haskell-packages 2025-08-21T00:00:00Z

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


-- WASM compilation specific

if arch(wasm32)
source-repository-package
type: git
location: https://github.com/amesgen/plutus.git
tag: dc1edea4458d6fb794b245a26c730620265645f3
location: https://github.com/intersectmbo/plutus.git
tag: 210c8375cd82eb2670b703b0975c26589dd40b2f
subdir:
plutus-core
plutus-ledger-api
plutus-tx
--sha256: sha256-QBtLmoS54b5QMAKIDOJIM6lmRC+1leBpuGKaFc7QQos=
--sha256: sha256-icAg87JKdCkeuNZvVwNlT0v1/O0wOYwIQ6LzXj9iTYM=

package plutus-core
flags: +do-not-build-plutus-exec
Expand All @@ -86,11 +87,11 @@ if arch(wasm32)
source-repository-package
type: git
location: https://github.com/palas/ouroboros-network.git
tag: ef3e30603e4e45dac336a085114ee22b7aa8c9ed
tag: bbc8bd70386a951e8633e4966e661df079cdc103
subdir:
ouroboros-network
ouroboros-network-framework
--sha256: sha256-+IdAmWJqzRy+erKONywtk+5YLrm63q942nZavoEA4E4=
--sha256: sha256-7m9lMZlQzjbfaGpWA5ipDGloQ2uhIQmFRoUFQ7GCDl8=

source-repository-package
type: git
Expand Down Expand Up @@ -161,3 +162,59 @@ if arch(wasm32)
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

allow-newer:
, cardano-ledger-byron
-- https://github.com/phadej/vec/issues/121
, 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/IntersectMBO/cardano-ledger
tag: 4edd7fd8b7101d24625c88d45c31f15e6345998e
--sha256: sha256-cJQIEmKeGDOkvNMm4Gmhp3l0Ikhpu/PQD9WqzSZWB68=
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
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
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

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: e62e46a91e1912dede59ee48ce55bd09574ca72a
--sha256: sha256-up0zy9tN1+wOxFO2cD/9W69HVaZjw8+aL8jJPf7LTCw=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol
sop-extras
strict-sop-core
26 changes: 13 additions & 13 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ library
cardano-ledger-api >=1.11,
cardano-ledger-babbage >=1.11,
cardano-ledger-binary >=1.6,
cardano-ledger-byron >=1.1,
cardano-ledger-byron >=1.2,
cardano-ledger-conway >=1.19,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-dijkstra:{cardano-ledger-dijkstra, testlib} >=0.1,
cardano-ledger-mary >=1.8,
cardano-ledger-shelley >=1.16,
cardano-ledger-shelley:{cardano-ledger-shelley, testlib} >=1.16,
cardano-protocol-tpraos >=1.4,
cardano-slotting >=0.2.0.0,
cardano-strict-containers >=0.1,
Expand Down Expand Up @@ -164,11 +165,11 @@ 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.45,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.52,
pretty-simple,
prettyprinter,
prettyprinter-ansi-terminal,
Expand All @@ -186,7 +187,7 @@ library
time,
transformers,
transformers-except ^>=0.1.3,
typed-protocols ^>=0.3,
typed-protocols ^>=1,
vector,
yaml,

Expand Down Expand Up @@ -303,7 +304,7 @@ library gen
Test.Hedgehog.Roundtrip.CBOR

build-depends:
QuickCheck,
QuickCheck ^>=2.16,
aeson >=1.5.6.0,
base16-bytestring,
bytestring,
Expand All @@ -312,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 All @@ -332,7 +333,7 @@ test-suite cardano-api-test
type: exitcode-stdio-1.0
build-depends:
FailT,
QuickCheck,
QuickCheck ^>=2.16,
aeson >=1.5.6.0,
base16-bytestring,
bytestring,
Expand All @@ -341,14 +342,13 @@ test-suite cardano-api-test
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.2.1,
cardano-crypto-test ^>=1.6,
cardano-crypto-tests ^>=2.2,
cardano-ledger-alonzo,
cardano-ledger-api >=1.9,
cardano-ledger-binary,
cardano-ledger-conway,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-mary,
cardano-ledger-api >=1.11,
cardano-protocol-tpraos,
cardano-slotting,
cborg,
Expand Down Expand Up @@ -416,19 +416,19 @@ test-suite cardano-api-golden
cardano-crypto-class ^>=2.2.1,
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api >=1.9,
cardano-ledger-binary,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-shelley,
cardano-ledger-shelley-test >=1.2.0.1,
cardano-ledger-api >=1.11,
cardano-protocol-tpraos,
containers,
errors,
filepath,
hedgehog >=1.1,
hedgehog-extras ^>=0.8,
microlens,
plutus-core ^>=1.45,
plutus-core ^>=1.52,
plutus-ledger-api,
tasty,
tasty-discover,
Expand Down
2 changes: 2 additions & 0 deletions cardano-api/gen/Test/Gen/Cardano/Api/Era.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ shelleyBasedEraTestConstraints = \case
ShelleyBasedEraAlonzo -> id
ShelleyBasedEraBabbage -> id
ShelleyBasedEraConway -> id
ShelleyBasedEraDijkstra -> id

shelleyToBabbageEraTestConstraints
:: ()
Expand Down Expand Up @@ -69,3 +70,4 @@ conwayEraOnwardsTestConstraints
-> a
conwayEraOnwardsTestConstraints = \case
ConwayEraOnwardsConway -> id
ConwayEraOnwardsDijkstra -> id
35 changes: 35 additions & 0 deletions cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ genPlutusScript l =
PlutusScriptV3 -> do
PlutusScript _ s <- genPlutusV3Script
return s
PlutusScriptV4 -> do
PlutusScript _ s <- genPlutusV4Script
return s

genValidPlutusScript :: PlutusScriptVersion lang -> Gen (PlutusScript lang)
genValidPlutusScript l =
Expand All @@ -309,6 +312,9 @@ genValidPlutusScript l =
PlutusScriptV3 -> do
PlutusScript _ s <- genValidPlutusV3Script
return s
PlutusScriptV4 -> do
PlutusScript _ s <- genValidPlutusV4Script
return s

genPlutusV1Script :: Gen (Script PlutusScriptV1)
genPlutusV1Script = do
Expand Down Expand Up @@ -341,13 +347,29 @@ genPlutusV3Script = do
let v3ScriptBytes = Base16.decodeLenient v3AlwaysSucceedsPlutusScriptHex
return . PlutusScript PlutusScriptV3 . PlutusScriptSerialised $ SBS.toShort v3ScriptBytes

-- TODO: This is not generating v4 scripts.
genPlutusV4Script :: Gen (Script PlutusScriptV4)
genPlutusV4Script = do
v3AlwaysSucceedsPlutusScriptHex <-
Gen.element [v3AlwaysSucceedsPlutusScriptDoubleEncoded, v3AlwaysSucceedsPlutusScript]
let v3ScriptBytes = Base16.decodeLenient v3AlwaysSucceedsPlutusScriptHex
return . PlutusScript PlutusScriptV4 . PlutusScriptSerialised $ SBS.toShort v3ScriptBytes

genValidPlutusV3Script :: Gen (Script PlutusScriptV3)
genValidPlutusV3Script = do
v3AlwaysSucceedsPlutusScriptHex <-
Gen.element [v3AlwaysSucceedsPlutusScript]
let v3ScriptBytes = Base16.decodeLenient v3AlwaysSucceedsPlutusScriptHex
return . PlutusScript PlutusScriptV3 . PlutusScriptSerialised $ SBS.toShort v3ScriptBytes

-- TODO: This is not generating v4 scripts.
genValidPlutusV4Script :: Gen (Script PlutusScriptV4)
genValidPlutusV4Script = do
v3AlwaysSucceedsPlutusScriptHex <-
Gen.element [v3AlwaysSucceedsPlutusScript]
let v3ScriptBytes = Base16.decodeLenient v3AlwaysSucceedsPlutusScriptHex
return . PlutusScript PlutusScriptV4 . PlutusScriptSerialised $ SBS.toShort v3ScriptBytes

genScriptDataSchema :: Gen ScriptDataJsonSchema
genScriptDataSchema = Gen.element [ScriptDataJsonNoSchema, ScriptDataJsonDetailedSchema]

Expand Down Expand Up @@ -1327,6 +1349,13 @@ genTxOutDatumHashTxContext era = case era of
, TxOutSupplementalDatum AlonzoEraOnwardsConway <$> genHashableScriptData
, TxOutDatumInline BabbageEraOnwardsConway <$> genHashableScriptData
]
ShelleyBasedEraDijkstra ->
Gen.choice
[ pure TxOutDatumNone
, TxOutDatumHash AlonzoEraOnwardsDijkstra <$> genHashScriptData
, TxOutSupplementalDatum AlonzoEraOnwardsDijkstra <$> genHashableScriptData
, TxOutDatumInline BabbageEraOnwardsDijkstra <$> genHashableScriptData
]

genTxOutDatumHashUTxOContext :: ShelleyBasedEra era -> Gen (TxOutDatum CtxUTxO era)
genTxOutDatumHashUTxOContext era = case era of
Expand All @@ -1350,6 +1379,12 @@ genTxOutDatumHashUTxOContext era = case era of
, TxOutDatumHash AlonzoEraOnwardsConway <$> genHashScriptData
, TxOutDatumInline BabbageEraOnwardsConway <$> genHashableScriptData
]
ShelleyBasedEraDijkstra ->
Gen.choice
[ pure TxOutDatumNone
, TxOutDatumHash AlonzoEraOnwardsDijkstra <$> genHashScriptData
, TxOutDatumInline BabbageEraOnwardsDijkstra <$> genHashableScriptData
]

mkDummyHash :: forall h a. CRYPTO.HashAlgorithm h => Int -> CRYPTO.Hash h a
mkDummyHash = coerce . CRYPTO.hashWithSerialiser @h CBOR.toCBOR
Expand Down
10 changes: 8 additions & 2 deletions cardano-api/src/Cardano/Api/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ import Ouroboros.Consensus.Byron.Ledger qualified as Consensus
import Ouroboros.Consensus.Cardano.Block qualified as Consensus
import Ouroboros.Consensus.HardFork.Combinator qualified as Consensus
import Ouroboros.Consensus.Shelley.Ledger qualified as Consensus
import Ouroboros.Consensus.Shelley.Protocol.Abstract qualified as Consensus
import Ouroboros.Network.Block qualified as Consensus

import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), object, withObject, (.:), (.=))
Expand Down Expand Up @@ -153,6 +152,12 @@ instance Show (Block era) where
( showString "ShelleyBlock ShelleyBasedEraConway "
. showsPrec 11 block
)
showsPrec p (ShelleyBlock ShelleyBasedEraDijkstra block) =
showParen
(p >= 11)
( showString "ShelleyBlock ShelleyBasedEraDijkstra "
. showsPrec 11 block
)

getBlockTxs :: forall era. Block era -> [Tx era]
getBlockTxs = \case
Expand All @@ -167,7 +172,6 @@ getShelleyBlockTxs
:: forall era ledgerera blockheader
. ShelleyLedgerEra era ~ ledgerera
=> Consensus.ShelleyCompatible (ConsensusProtocol era) ledgerera
=> Consensus.ShelleyProtocolHeader (ConsensusProtocol era) ~ blockheader
=> ShelleyBasedEra era
-> Ledger.Block blockheader ledgerera
-> [Tx era]
Expand Down Expand Up @@ -203,6 +207,7 @@ fromConsensusBlock = \case
Consensus.BlockAlonzo b' -> BlockInMode cardanoEra $ ShelleyBlock ShelleyBasedEraAlonzo b'
Consensus.BlockBabbage b' -> BlockInMode cardanoEra $ ShelleyBlock ShelleyBasedEraBabbage b'
Consensus.BlockConway b' -> BlockInMode cardanoEra $ ShelleyBlock ShelleyBasedEraConway b'
Consensus.BlockDijkstra b' -> BlockInMode cardanoEra $ ShelleyBlock ShelleyBasedEraDijkstra b'

toConsensusBlock
:: ()
Expand All @@ -217,6 +222,7 @@ toConsensusBlock = \case
BlockInMode _ (ShelleyBlock ShelleyBasedEraAlonzo b') -> Consensus.BlockAlonzo b'
BlockInMode _ (ShelleyBlock ShelleyBasedEraBabbage b') -> Consensus.BlockBabbage b'
BlockInMode _ (ShelleyBlock ShelleyBasedEraConway b') -> Consensus.BlockConway b'
BlockInMode _ (ShelleyBlock ShelleyBasedEraDijkstra b') -> Consensus.BlockDijkstra b'

-- ----------------------------------------------------------------------------
-- Block headers
Expand Down
Loading