Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ jobs:

- uses: actions/checkout@v4

- name: Configure Git to support long file paths on Windows
if: ${{ matrix.sys.os == 'windows-latest' }}
run: git config --system core.longpaths true

- name: Cache and install Cabal dependencies
uses: intersectmbo/cardano-api/.github/actions/cabal-cache@a7bd74dfa6ccb1eb04f69791f978a3b9e0cc63ca
with:
Expand Down
87 changes: 81 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-04-16T00:15:23Z
, cardano-haskell-packages 2026-05-02T15:05:10Z

active-repositories:
, :rest
, cardano-haskell-packages:override
, hackage.haskell.org 2026-07-15T21:58:35Z
, cardano-haskell-packages 2026-06-30T00:00:00Z

packages:
cardano-cli
Expand Down Expand Up @@ -74,6 +70,85 @@ write-ghc-environment-files: always
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

source-repository-package
type: git
location: https://github.com/f-f/kes-agent
tag: 32c1ed675d22a30735d9f22f7afa436a3ef3e64a
--sha256: sha256-o7hFX1JnraS6Xq0WoXQwd9Z8GsPPv0Ls2DWvZ08o0ZU=
subdir:
kes-agent
kes-agent-crypto

-- Points to the branch ch1bo-palas/key-registration
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-api
tag: 6bd3d265aac5a968f966cdcfd2896331b53389f1
--sha256: sha256-3HC8nie+gC/sxWnXuoNOXpEvBAIq8enns1LJbIp1sCQ=
subdir:
cardano-api

-- Force cardano-crypto-class 2.5.x to avoid conflict with the installed 2.3.x.
constraints: cardano-crypto-class == 2.5.0.0
allow-newer: cardano-cli:cardano-crypto-class

-- cardano-api (SRP) upper-bounds QuickCheck<2.18, but at index-state 2026-06-30
-- ral-0.2.2 (pulled in by plutus-core) requires QuickCheck>=2.18, so we relax.
allow-newer: cardano-api:QuickCheck

-- Points to leios-prototype branch
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-consensus
tag: 3511ac5ad2ded55553d821e7305a2c10e1cfbeca
--sha256: sha256-pdZrsQv0+w6FhXI17Xcp6MjUOQidLb2MBA+vXl9T/ik=

-- ouroboros-consensus uses deprecated cardano-ledger API (Validated, applyTx).
-- Suppress deprecation warnings to match the nix build behavior.
package ouroboros-consensus
ghc-options: -Wno-deprecations

-- Points to leios-prototype branch
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: fb8d6f8a83b0efb86281e0b80e7ffba160dad8b1
--sha256: sha256-U/vpyZNerL1YXiQg1TIAOL5L438NNE3XkuIYD0HPTJw=
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-tpraos
libs/non-integral
libs/small-steps
libs/vector-map

-- Points to leios-prototype
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network
tag: 4b3ab7664f609a1aee0f0c24dcfcfd0ab899fc42
--sha256: sha256-fIqpI2whstetodpiONmUDVgnhTpzXeq1/gmzuHItK5A=
subdir:
./cardano-diffusion
./monoidal-synchronisation
./network-mux
./ouroboros-network

-- cabal-allow-newer begin
if impl(ghc >= 9.14)
allow-newer:
Expand Down
5 changes: 0 additions & 5 deletions cabal.project.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@ ignore-project: False

program-options
ghc-options: -Wwarn

packages:
../cardano-api/cardano-api
../cardano-ledger/libs/cardano-ledger-core
../cardano-ledger/eras/dijkstra/impl
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Byron/UpdateProposal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ submitByronUpdateProposal
submitByronUpdateProposal nodeSocketPath network proposalFp = do
proposal <- readByronUpdateProposal proposalFp
let genTx = toByronLedgerUpdateProposal proposal
traceWith stdoutTracer $ "Update proposal TxId: " ++ condense (txId genTx)
liftIO $ traceWith stdoutTracer $ "Update proposal TxId: " ++ condense (txId genTx)
fromExceptTCli $ nodeSubmitTx nodeSocketPath network genTx
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Byron/Vote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ submitByronVote
submitByronVote nodeSocketPath network voteFp = do
vote <- readByronVote voteFp
let genTx = toByronLedgertoByronVote vote
traceWith stdoutTracer ("Vote TxId: " ++ condense (txId genTx))
liftIO $ traceWith stdoutTracer ("Vote TxId: " ++ condense (txId genTx))
fromExceptTCli $ nodeSubmitTx nodeSocketPath network genTx

