Skip to content
Open
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
6 changes: 3 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ source-repository-package
subdir:
typed-protocols

-- Points to cardano-api/leios-prototype
-- Points to origin/ch1bo/leios-pparam-updates
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api
tag: e32d8c07035283233fbdca4beeafbd78abc66512
--sha256: sha256-yYKuOUoIOvJy6872Sj3CruRT+UXfoQsqqaHXcYu8N1A=
tag: ed01aa0a8e3e069d2d4d4f47bd89a6ac68bd4e03
--sha256: sha256-ZUhGbDtte7/g92Z48kvCUdIOdSeaNjqhlMt21r8YlKY=
subdir:
cardano-api
cardano-api-gen
Expand Down
111 changes: 109 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ 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 Cardano.Ledger.BaseTypes (Milliseconds32 (..), NonZero, PositiveInterval, nonZero)
import Cardano.Ledger.Plutus.ExUnits (OrdExUnits (..))

import Data.Foldable
import Data.Function ((&))
import Data.Word (Word32)
import Data.Word (Word16, Word32)
import GHC.Natural (Natural)
import Options.Applicative
import Options.Applicative qualified as Opt
Expand Down Expand Up @@ -312,6 +313,112 @@ pIntroducedInDijkstraPParams =
<*> convertToLedger id (optional pMaxRefScriptSizePerTx)
<*> convertToLedger id (optional pRefScriptCostStride)
<*> convertToLedger id (optional pRefScriptCostMultiplier)
<*> convertToLedger id (optional pLeiosAnnouncementPeriodLength)
<*> convertToLedger id (optional pLeiosVotePeriodLength)
<*> convertToLedger id (optional pLeiosDiffusionPeriodLength)
<*> convertToLedger id (optional pLeiosCommitteeSize)
<*> convertToLedger toUnitIntervalOrErr (optional pLeiosQuorumStakeThreshold)
<*> convertToLedger id (optional pMaxEndorserBlockReferencesSize)
<*> convertToLedger id (optional pMaxEndorserBlockTxsSize)
<*> convertToLedger (OrdExUnits . toAlonzoExUnits) (optional pMaxEndorserBlockExecutionUnits)
<*> convertToLedger id (optional pMaxRefScriptSizePerEndorserBlock)

pLeiosAnnouncementPeriodLength :: Parser Milliseconds32
pLeiosAnnouncementPeriodLength =
Milliseconds32
<$> Opt.option
integralReader
( mconcat
[ Opt.long "leios-announcement-period-length"
, Opt.metavar "MILLISECONDS"
, Opt.help "Length of the Leios announcement period, in milliseconds."
]
)

pLeiosVotePeriodLength :: Parser Milliseconds32
pLeiosVotePeriodLength =
Milliseconds32
<$> Opt.option
integralReader
( mconcat
[ Opt.long "leios-vote-period-length"
, Opt.metavar "MILLISECONDS"
, Opt.help "Length of the Leios voting period, in milliseconds."
]
)

pLeiosDiffusionPeriodLength :: Parser Milliseconds32
pLeiosDiffusionPeriodLength =
Milliseconds32
<$> Opt.option
integralReader
( mconcat
[ Opt.long "leios-diffusion-period-length"
, Opt.metavar "MILLISECONDS"
, Opt.help "Length of the Leios diffusion period, in milliseconds."
]
)

pLeiosCommitteeSize :: Parser Word16
pLeiosCommitteeSize =
Opt.option integralReader $
mconcat
[ Opt.long "leios-committee-size"
, Opt.metavar "WORD16"
, Opt.help "Number of seats on the Leios voting committee."
]

pLeiosQuorumStakeThreshold :: Parser Rational
pLeiosQuorumStakeThreshold =
Opt.option readRational $
mconcat
[ Opt.long "leios-quorum-stake-threshold"
, Opt.metavar "RATIONAL"
, Opt.help "Fraction of committee stake required to certify an endorser block."
]

pMaxEndorserBlockReferencesSize :: Parser Word32
pMaxEndorserBlockReferencesSize =
Opt.option integralReader $
mconcat
[ Opt.long "max-endorser-block-references-size"
, Opt.metavar "WORD32"
, Opt.help "Maximum total size of the transaction references in an endorser block."
]

pMaxEndorserBlockTxsSize :: Parser Word32
pMaxEndorserBlockTxsSize =
Opt.option integralReader $
mconcat
[ Opt.long "max-endorser-block-txs-size"
, Opt.metavar "WORD32"
, Opt.help "Maximum total size of the transactions referenced by an endorser block."
]

pMaxEndorserBlockExecutionUnits :: Parser ExecutionUnits
pMaxEndorserBlockExecutionUnits =
uncurry ExecutionUnits
<$> Opt.option
pairIntegralReader
( mconcat
[ Opt.long "max-endorser-block-execution-units"
, Opt.metavar "(INT, INT)"
, Opt.help $
mconcat
[ "Max total script execution resource units allowed per endorser "
, "block. They are denominated as follows (steps, memory)."
]
]
)

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

pMaxRefScriptSizePerBlock :: Parser Word32
pMaxRefScriptSizePerBlock =
Expand Down
Loading