Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix most compilation errors
  • Loading branch information
ana-pantilie committed Aug 25, 2025
commit f18e5cb09a9be6e9aa9d0e968dd8fd0267b6d86b
6 changes: 4 additions & 2 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ library
cardano-ledger-byron >=1.2,
cardano-ledger-conway >=1.19,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-dijkstra >=0.1,
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 @@ -348,6 +348,7 @@ test-suite cardano-api-test
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 @@ -419,6 +420,7 @@ test-suite cardano-api-golden
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,
Expand Down
1 change: 0 additions & 1 deletion cardano-api/src/Cardano/Api/Consensus/Internal/InMode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,3 @@ fromConsensusApplyTxErr = \case
TxValidationErrorInCardanoMode $ ShelleyTxValidationError ShelleyBasedEraDijkstra err
Consensus.ApplyTxErrWrongEra err ->
TxValidationEraMismatch err
_ -> undefined
3 changes: 2 additions & 1 deletion cardano-api/src/Cardano/Api/Experimental/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ newtype UnsignedTxError
= UnsignedTxError TxBodyError

makeUnsignedTx
:: Era era
:: Ledger.ProtVerAtMost (LedgerEra era) 11
=> Era era
-> TxBodyContent BuildTx era
-> Either TxBodyError (UnsignedTx era)
makeUnsignedTx era bc = obtainCommonConstraints era $ do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,4 @@ getPlutusDatum L.SPlutusV3 (SpendingScriptDatum d) = d
getPlutusDatum L.SPlutusV4 (SpendingScriptDatum _d) = error "dijkstra"
getPlutusDatum _ InlineDatum = Nothing
getPlutusDatum _ NoScriptDatum = Nothing
getPlutusDatum _ _ = undefined

2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Genesis/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ decodeAlonzoGenesis (Just era) genesisBs = modifyError ("Cannot decode era-sensi
-- use all available parameters >= conway
| isConwayOnwards = length allCostModelParams
-- use only required params in < conway
| otherwise = L.costModelParamsCount L.PlutusV2 -- Babbage
| otherwise = L.costModelInitParamCount L.PlutusV2 -- Babbage

-- A list-like of tuples (param name, value) with default maxBound value
optionalCostModelDefaultValues :: (Item l ~ (V2.ParamName, Int64), IsList l) => l
Expand Down
10 changes: 6 additions & 4 deletions cardano-api/src/Cardano/Api/Internal/Orphans/Serialisation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,22 @@ deriving anyclass instance
ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
=> ToJSON (L.ShelleyPpupPredFailure ledgerera)

deriving anyclass instance
instance
( ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
, ToJSON (L.PlutusPurpose L.AsItem ledgerera)
, ToJSON (L.PlutusPurpose L.AsIx ledgerera)
)
=> ToJSON (L.AlonzoUtxowPredFailure ledgerera)
=> ToJSON (L.AlonzoUtxowPredFailure ledgerera) where
toJSON = undefined

deriving anyclass instance
instance
( ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
, ToJSON (L.TxCert ledgerera)
, ToJSON (L.PlutusPurpose L.AsItem ledgerera)
, ToJSON (L.PlutusPurpose L.AsIx ledgerera)
)
=> ToJSON (L.BabbageUtxowPredFailure ledgerera)
=> ToJSON (L.BabbageUtxowPredFailure ledgerera) where
toJSON = undefined

deriving anyclass instance
ToJSON (L.PredicateFailure (L.EraRule "LEDGER" ledgerera))
Expand Down
9 changes: 3 additions & 6 deletions cardano-api/src/Cardano/Api/LedgerState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ import Network.Mux qualified as Mux
import Network.TypedProtocol.Core (Nat (..))
import System.FilePath

import Test.Cardano.Ledger.Api.Examples.Consensus.Dijkstra
import Test.Cardano.Ledger.Dijkstra.Examples qualified as Dijkstra
import Test.Cardano.Ledger.Shelley.Examples qualified as Shelley

data InitialLedgerStateError
= -- | Failed to read or parse the network config file.
Expand Down Expand Up @@ -1401,12 +1402,8 @@ decodeLedgerState = do
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 @@ -1503,7 +1500,7 @@ readCardanoGenesisConfig mEra enc = do
ShelleyConfig shelleyGenesis shelleyGenesisHash <- readShelleyGenesisConfig enc
alonzoGenesis <- readAlonzoGenesisConfig mEra enc
conwayGenesis <- readConwayGenesisConfig enc
let dijkstraGenesis = exampleDijkstraGenesis -- TODO: Dijkstra - add plumbing to read Dijkstra genesis
let dijkstraGenesis = Shelley.leTranslationContext Dijkstra.ledgerExamples -- TODO: Dijkstra - add plumbing to read Dijkstra genesis
let transCfg = Ledger.mkLatestTransitionConfig shelleyGenesis alonzoGenesis conwayGenesis dijkstraGenesis
pure $ GenesisCardano enc byronGenesis shelleyGenesisHash transCfg

Expand Down
7 changes: 6 additions & 1 deletion cardano-api/src/Cardano/Api/Query/Internal/Convenience.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module Cardano.Api.Query.Internal.Convenience
)
where

import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch (..))

import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..))