readByronVote :: FilePath -> CIO e ByronVote
Expand Down
8 changes: 4 additions & 4 deletions cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,19 @@ getScriptWitnessDetails era tb =
Ledger.AlonzoSpending (L.AsIxItem _ sp) -> addLabelToPurpose Spending (friendlyInput sp)
Ledger.AlonzoMinting (L.AsIxItem _ mp) -> addLabelToPurpose Minting mp
Ledger.AlonzoCertifying (L.AsIxItem _ cp) -> addLabelToPurpose Certifying cp
Ledger.AlonzoRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.AlonzoWithdrawing (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
friendlyPurpose AlonzoEraOnwardsBabbage purpose =
case purpose of
Ledger.AlonzoSpending (L.AsIxItem _ sp) -> addLabelToPurpose Spending (friendlyInput sp)
Ledger.AlonzoMinting (L.AsIxItem _ mp) -> addLabelToPurpose Minting mp
Ledger.AlonzoCertifying (L.AsIxItem _ cp) -> addLabelToPurpose Certifying cp
Ledger.AlonzoRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.AlonzoWithdrawing (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
friendlyPurpose AlonzoEraOnwardsConway purpose =
case purpose of
Ledger.ConwaySpending (L.AsIxItem _ sp) -> addLabelToPurpose Spending (friendlyInput sp)
Ledger.ConwayMinting (L.AsIxItem _ mp) -> addLabelToPurpose Minting mp
Ledger.ConwayCertifying (L.AsIxItem _ cp) -> addLabelToPurpose Certifying cp
Ledger.ConwayRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.ConwayWithdrawing (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.ConwayVoting (L.AsIxItem _ vp) -> addLabelToPurpose Voting vp
Ledger.ConwayProposing (L.AsIxItem _ pp) -> addLabelToPurpose Proposing pp
friendlyPurpose AlonzoEraOnwardsDijkstra purpose = do
Expand All @@ -350,7 +350,7 @@ getScriptWitnessDetails era tb =
Ledger.DijkstraSpending (L.AsIxItem _ sp) -> addLabelToPurpose Spending (friendlyInput sp)
Ledger.DijkstraMinting (L.AsIxItem _ mp) -> addLabelToPurpose Minting mp
Ledger.DijkstraCertifying (L.AsIxItem _ cp) -> addLabelToPurpose Certifying cp
Ledger.DijkstraRewarding (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.DijkstraWithdrawing (L.AsIxItem _ rp) -> addLabelToPurpose Rewarding rp
Ledger.DijkstraVoting (L.AsIxItem _ vp) -> addLabelToPurpose Voting vp
Ledger.DijkstraProposing (L.AsIxItem _ pp) -> addLabelToPurpose Proposing pp
Ledger.DijkstraGuarding (L.AsIxItem _ pp) -> addLabelToPurpose Guarding pp
Expand Down
1 change: 1 addition & 0 deletions cardano-cli/src/Cardano/CLI/Compatible/StakePool/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ runStakePoolRegistrationCertificateCmd
, stakePoolOwners = stakePoolOwners'
, stakePoolRelays = relays
, stakePoolMetadata = pcaAnchor <$> mMetadata
, stakePoolBlsKey = Nothing
}

let ledgerStakePoolParams = toShelleyPoolParams stakePoolParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ buildPoolParams nw dir index specifiedRelays = do
, L.sppOwners = mempty
, L.sppRelays = lookupPoolRelay specifiedRelays
, L.sppMetadata = L.SNothing
, L.sppLeiosKey = L.SNothing
}
where
lookupPoolRelay :: Map Word [L.StakePoolRelay] -> Seq.StrictSeq L.StakePoolRelay
Expand Down
1 change: 1 addition & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Genesis/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ buildPoolParams nw dir index specifiedRelays = do
, L.sppOwners = mempty
, L.sppRelays = lookupPoolRelay specifiedRelays
, L.sppMetadata = L.SNothing
, L.sppLeiosKey = L.SNothing
}
where
lookupPoolRelay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ pGovActionProtocolParametersUpdate = \case
<*> pIntroducedInBabbagePParams
<*> pIntroducedInConwayPParams
ShelleyBasedEraDijkstra ->
-- TODO: Dijkstra
error "pGovActionProtocolParametersUpdate: Dijkstra era not supported yet"
-- TODO: Dijkstra - add DijkstraEraBasedProtocolParametersUpdate to cardano-api
Opt.empty

pGovernanceActionTreasuryWithdrawalCmd
:: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/StakePool/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ data StakePoolRegistrationCertificateCmdArgs era
-- ^ Stake pool verification key.
, vrfVerificationKeyOrFile :: !(VerificationKeyOrFile VrfKey)
-- ^ VRF Verification key.
, blsSkeyFile :: !(SigningKeyFile In)
-- ^ The BLS signing key.
, poolBlsKey :: !(Maybe (SigningKeyFile In))
-- ^ Optional BLS signing key file used to derive the BLS key (public key + possession proof).
, poolPledge :: !Coin
-- ^ Pool pledge.
, poolCost :: !Coin
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/StakePool/Option.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pStakePoolRegistrationCertificateCmd envCli = do
Cmd.StakePoolRegistrationCertificateCmdArgs (convert useEra)
<$> pStakePoolVerificationKeyOrFile Nothing
<*> pVrfVerificationKeyOrFile
<*> pBlsSigningKeyFile
<*> optional pBlsSigningKeyFile
<*> pPoolPledge
<*> pPoolCost
<*> pPoolMargin
Expand Down
13 changes: 12 additions & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/StakePool/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ runStakePoolRegistrationCertificateCmd
{ era
, poolVerificationKeyOrFile
, vrfVerificationKeyOrFile
, poolPledge
, poolBlsKey = mPoolBlsKeyFile
, poolCost
, poolMargin
, poolPledge
, rewardStakeVerificationKeyOrFile
, ownerStakeVerificationKeyOrFiles
, relays
Expand Down Expand Up @@ -106,10 +107,20 @@ runStakePoolRegistrationCertificateCmd
ownerStakeVerificationKeyOrFiles
let stakePoolOwners' = map verificationKeyHash sPoolOwnerVkeys

-- BLS key (optional): derived from a BLS signing key file
mBlsKey <- case mPoolBlsKeyFile of
Nothing -> pure Nothing
Just skeyFile -> do
skey <-
fromEitherIOCli @(FileError TextEnvelopeError) $
readFileTextEnvelope @(SigningKey BlsKey) skeyFile
pure $ Just $ blsSigningKeyToLeiosKey skey

let stakePoolParams =
StakePoolParameters
{ stakePoolId = stakePoolId'
, stakePoolVRF = vrfKeyHash'
, stakePoolBlsKey = mBlsKey
, stakePoolCost = poolCost
, stakePoolMargin = poolMargin
, stakePoolRewardAccount = rewardAccountAddr
Expand Down
12 changes: 6 additions & 6 deletions cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ runCip129 (Cip129DRep inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readDrepVerificationKeyFile f
InputHexText t -> do
fromEitherCli . Valid.toEither $ readDRepHexVerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readDRepHexVerificationKeyText t
InputBech32Text t -> do
fromEitherCli . Valid.toEither $ readDRepBech32VerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readDRepBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129DrepVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129CommitteeHotKey inp out) = do
Expand All @@ -43,9 +43,9 @@ runCip129 (Cip129CommitteeHotKey inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readCommitteeHotVerificationKeyFile f
InputHexText t ->
fromEitherCli . Valid.toEither $ readCommitteeHotHexVerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readCommitteeHotHexVerificationKeyText t
InputBech32Text t ->
fromEitherCli . Valid.toEither $ readCommitteeHotBech32VerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readCommitteeHotBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeHotVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129CommitteeColdKey inp out) = do
Expand All @@ -54,9 +54,9 @@ runCip129 (Cip129CommitteeColdKey inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readCommitteeColdVerificationKeyFile f
InputHexText t ->
fromEitherCli . Valid.toEither $ readCommitteeColdHexVerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readCommitteeColdHexVerificationKeyText t
InputBech32Text t ->
fromEitherCli . Valid.toEither $ readCommitteeColdBech32VerificationKeyText t
fromEitherCli . Valid.foldValidation Left Right $ readCommitteeColdBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeColdVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129GovernanceAction inp out) =
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraIndependent/Ping/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Control.Concurrent.Class.MonadSTM.Strict qualified as STM
import Control.Exception (SomeException)
import Control.Monad (forM, unless)
import Control.Monad.Class.MonadAsync (MonadAsync (async, wait, waitCatch))
import Control.Tracer (Tracer (..))
import Control.Tracer (Tracer, mkTracer)
import Data.List qualified as L
import Data.List qualified as List
import Network.Socket (AddrInfo)
Expand Down Expand Up @@ -96,7 +96,7 @@ runPingCmd options = do
-- Ping client thread handles
caids <-
forM addresses $
liftIO . async . pingClient (Tracer $ doLog msgQueue) (Tracer doErrLog) options versions
liftIO . async . pingClient (mkTracer $ doLog msgQueue) (mkTracer doErrLog) options versions
res <- L.zip addresses <$> mapM (liftIO . waitCatch) caids
liftIO $ doLog msgQueue CNP.LogEnd
liftIO $ wait laid
Expand Down
8 changes: 0 additions & 8 deletions cardano-cli/src/Cardano/CLI/Orphan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Cardano.Api.Experimental as Exp
import Cardano.Api.Ledger qualified as L

import Cardano.CLI.Type.Error.ScriptDecodeError
import Cardano.Ledger.Conway.Governance qualified as L
import Cardano.Ledger.Conway.State qualified as L

import Control.Exception
Expand All @@ -24,13 +23,6 @@ import Data.List qualified as List
import Data.Typeable
import Data.Word

instance ToJSON L.DefaultVote where
toJSON defaultVote =
case defaultVote of
L.DefaultNo -> String "DefaultNo"
L.DefaultAbstain -> String "DefaultAbstain"
L.DefaultNoConfidence -> String "DefaultNoConfidence"

instance Error [Bech32DecodeError] where
prettyError errs = vsep $ map prettyError errs

Expand Down
13 changes: 9 additions & 4 deletions cardano-cli/src/Cardano/CLI/Read/Committee/ColdKey.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ readCommitteeColdBech32VerificationKeyText
:: Text -> Validation [Bech32DecodeError] AnyCommitteeColdVerificationKey
readCommitteeColdBech32VerificationKeyText committeeColdText =
let vkey =
liftError return $
liftError' $
AnyCommitteeColdVerificationKey
<$> deserialiseFromBech32 committeeColdText
extendedVkey =
liftError return $
liftError' $
AnyCommitteeColdExtendedVerificationKey
<$> deserialiseFromBech32 committeeColdText
in vkey <> extendedVkey
Expand All @@ -49,15 +49,20 @@ readCommitteeColdHexVerificationKeyText
readCommitteeColdHexVerificationKeyText committeeColdText =
let committeeColdBs = Text.encodeUtf8 committeeColdText
vkey =
liftError return $
liftError' $
AnyCommitteeColdVerificationKey
<$> deserialiseFromRawBytesHex committeeColdBs
extendedVkey =
liftError return $
liftError' $
AnyCommitteeColdExtendedVerificationKey
<$> deserialiseFromRawBytesHex committeeColdBs
in vkey <> extendedVkey

-- | Convert an 'Either' to a 'Validation', wrapping the error in a singleton list.
liftError' :: Either e a -> Validation [e] a
liftError' (Left e) = Failure [e]
liftError' (Right a) = Success a

readCommitteeColdVerificationKeyFile
:: FileOrPipe -> IO (Either (FileError TextEnvelopeError) AnyCommitteeColdVerificationKey)
readCommitteeColdVerificationKeyFile = readFileOrPipeTextEnvelopeAnyOf types
Expand Down
Loading
Loading