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@v6

- 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: input-output-hk/cardano-dev/actions/cabal-cache@cabal-cache-0.0.1.0
with:
Expand Down
28 changes: 22 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +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-06-10T14:43:25Z
, cardano-haskell-packages 2026-06-29T12:05:19Z
, hackage.haskell.org 2026-07-15T21:58:35Z
, cardano-haskell-packages 2026-06-30T00:00:00Z

packages:
cardano-cli
Expand Down Expand Up @@ -100,8 +100,8 @@ if impl(ghc >= 9.14)
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api
tag: cc4dfe71536d59cb745e8ce1c09ee83dfcde6218
--sha256: sha256-n6WJd5w3NSMICUBwefgix2/f+z5La4dkn59dDO4zlHo=
tag: 947645ea9c912da13feadc16bef44a7550c3c55b
--sha256: sha256-+fIsJuJV4YBSPdVe3wpIxq9lf6nAI5yB7qdzH0iKmrc=
subdir:
cardano-api
cardano-api-gen
Expand Down Expand Up @@ -133,8 +133,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/f-f/kes-agent.git
tag: 32c1ed675d22a30735d9f22f7afa436a3ef3e64a
--sha256: sha256-o7hFX1JnraS6Xq0WoXQwd9Z8GsPPv0Ls2DWvZ08o0ZU=
tag: c0d24ab8bf8f9f736aed3c7028534355fb89ecaa
--sha256: sha256-T3rDZ38iMuE7SZpttHX6yTJYqWqdyw6Qsh5irs1d2T8=
subdir:
kes-agent
kes-agent-crypto
Expand All @@ -146,6 +146,12 @@ source-repository-package
tag: e790deca75b4f72e57a1e36c2775bf4111220450
--sha256: sha256-W64c1D44drtWNnUI6Nq5YP6X2LhRNEiJu1MM+d+Rp2s=

-- ouroboros-consensus uses deprecated cardano-ledger API (Validated, applyTx).
-- Suppress deprecation warnings to match the nix build behavior (which only
-- applies -Werror to cardano-api, not to external packages).
package ouroboros-consensus
ghc-options: -Wno-deprecations

-- Points to ouroboros-network/leios-prototype
source-repository-package
type: git
Expand All @@ -156,3 +162,13 @@ source-repository-package
ouroboros-network
cardano-diffusion
network-mux

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
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import Cardano.CLI.EraBased.Governance.Actions.Command qualified as Cmd
import Cardano.CLI.Option.Flag (setDefault)
import Cardano.CLI.Parser
import Cardano.CLI.Type.Common
import Cardano.Ledger.BaseTypes (NonZero, PositiveInterval, nonZero)

import Data.Foldable
import Data.Function ((&))
import Data.Word (Word32)
import GHC.Natural (Natural)
import Options.Applicative
import Options.Applicative qualified as Opt
Expand Down Expand Up @@ -302,6 +304,61 @@ pIntroducedInConwayPParams =
<*> convertToLedger id (optional pDRepActivity)
<*> convertToLedger id (optional pMinFeeRefScriptCostPerByte)

pIntroducedInDijkstraPParams :: Parser (IntroducedInDijkstraPParams ledgerera)
pIntroducedInDijkstraPParams =
IntroducedInDijkstraPParams
<$> convertToLedger id (optional pMaxRefScriptSizePerBlock)
<*> convertToLedger id (optional pMaxRefScriptSizePerTx)
<*> convertToLedger id (optional pRefScriptCostStride)
<*> convertToLedger id (optional pRefScriptCostMultiplier)

pMaxRefScriptSizePerBlock :: Parser Word32
pMaxRefScriptSizePerBlock =
Opt.option integralReader $
mconcat
[ Opt.long "max-ref-script-size-per-block"
, Opt.metavar "WORD32"
, Opt.help "Maximum total size of reference scripts per block."
]

pMaxRefScriptSizePerTx :: Parser Word32
pMaxRefScriptSizePerTx =
Opt.option integralReader $
mconcat
[ Opt.long "max-ref-script-size-per-tx"
, Opt.metavar "WORD32"
, Opt.help "Maximum total size of reference scripts per transaction."
]

pRefScriptCostStride :: Parser (NonZero Word32)
pRefScriptCostStride =
Opt.option
(integralReader >>= maybe (fail "ref-script-cost-stride must be non-zero") pure . nonZero)
$ mconcat
[ Opt.long "ref-script-cost-stride"
, Opt.metavar "WORD32"
, Opt.help "Reference script cost stride (non-zero) for fee calculation."
]

pRefScriptCostMultiplier :: Parser PositiveInterval
pRefScriptCostMultiplier =
Opt.option (toPositiveIntervalOrErr <$> readRational) $
mconcat
[ Opt.long "ref-script-cost-multiplier"
, Opt.metavar "RATIONAL"
, Opt.help "Reference script cost multiplier for fee calculation."
]

