Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 64 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2026-06-02T21:49:32Z
, cardano-haskell-packages 2026-06-02T21:14:32Z

active-repositories:
, :rest
, cardano-haskell-packages:override
, cardano-haskell-packages 2026-06-23T21:17:32Z

packages:
cardano-cli
Expand Down Expand Up @@ -100,3 +96,66 @@ if impl(ghc >= 9.14)
, with-utf8:base
-- cabal-allow-newer end

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api.git
tag: a775a6a9d581e2216ebc31f27572f4ae1c499e48
--sha256: sha256-U0UDIuhsDfJ4PDV1BqDTY7/2gWpf8c/Z2IVqUGMNhKQ=
subdir:
cardano-api

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 8dc1c431e06db2c8b5d44fb4b3cca6419197d763
--sha256: sha256-xKtgNFxjbJE6UWGvTioGX81NgvlKH3mHEaYMWDm8/UA=
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

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

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus.git
tag: e6fad063078894cefece2a535a2e2b4d9a092e73
--sha256: sha256-SPtbQ1+zN4uYiVx3rej2kMasbpfhSAyjRD5bdrnK3Rs=
subdir:
.

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network.git
tag: d7736b7c4c51f7328bd9462dc75df0c04a7b06d0
--sha256: sha256-9sWmBNESHApZmwOi0CpSwn619NIw6/msvV5vH57eqx8=
subdir:
./cardano-diffusion
./monoidal-synchronisation
./network-mux
./ouroboros-network
11 changes: 7 additions & 4 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,16 @@ library
cardano-api ^>=11.3,
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.3,
cardano-crypto-class ^>=2.5,
cardano-crypto-wrapper ^>=1.7,
cardano-data >=1.1,
cardano-diffusion:ping ^>=1.0,
cardano-git-rev ^>=0.2.2,
cardano-ledger-api,
cardano-ledger-conway,
cardano-ledger-core,
cardano-ledger-dijkstra,
cardano-ping ^>=0.10,
cardano-ledger-shelley,
cardano-prelude,
cardano-protocol-tpraos,
cardano-slotting ^>=0.2.0.0,
Expand All @@ -267,13 +268,13 @@ library
exceptions,
filepath,
formatting,
fs-api,
generic-lens,
haskeline,
http-client,
http-client-tls,
http-types,
io-classes,
io-classes:strict-stm,
iproute,
microlens,
mmorph,
Expand All @@ -292,7 +293,7 @@ library
transformers,
unliftio-core,
utf8-string,
validation,
validation ^>=1.2,
vary ^>=0.1.1.2,
vector,
yaml,
Expand Down Expand Up @@ -440,6 +441,8 @@ test-suite cardano-cli-golden
cardano-cli,
cardano-cli:cardano-cli-test-lib,
cardano-crypto-wrapper,
cardano-ledger-conway,
cardano-ledger-shelley,
cardano-strict-containers ^>=0.1,
cborg,
directory,
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import Cardano.CLI.Type.Error.NodeCmdError
import Cardano.CLI.Type.Error.StakePoolCmdError
import Cardano.CLI.Type.Key
import Cardano.Crypto.Hash qualified as Crypto
import Cardano.Ledger.Conway.Genesis (ConwayExtraConfig (..))
import Cardano.Ledger.Shelley.Genesis (InjectionData (..), ShelleyExtraConfig (..))
import Cardano.Prelude (canonicalEncodePretty)
import Cardano.Protocol.Crypto qualified as C