import Cardano.Api.Address
import Cardano.Api.Certificate.Internal
import Cardano.Api.Consensus.Internal.Mode
Expand Down Expand Up @@ -49,6 +53,7 @@ import Data.Maybe (mapMaybe)
import Data.Set (Set)
import Data.Text (Text)
import GHC.Exts (IsList (..), IsString (..))
import Control.Exception (SomeException, displayException)

data QueryConvenienceError
= AcqFailure AcquiringFailure
Expand Down Expand Up @@ -109,7 +114,7 @@ queryStateForBalancedTx
, SystemStart
, Set PoolId
, Map StakeCredential L.Coin
, Map (L.Credential L.DRepRole) L.Coin
, Map (L.Credential L.DRepRole) (L.CompactForm L.Coin)
, Maybe (Featured ConwayEraOnwards era TxCurrentTreasuryValue)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ 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 @@ -648,7 +647,7 @@ toConsensusQueryShelleyBased sbe = \case
caseShelleyToBabbageOrConwayEraOnwards
(const $ error "toConsensusQueryShelleyBased: QueryDRepState is only available in the Conway era")
( \w ->
Some (consensusQueryInEraInMode era (conwayEraOnwardsConstraints w $ Consensus.GetDRepState creds))
Some (consensusQueryInEraInMode era (conwayEraOnwardsConstraints w $ Consensus.GetDRepState _creds))
)
sbe
QueryDRepStakeDistr dreps ->
Expand Down Expand Up @@ -937,7 +936,7 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' =
Consensus.GetStakePoolParams{} ->
Map.map fromShelleyPoolParams
. Map.mapKeysMonotonic StakePoolKeyHash
$ r'
$ undefined -- r'
_ -> fromConsensusQueryResultMismatch
QueryDebugLedgerState{} ->
case q' of
Expand Down
13 changes: 7 additions & 6 deletions cardano-api/src/Cardano/Api/Tx/Internal/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ import Cardano.Crypto.Hashing qualified as Byron
import Cardano.Ledger.Allegra.Core qualified as L
import Cardano.Ledger.Alonzo.Core qualified as L
import Cardano.Ledger.Alonzo.Scripts qualified as Alonzo
import Cardano.Ledger.Alonzo.Tx qualified as Alonzo (hashScriptIntegrity)
-- import Cardano.Ledger.Alonzo.Tx qualified as Alonzo (hashScriptIntegrity)
import Cardano.Ledger.Alonzo.TxWits qualified as Alonzo
import Cardano.Ledger.Api qualified as L
import Cardano.Ledger.Babbage.UTxO qualified as L
Expand Down Expand Up @@ -1739,14 +1739,14 @@ fromLedgerTxExtraKeyWitnesses sbe body =
caseShelleyToMaryOrAlonzoEraOnwards
(const TxExtraKeyWitnessesNone)
( \w ->
let keyhashes = body ^. L.reqSignerHashesTxBodyL
let keyhashes = body ^. L.reqSignerHashesTxBodyG
in if Set.null keyhashes
then TxExtraKeyWitnessesNone
else
TxExtraKeyWitnesses
w
[ PaymentKeyHash (Shelley.coerceKeyRole keyhash)
| keyhash <- toList $ body ^. L.reqSignerHashesTxBodyL
| keyhash <- toList $ body ^. L.reqSignerHashesTxBodyG
]
)
sbe
Expand Down Expand Up @@ -1981,12 +1981,13 @@ convPParamsToScriptIntegrityHash
-> Alonzo.TxDats (ShelleyLedgerEra era)
-> Set Plutus.Language
-> StrictMaybe L.ScriptIntegrityHash
convPParamsToScriptIntegrityHash w (BuildTxWith mTxProtocolParams) redeemers datums languages =
convPParamsToScriptIntegrityHash w (BuildTxWith mTxProtocolParams) _ _ _ = -- redeemers datums languages =
alonzoEraOnwardsConstraints w $
case mTxProtocolParams of
Nothing -> SNothing
Just (LedgerProtocolParameters pp) ->
Alonzo.hashScriptIntegrity (Set.map (L.getLanguageView pp) languages) redeemers datums
Just (LedgerProtocolParameters _) -> undefined
-- Just (LedgerProtocolParameters pp) ->
-- Alonzo.hashScriptIntegrity (Set.map (L.getLanguageView pp) languages) redeemers datums

convLanguages :: [(ScriptWitnessIndex, AnyScriptWitness era)] -> Set Plutus.Language
convLanguages witnesses =
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Tx/Internal/Body/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ collateralInputsTxBodyL w = alonzoEraOnwardsConstraints w $ txBodyL . L.collater

reqSignerHashesTxBodyL
:: AlonzoEraOnwards era -> Lens' (LedgerTxBody era) (Set (L.KeyHash L.Witness))
reqSignerHashesTxBodyL w = alonzoEraOnwardsConstraints w $ txBodyL . L.reqSignerHashesTxBodyL
reqSignerHashesTxBodyL w = alonzoEraOnwardsConstraints w $ txBodyL . undefined -- L.reqSignerHashesTxBodyL

referenceInputsTxBodyL
:: BabbageEraOnwards era -> Lens' (LedgerTxBody era) (Set L.TxIn)
Expand Down