toPositiveIntervalOrErr :: Rational -> PositiveInterval
toPositiveIntervalOrErr r = case L.boundRational r of
Nothing ->
error $
mconcat
[ "toPositiveIntervalOrErr: "
, "rational out of bounds or zero " <> show r
]
Just n -> n

-- Not necessary in Conway era onwards
pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In]
pProtocolParametersUpdateGenesisKeys = some pGenesisVerificationKeyFile
Expand Down Expand Up @@ -346,8 +403,12 @@ pGovActionProtocolParametersUpdate = \case
<*> pIntroducedInBabbagePParams
<*> pIntroducedInConwayPParams
ShelleyBasedEraDijkstra ->
-- TODO: Dijkstra
error "pGovActionProtocolParametersUpdate: Dijkstra era not supported yet"
DijkstraEraBasedProtocolParametersUpdate
<$> pCommonProtocolParameters
<*> pAlonzoOnwardsPParams
<*> pIntroducedInBabbagePParams
<*> pIntroducedInConwayPParams
<*> pIntroducedInDijkstraPParams

pGovernanceActionTreasuryWithdrawalCmd
:: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
Expand Down
12 changes: 3 additions & 9 deletions cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,9 @@ addCostModelsToEraBasedProtocolParametersUpdate
ConwayEraBasedProtocolParametersUpdate common (aOn{alCostModels = SJust cmdls}) inB inC
addCostModelsToEraBasedProtocolParametersUpdate
AlonzoEraOnwardsDijkstra
_
_ =
-- TODO: Dijkstra
-- Add new protocol parameters from
-- https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/dijkstra/src/Cardano/Ledger/Dijkstra/PParams.hs#L75
-- to
-- https://github.com/IntersectMBO/cardano-api/blob/master/cardano-api/src/Cardano/Api/ProtocolParameters.hs#L190
-- and remove this `error`
error "addCostModelsToEraBasedProtocolParametersUpdate: Dijkstra not supported yet"
cmdls
(DijkstraEraBasedProtocolParametersUpdate common aOn inB inC inD) =
DijkstraEraBasedProtocolParametersUpdate common (aOn{alCostModels = SJust cmdls}) inB inC inD

runGovernanceActionTreasuryWithdrawalCmd
:: forall era e
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 @@ -74,8 +74,8 @@ data StakePoolRegistrationCertificateCmdArgs era
-- ^ Stake pool verification key.
, vrfVerificationKeyOrFile :: !(VerificationKeyOrFile VrfKey)
-- ^ VRF Verification key.
, blsSkeyFile :: !(SigningKeyFile In)
-- ^ The BLS signing key.
, blsSkeyFile :: !(Maybe (SigningKeyFile In))
-- ^ The BLS signing key (Dijkstra era only).
, poolPledge :: !Coin
-- ^ Pool pledge.
, poolCost :: !Coin
Expand Down
14 changes: 12 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/StakePool/Option.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

module Cardano.CLI.EraBased.StakePool.Option
( pStakePoolCmds
Expand All @@ -10,6 +12,7 @@ where

import Cardano.Api
import Cardano.Api.Experimental
import Cardano.Api.Experimental qualified as Exp
import Cardano.Api.Experimental.Certificate (Hash (StakePoolMetadataHash), StakePoolMetadata)
import Cardano.Api.Ledger qualified as L

Expand All @@ -19,6 +22,7 @@ import Cardano.CLI.EraBased.StakePool.Command qualified as Cmd
import Cardano.CLI.EraIndependent.Hash.Command qualified as Cmd
import Cardano.CLI.EraIndependent.Node.Option (pBlsSigningKeyFile)
import Cardano.CLI.Parser
import Cardano.CLI.Type.Common (SigningKeyFile)

import Data.Foldable qualified as F
import Options.Applicative hiding (help, str)
Expand Down Expand Up @@ -94,7 +98,8 @@ pExpectedStakePoolMetadataHash =
pExpectedHash (StakePoolMetadataHash . L.extractHash . L.castSafeHash) "stake pool metadata"

pStakePoolRegistrationCertificateCmd
:: IsEra era
:: forall era
. IsEra era
=> EnvCli
-> Maybe (Parser (Cmd.StakePoolCmds era))
pStakePoolRegistrationCertificateCmd envCli = do
Expand All @@ -106,7 +111,7 @@ pStakePoolRegistrationCertificateCmd envCli = do
Cmd.StakePoolRegistrationCertificateCmdArgs (convert useEra)
<$> pStakePoolVerificationKeyOrFile Nothing
<*> pVrfVerificationKeyOrFile
<*> pBlsSigningKeyFile
<*> pMaybeBlsSigningKeyFile @era
<*> pPoolPledge
<*> pPoolCost
<*> pPoolMargin
Expand All @@ -123,6 +128,11 @@ pStakePoolRegistrationCertificateCmd envCli = do
)
$ Opt.progDesc "Create a stake pool registration certificate"