Expand Down Expand Up @@ -488,8 +490,16 @@ runGenesisCreateTestNetDataCmd
cgInitialDReps <- initialDReps (L.ucppDRepDeposit $ L.cgUpgradePParams conwayGenesis) dRepKeys
pure $
conwayGenesis
{ L.cgDelegs = delegs (zip stakingKeys (case dRepKeys of [] -> []; _ -> cycle dRepKeys))
, L.cgInitialDReps
{ L.cgDelegs = mempty
, L.cgInitialDReps = mempty
, L.cgExtraConfig =
L.SJust
ConwayExtraConfig
{ cecDelegs =
EmbeddedInjection $
delegs (zip stakingKeys (case dRepKeys of [] -> []; _ -> cycle dRepKeys))
, cecInitialDReps = EmbeddedInjection cgInitialDReps
}
}
where
delegs
Expand Down Expand Up @@ -523,7 +533,7 @@ runGenesisCreateTestNetDataCmd
, L.drepAnchor = SNothing
, L.drepDeposit
, L.drepDelegs = Set.empty -- We don't need to populate this field (field "initialDReps"."keyHash-*"."delegators" in the JSON)
-- because its content is derived from the "delegs" field ("cgDelegs" above). In other words, when the Conway genesis is applied,
-- because its content is derived from the "delegs" field ("cecDelegs" above). In other words, when the Conway genesis is applied,
-- DRep delegations are computed from the "delegs" field. In the future the "delegators" field may
-- be omitted altogether from the JSON representation, but it remains in the Haskell type.
-- More details are provided here: https://github.com/IntersectMBO/cardano-ledger/issues/4782
Expand Down Expand Up @@ -875,20 +885,24 @@ updateOutputTemplate
{ sgSystemStart
, sgMaxLovelaceSupply = totalSupply
, sgGenDelegs = shelleyDelKeys
, sgInitialFunds =
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute nonDelegCoin nUtxoAddrsNonDeleg utxoAddrsNonDeleg
++ distribute delegCoin nUtxoAddrsDeleg utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, sgStaking =
ShelleyGenesisStaking
{ sgsPools = ListMap pools
, sgsStake = ListMap stake
}
, sgInitialFunds = mempty
, sgStaking = mempty
, sgProtocolParams
, sgExtraConfig =
L.SJust
ShelleyExtraConfig
{ secInitialFunds =
EmbeddedInjection $
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute nonDelegCoin nUtxoAddrsNonDeleg utxoAddrsNonDeleg
++ distribute delegCoin nUtxoAddrsDeleg utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, secStakePools = EmbeddedInjection (ListMap pools)
, secStakeCredentials = EmbeddedInjection (ListMap stake)
}
}
where
nonDelegCoin = getCoinForDistribution nonDelegCoinRaw
Expand Down
71 changes: 41 additions & 30 deletions cardano-cli/src/Cardano/CLI/EraBased/Genesis/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import Cardano.Crypto qualified as CC
import Cardano.Crypto.Hash qualified as Crypto
import Cardano.Crypto.Signing qualified as Byron
import Cardano.Ledger.BaseTypes (unNonZero)
import Cardano.Ledger.Shelley.Genesis (InjectionData (..), ShelleyExtraConfig (..))
import Cardano.Protocol.Crypto qualified as C

import Control.DeepSeq (NFData, force)
Expand Down Expand Up @@ -795,20 +796,24 @@ updateOutputTemplate
{ sgSystemStart
, sgMaxLovelaceSupply = fromIntegral $ nonDelegCoin + delegCoin
, sgGenDelegs = shelleyDelKeys
, sgInitialFunds =
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute (nonDelegCoin - subtractForTreasury) nUtxoAddrsNonDeleg utxoAddrsNonDeleg
++ distribute (delegCoin - subtractForTreasury) nUtxoAddrsDeleg utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, sgStaking =
ShelleyGenesisStaking
{ sgsPools = ListMap pools
, sgsStake = ListMap stake
}
, sgInitialFunds = mempty
, sgStaking = mempty
, sgProtocolParams
, sgExtraConfig =
L.SJust
ShelleyExtraConfig
{ secInitialFunds =
EmbeddedInjection $
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute (nonDelegCoin - subtractForTreasury) nUtxoAddrsNonDeleg utxoAddrsNonDeleg
++ distribute (delegCoin - subtractForTreasury) nUtxoAddrsDeleg utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, secStakePools = EmbeddedInjection (ListMap pools)
, secStakeCredentials = EmbeddedInjection (ListMap stake)
}
}
where
maximumLovelaceSupply :: Word64
Expand Down Expand Up @@ -1114,24 +1119,30 @@ updateTemplate
{ sgSystemStart = start
, sgMaxLovelaceSupply = fromIntegral $ nonDelegCoin + delegCoin
, sgGenDelegs = shelleyDelKeys
, sgInitialFunds =
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute (nonDelegCoin - subtractForTreasury) utxoAddrsNonDeleg
++ distribute (delegCoin - subtractForTreasury) utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, sgStaking =
ShelleyGenesisStaking
{ sgsPools =
fromList
[ (L.sppId poolParams, poolParams)
| poolParams <- Map.elems poolSpecs
]
, sgsStake = ListMap.fromMap $ L.sppId <$> poolSpecs
}
, sgInitialFunds = mempty
, sgStaking = mempty
, sgProtocolParams = pparamsFromTemplate
, sgExtraConfig =
L.SJust
ShelleyExtraConfig
{ secInitialFunds =
EmbeddedInjection $
fromList
[ (toShelleyAddr addr, v)
| (addr, v) <-
distribute (nonDelegCoin - subtractForTreasury) utxoAddrsNonDeleg
++ distribute (delegCoin - subtractForTreasury) utxoAddrsDeleg
++ mkStuffedUtxo stuffedUtxoAddrs
]
, secStakePools =
EmbeddedInjection $
fromList
[ (L.sppId poolParams, poolParams)
| poolParams <- Map.elems poolSpecs
]
, secStakeCredentials =
EmbeddedInjection (ListMap.fromMap $ L.sppId <$> poolSpecs)
}
}
shelleyGenesis
where
Expand Down
13 changes: 6 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraIndependent/Cip/Cip129/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Data.ByteString (ByteString)
import Data.ByteString qualified as BS
import Data.ByteString.Char8 qualified as BSC
import Data.Text.Encoding qualified as Text
import Data.Validation qualified as Valid
import System.IO

runCip129 :: Cip129 -> CIO e ()
Expand All @@ -32,9 +31,9 @@ runCip129 (Cip129DRep inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readDrepVerificationKeyFile f
InputHexText t -> do
fromEitherCli . Valid.toEither $ readDRepHexVerificationKeyText t
fromEitherCli . toEither $ readDRepHexVerificationKeyText t
InputBech32Text t -> do
fromEitherCli . Valid.toEither $ readDRepBech32VerificationKeyText t
fromEitherCli . toEither $ readDRepBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129DrepVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129CommitteeHotKey inp out) = do
Expand All @@ -43,9 +42,9 @@ runCip129 (Cip129CommitteeHotKey inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readCommitteeHotVerificationKeyFile f
InputHexText t ->
fromEitherCli . Valid.toEither $ readCommitteeHotHexVerificationKeyText t
fromEitherCli . toEither $ readCommitteeHotHexVerificationKeyText t
InputBech32Text t ->
fromEitherCli . Valid.toEither $ readCommitteeHotBech32VerificationKeyText t
fromEitherCli . toEither $ readCommitteeHotBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeHotVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129CommitteeColdKey inp out) = do
Expand All @@ -54,9 +53,9 @@ runCip129 (Cip129CommitteeColdKey inp out) = do
f <- liftIO $ fileOrPipe textEnvFp
fromEitherIOCli $ readCommitteeColdVerificationKeyFile f
InputHexText t ->
fromEitherCli . Valid.toEither $ readCommitteeColdHexVerificationKeyText t
fromEitherCli . toEither $ readCommitteeColdHexVerificationKeyText t
InputBech32Text t ->
fromEitherCli . Valid.toEither $ readCommitteeColdBech32VerificationKeyText t
fromEitherCli . toEither $ readCommitteeColdBech32VerificationKeyText t
let cip129Output = Text.encodeUtf8 $ encodeCip129CommitteeColdVerficationKeyText k
renderOutput cip129Output out
runCip129 (Cip129GovernanceAction inp out) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import Cardano.CLI.Orphan ()

import Data.Aeson qualified as Aeson
import Data.ByteString.Lazy qualified as LBS
import System.Directory (makeAbsolute)
import System.FS.API (SomeHasFS (..))
import System.FS.API.Types (MountPoint (MountPoint))
import System.FS.IO (ioHasFS)
import System.FilePath (takeDirectory)
import System.IO qualified as IO

runLogEpochStateCmd
Expand All @@ -28,9 +33,13 @@ runLogEpochStateCmd
} = do
LBS.appendFile outputFilePath ""

configDir <- takeDirectory <$> makeAbsolute (unFile configurationFile)
let fs = SomeHasFS (ioHasFS (MountPoint configDir))

result <-
runExceptT $
foldEpochState
fs
configurationFile
nodeSocketPath
Api.QuickValidation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pPing =
, Opt.short 'm'
, Opt.metavar "MAGIC"
, Opt.help "Network magic."
, Opt.value CNP.mainnetMagic
, Opt.value (CNP.unNetworkMagic CNP.mainnetMagic)
]
)
<*> ( Opt.switch $
Expand Down
Loading
Loading