@@ -21,11 +21,12 @@ import Cardano.CLI.EraBased.Governance.Actions.Command qualified as Cmd
2121import Cardano.CLI.Option.Flag (setDefault )
2222import Cardano.CLI.Parser
2323import Cardano.CLI.Type.Common
24- import Cardano.Ledger.BaseTypes (NonZero , PositiveInterval , nonZero )
24+ import Cardano.Ledger.BaseTypes (Milliseconds32 (.. ), NonZero , PositiveInterval , nonZero )
25+ import Cardano.Ledger.Plutus.ExUnits (OrdExUnits (.. ))
2526
2627import Data.Foldable
2728import Data.Function ((&) )
28- import Data.Word (Word32 )
29+ import Data.Word (Word16 , Word32 )
2930import GHC.Natural (Natural )
3031import Options.Applicative
3132import Options.Applicative qualified as Opt
@@ -312,6 +313,112 @@ pIntroducedInDijkstraPParams =
312313 <*> convertToLedger id (optional pMaxRefScriptSizePerTx)
313314 <*> convertToLedger id (optional pRefScriptCostStride)
314315 <*> convertToLedger id (optional pRefScriptCostMultiplier)
316+ <*> convertToLedger id (optional pLeiosAnnouncementPeriodLength)
317+ <*> convertToLedger id (optional pLeiosVotePeriodLength)
318+ <*> convertToLedger id (optional pLeiosDiffusionPeriodLength)
319+ <*> convertToLedger id (optional pLeiosCommitteeSize)
320+ <*> convertToLedger toUnitIntervalOrErr (optional pLeiosQuorumStakeThreshold)
321+ <*> convertToLedger id (optional pMaxEndorserBlockReferencesSize)
322+ <*> convertToLedger id (optional pMaxEndorserBlockTxsSize)
323+ <*> convertToLedger (OrdExUnits . toAlonzoExUnits) (optional pMaxEndorserBlockExecutionUnits)
324+ <*> convertToLedger id (optional pMaxRefScriptSizePerEndorserBlock)
325+
326+ pLeiosAnnouncementPeriodLength :: Parser Milliseconds32
327+ pLeiosAnnouncementPeriodLength =
328+ Milliseconds32
329+ <$> Opt. option
330+ integralReader
331+ ( mconcat
332+ [ Opt. long " leios-announcement-period-length"
333+ , Opt. metavar " MILLISECONDS"
334+ , Opt. help " Length of the Leios announcement period, in milliseconds."
335+ ]
336+ )
337+
338+ pLeiosVotePeriodLength :: Parser Milliseconds32
339+ pLeiosVotePeriodLength =
340+ Milliseconds32
341+ <$> Opt. option
342+ integralReader
343+ ( mconcat
344+ [ Opt. long " leios-vote-period-length"
345+ , Opt. metavar " MILLISECONDS"
346+ , Opt. help " Length of the Leios voting period, in milliseconds."
347+ ]
348+ )
349+
350+ pLeiosDiffusionPeriodLength :: Parser Milliseconds32
351+ pLeiosDiffusionPeriodLength =
352+ Milliseconds32
353+ <$> Opt. option
354+ integralReader
355+ ( mconcat
356+ [ Opt. long " leios-diffusion-period-length"
357+ , Opt. metavar " MILLISECONDS"
358+ , Opt. help " Length of the Leios diffusion period, in milliseconds."
359+ ]
360+ )
361+
362+ pLeiosCommitteeSize :: Parser Word16
363+ pLeiosCommitteeSize =
364+ Opt. option integralReader $
365+ mconcat
366+ [ Opt. long " leios-committee-size"
367+ , Opt. metavar " WORD16"
368+ , Opt. help " Number of seats on the Leios voting committee."
369+ ]
370+
371+ pLeiosQuorumStakeThreshold :: Parser Rational
372+ pLeiosQuorumStakeThreshold =
373+ Opt. option readRational $
374+ mconcat
375+ [ Opt. long " leios-quorum-stake-threshold"
376+ , Opt. metavar " RATIONAL"
377+ , Opt. help " Fraction of committee stake required to certify an endorser block."
378+ ]
379+
380+ pMaxEndorserBlockReferencesSize :: Parser Word32
381+ pMaxEndorserBlockReferencesSize =
382+ Opt. option integralReader $
383+ mconcat
384+ [ Opt. long " max-endorser-block-references-size"
385+ , Opt. metavar " WORD32"
386+ , Opt. help " Maximum total size of the transaction references in an endorser block."
387+ ]
388+
389+ pMaxEndorserBlockTxsSize :: Parser Word32
390+ pMaxEndorserBlockTxsSize =
391+ Opt. option integralReader $
392+ mconcat
393+ [ Opt. long " max-endorser-block-txs-size"
394+ , Opt. metavar " WORD32"
395+ , Opt. help " Maximum total size of the transactions referenced by an endorser block."
396+ ]
397+
398+ pMaxEndorserBlockExecutionUnits :: Parser ExecutionUnits
399+ pMaxEndorserBlockExecutionUnits =
400+ uncurry ExecutionUnits
401+ <$> Opt. option
402+ pairIntegralReader
403+ ( mconcat
404+ [ Opt. long " max-endorser-block-execution-units"
405+ , Opt. metavar " (INT, INT)"
406+ , Opt. help $
407+ mconcat
408+ [ " Max total script execution resource units allowed per endorser "
409+ , " block. They are denominated as follows (steps, memory)."
410+ ]
411+ ]
412+ )
413+
414+ pMaxRefScriptSizePerEndorserBlock :: Parser Word32
415+ pMaxRefScriptSizePerEndorserBlock =
416+ Opt. option integralReader $
417+ mconcat
418+ [ Opt. long " max-ref-script-size-per-endorser-block"
419+ , Opt. metavar " WORD32"
420+ , Opt. help " Maximum total size of reference scripts per endorser block."
421+ ]
315422
316423pMaxRefScriptSizePerBlock :: Parser Word32
317424pMaxRefScriptSizePerBlock =
0 commit comments