pMaybeBlsSigningKeyFile :: forall era. IsEra era => Parser (Maybe (SigningKeyFile In))
pMaybeBlsSigningKeyFile = case useEra @era of
Exp.ConwayEra -> pure Nothing
Exp.DijkstraEra -> Just <$> pBlsSigningKeyFile

pStakePoolDeregistrationCertificateCmd
:: IsEra era => Maybe (Parser (Cmd.StakePoolCmds era))
pStakePoolDeregistrationCertificateCmd = do
Expand Down
15 changes: 9 additions & 6 deletions cardano-cli/src/Cardano/CLI/EraBased/StakePool/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,20 @@ runStakePoolRegistrationCertificateCmd
ownerStakeVerificationKeyOrFiles
let stakePoolOwners' = map verificationKeyHash sPoolOwnerVkeys

-- BLS signing key for Leios voting registration
blsSkey <-
fromEitherIOCli @(FileError TextEnvelopeError) $
readFileTextEnvelope @(SigningKey BlsKey) blsSkeyFile
let leiosKey = blsSigningKeyToLeiosKey blsSkey
-- BLS signing key for Leios voting registration (Dijkstra era only)
mLeiosKey <- case blsSkeyFile of
Nothing -> pure Nothing
Just skeyFile -> do
blsSkey <-
fromEitherIOCli @(FileError TextEnvelopeError) $
readFileTextEnvelope @(SigningKey BlsKey) skeyFile
pure $ Just $ blsSigningKeyToLeiosKey blsSkey

let stakePoolParams =
StakePoolParameters
{ stakePoolId = stakePoolId'
, stakePoolVRF = vrfKeyHash'
, stakePoolBlsKey = Just leiosKey
, stakePoolBlsKey = mLeiosKey
, stakePoolCost = poolCost
, stakePoolMargin = poolMargin
, stakePoolRewardAccount = rewardAccountAddr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Usage: cardano-cli
| cip-format
| compatible
)


Available options:
--version Show the cardano-cli version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@ metadata:
- 2
- - 11
- 3
- - '"A"'
- '"B"'
- - '[0x41]'
- '[0x42]'
- - a
- b
- - '"0A"'
- '"E"'
- - '[0x30, 0x41]'
- '[0x45]'
- - aa
- bb
- - ab
- ba
- - '"\DLE@A"'
- '"C"'
- - '"\NAK@A"'
- '"D"'
- - '[0x10, 0x40, 0x41]'
- '[0x43]'
- - '[0x15, 0x40, 0x41]'
- '[0x44]'
- - aab
- ba
- - aba
- - - 1
- 2
- - 11
- 3
- - '"A"'
- '"B"'
- - '[0x41]'
- '[0x42]'
- - a
- b
- - '"0A"'
- '"E"'
- - '[0x30, 0x41]'
- '[0x45]'
- - aa
- bb
- - ab
- ba
- - '"\DLE@A"'
- '"C"'
- - '"\NAK@A"'
- '"D"'
- - '[0x10, 0x40, 0x41]'
- '[0x43]'
- - '[0x15, 0x40, 0x41]'
- '[0x44]'
- - aab
- ba
- - abb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,41 +690,41 @@ metadata:
- 2
- - 11
- 3
- - '"A"'
- '"B"'
- - '[0x41]'
- '[0x42]'
- - a
- b
- - '"0A"'
- '"E"'
- - '[0x30, 0x41]'
- '[0x45]'
- - aa
- bb
- - ab
- ba
- - '"\DLE@A"'
- '"C"'
- - '"\NAK@A"'
- '"D"'
- - '[0x10, 0x40, 0x41]'
- '[0x43]'
- - '[0x15, 0x40, 0x41]'
- '[0x44]'
- - aab
- ba
- - aba
- - - 1
- 2
- - 11
- 3
- - '"A"'
- '"B"'
- - '[0x41]'
- '[0x42]'
- - a
- b
- - '"0A"'
- '"E"'
- - '[0x30, 0x41]'
- '[0x45]'
- - aa
- bb
- - ab
- ba
- - '"\DLE@A"'
- '"C"'
- - '"\NAK@A"'
- '"D"'
- - '[0x10, 0x40, 0x41]'
- '[0x43]'
- - '[0x15, 0x40, 0x41]'
- '[0x44]'
- - aab
- ba
- - abb
Expand Down
Loading
Loading