Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fixes of baker terminology. #288

Merged
merged 6 commits into from
Nov 23, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## 6.2.1

- Remove uses of `baker` term when printing chain parameters.
- Remove remaining uses of `baker` in output of `validator add` and `validator
configure` command and in their options.

## 6.2.0

- Revise client's reconnect handling so that the client will no longer attempt
Expand Down
2 changes: 1 addition & 1 deletion concordium-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.24
-- see: https://github.com/sol/hpack

name: concordium-client
version: 6.2.0
version: 6.2.1
description: Please see the README on GitHub at <https://github.com/Concordium/concordium-client#readme>
homepage: https://github.com/Concordium/concordium-client#readme
bug-reports: https://github.com/Concordium/concordium-client/issues
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: concordium-client
version: 6.2.0
version: 6.2.1
github: "Concordium/concordium-client"
author: "Concordium"
maintainer: "[email protected]"
Expand Down
10 changes: 8 additions & 2 deletions src/Concordium/Client/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1712,14 +1712,20 @@ bakerAddCmd =
<$> (option (eitherReader openStatusFromStringInform) (long "open-delegation-for" <> metavar "SELECTION" <> help helpOpenDelegationFor))
<*> bakerOrValidatorUrl
<*> (option (eitherReader amountFractionFromStringInform) (long "delegation-transaction-fee-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on transaction fee rewards. " ++ rangesHelpString "transaction fee commission")))
<*> (option (eitherReader amountFractionFromStringInform) (long "delegation-baking-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on baking rewards. " ++ rangesHelpString "baking reward commission")))
<*> blockCommission
<*> (option (eitherReader amountFractionFromStringInform) (long "delegation-finalization-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on finalization rewards. " ++ rangesHelpString "finalization reward commission")))
)
<*> optional (strOption (long "out" <> metavar "FILE" <> help "File to write the validator credentials to, in case of successful transaction. These can be used to start the node."))
)
(progDesc "Deploy validator credentials to the chain.")
)

-- | Parser for block reward commission. It supports the legacy terminology of "baking-commission" but it is hidden.
blockCommission :: Parser AmountFraction
blockCommission = blockCommissionGen internal "delegation-baking-commission" <|> blockCommissionGen mempty "delegation-block-reward-commission"
where
blockCommissionGen modifier name = option (eitherReader amountFractionFromStringInform) (modifier <> long name <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on block rewards. " ++ rangesHelpString "block reward commission"))

allowedValuesOpenDelegationForAsString :: String
allowedValuesOpenDelegationForAsString =
" - 'all' (delegators are allowed to join the pool),\n"
Expand Down Expand Up @@ -1753,7 +1759,7 @@ bakerConfigureCmd =
<*> optional (option (eitherReader openStatusFromStringInform) (long "open-delegation-for" <> metavar "SELECTION" <> help helpOpenDelegationFor))
<*> optional bakerOrValidatorUrl
<*> optional (option (eitherReader amountFractionFromStringInform) (long "delegation-transaction-fee-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on transaction fee rewards. " ++ rangesHelpString "transaction fee commission")))
<*> optional (option (eitherReader amountFractionFromStringInform) (long "delegation-baking-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on baking rewards. " ++ rangesHelpString "baking reward commission")))
<*> optional blockCommission
<*> optional (option (eitherReader amountFractionFromStringInform) (long "delegation-finalization-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the validator takes in commission from delegators on finalization rewards. " ++ rangesHelpString "finalization reward commission")))
<*> optional (strOption (long "keys-in" <> metavar "FILE" <> help "File containing validator credentials."))
<*> optional (strOption (long "keys-out" <> metavar "FILE" <> help "File to write updated validator credentials to, in case of successful transaction. These can be used to start the node."))
Expand Down
34 changes: 17 additions & 17 deletions src/Concordium/Client/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ printAccountInfo addr a verbose showEncrypted mEncKey = do
else return ()

case Types.aiStakingInfo a of
Types.AccountStakingNone -> tell ["Baking or delegating stake: no"]
Types.AccountStakingNone -> tell ["Validator or delegator: no"]
Types.AccountStakingBaker{..} -> do
let bkid = [i|Validator: \##{show . Types._bakerIdentity $ asiBakerInfo}|]
stkstr = [i| - Staked amount: #{showCcd asiStakedAmount}|]
Expand Down Expand Up @@ -819,7 +819,7 @@ showEvent verbose ciM = \case
Types.BakerSetTransactionFeeCommission{..} ->
verboseOrNothing $ printf "validator %s changed transaction fee commission to %s" (showBaker ebstfcBakerId ebstfcAccount) (show ebstfcTransactionFeeCommission)
Types.BakerSetBakingRewardCommission{..} ->
verboseOrNothing $ printf "validator %s changed baking reward commission to %s" (showBaker ebsbrcBakerId ebsbrcAccount) (show ebsbrcBakingRewardCommission)
verboseOrNothing $ printf "validator %s changed block reward commission to %s" (showBaker ebsbrcBakerId ebsbrcAccount) (show ebsbrcBakingRewardCommission)
Types.BakerSetFinalizationRewardCommission{..} ->
verboseOrNothing $ printf "validator %s changed finalization reward commission to %s" (showBaker ebsfrcBakerId ebsfrcAccount) (show ebsfrcFinalizationRewardCommission)
Types.DelegationStakeIncreased{..} ->
Expand Down Expand Up @@ -1026,21 +1026,21 @@ showRejectReason verbose = \case
Types.NonExistentCredIDs cids -> [i|credential registration ids #{cids} do not exist|]
Types.RemoveFirstCredential -> [i|attempt to remove the first credential of the account|]
Types.CredentialHolderDidNotSign -> [i|credential holder did not sign the credential key update|]
Types.StakeUnderMinimumThresholdForBaking -> "the desired stake is under the minimum threshold for baking"
Types.StakeUnderMinimumThresholdForBaking -> "the desired stake is under the minimum threshold for a validator"
Types.NotAllowedMultipleCredentials -> "the account is not allowed to have multiple credentials"
Types.NotAllowedToReceiveEncrypted -> "the account is not allowed to receive shielded transfers"
Types.NotAllowedToHandleEncrypted -> "the account is not allowed handle shielded amounts"
Types.MissingBakerAddParameters -> "missing parameters to add new validator"
Types.FinalizationRewardCommissionNotInRange -> "finalization reward commission was not within the allowed range"
Types.BakingRewardCommissionNotInRange -> "baking reward commission was not within the allowed range"
Types.BakingRewardCommissionNotInRange -> "block reward commission was not within the allowed range"
Types.TransactionFeeCommissionNotInRange -> "transaction fee commission fee was not within the allowed range"
Types.AlreadyADelegator -> "the account is already a delegator"
Types.InsufficientBalanceForDelegationStake -> "the balance on the account is insufficient to cover the desired stake"
Types.MissingDelegationAddParameters -> "missing parameters to add new delegator"
Types.DelegatorInCooldown -> "change could not be completed because the delegator is in the cooldown period"
Types.NotADelegator addr -> printf "attempt to remove a delegator account %s that is not a delegator" (show addr)
Types.StakeOverMaximumThresholdForPool -> "baking pool's total capital would become too large"
Types.PoolWouldBecomeOverDelegated -> "fraction of delegated capital to baking pool would become too large"
Types.StakeOverMaximumThresholdForPool -> "staking pool's total capital would become too large"
Types.PoolWouldBecomeOverDelegated -> "fraction of delegated capital to staking pool would become too large"
Types.PoolClosed -> "pool not open for delegation"
Types.InsufficientDelegationStake -> "not allowed to add delegator with 0 stake"
Types.DelegationTargetNotABaker bid -> printf "delegation target %s is not a validator id" (show bid)
Expand Down Expand Up @@ -1160,7 +1160,7 @@ printChainParametersV0 :: ChainParameters' 'ChainParametersV0 -> Printer
printChainParametersV0 ChainParameters{..} =
tell
[ [i|\# Validator parameters |],
[i| + baker extra cooldown: #{(_cpBakerExtraCooldownEpochs _cpCooldownParameters)} epochs|],
[i| + validator extra cooldown: #{(_cpBakerExtraCooldownEpochs _cpCooldownParameters)} epochs|],
[i| + stake threshold to become a validator: #{showCcd (_ppBakerStakeThreshold _cpPoolParameters)}|],
"",
[i|\# Exchange rate parameters: |],
Expand All @@ -1171,13 +1171,13 @@ printChainParametersV0 ChainParameters{..} =
[i|\# Parameters that affect rewards distribution:|],
[i| + mint rate per slot: #{_cpRewardParameters ^. (mdMintPerSlot . unconditionally)}|],
[i| + mint distribution:|],
[i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * block reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|],
[i| + transaction fee distribution:|],
[i| * fraction for the validator: #{_cpRewardParameters ^. tfdBaker}|],
[i| * fraction for the GAS account: #{_cpRewardParameters ^. tfdGASAccount}|],
[i| + GAS account distribution:|],
[i| * baking a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * producing a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * adding a finalization proof: #{showConditionally (_cpRewardParameters ^. gasFinalizationProof)}|],
[i| * adding a credential deployment: #{_cpRewardParameters ^. gasAccountCreation}|],
[i| * adding a chain update: #{_cpRewardParameters ^. gasChainUpdate}|],
Expand All @@ -1199,12 +1199,12 @@ printChainParametersV1 ChainParameters{..} =
[i| + maximum factor a pool may stake relative to the validator's stake: #{_cpPoolParameters ^. ppLeverageBound}|],
[i| + pool owner cooldown duration: #{durationToText (durationSeconds (_cpCooldownParameters ^. cpPoolOwnerCooldown) * 1000)}|],
[i| + allowed range for finalization commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . finalizationCommissionRange))}|],
[i| + allowed range for baking commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . bakingCommissionRange))}|],
[i| + allowed range for block reward commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . bakingCommissionRange))}|],
[i| + allowed range for transaction commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . transactionCommissionRange))}|],
"",
[i|\# Passive delegation parameters:|],
[i| + finalization commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.finalizationCommission)}|],
[i| + baking commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.bakingCommission)}|],
[i| + block reward commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.bakingCommission)}|],
[i| + transaction commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.transactionCommission)}|],
"",
[i|\# Parameters related to delegators: |],
Expand All @@ -1218,13 +1218,13 @@ printChainParametersV1 ChainParameters{..} =
[i|\# Parameters that affect rewards distribution:|],
[i| + mint amount per reward period: #{_cpTimeParameters ^. tpMintPerPayday}|],
[i| + mint distribution:|],
[i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * block reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|],
[i| + transaction fee distribution:|],
[i| * validator: #{_cpRewardParameters ^. tfdBaker}|],
[i| * GAS account: #{_cpRewardParameters ^. tfdGASAccount}|],
[i| + GAS rewards:|],
[i| * baking a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * producing a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * adding a finalization proof: #{showConditionally (_cpRewardParameters ^. gasFinalizationProof)}|],
[i| * adding a credential deployment: #{_cpRewardParameters ^. gasAccountCreation}|],
[i| * adding a chain update: #{_cpRewardParameters ^. gasChainUpdate}|],
Expand All @@ -1248,12 +1248,12 @@ printChainParametersV2 ChainParameters{..} =
[i| + maximum factor a pool may stake relative to the validator's stake: #{_cpPoolParameters ^. ppLeverageBound}|],
[i| + pool owner cooldown duration: #{durationToText (durationSeconds (_cpCooldownParameters ^. cpPoolOwnerCooldown) * 1000)}|],
[i| + allowed range for finalization commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . finalizationCommissionRange))}|],
[i| + allowed range for baking commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . bakingCommissionRange))}|],
[i| + allowed range for block reward commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . bakingCommissionRange))}|],
[i| + allowed range for transaction commission: #{showInclusiveRange show (_cpPoolParameters ^. (ppCommissionBounds . transactionCommissionRange))}|],
"",
[i|\# Passive delegation parameters:|],
[i| + finalization commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.finalizationCommission)}|],
[i| + baking commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.bakingCommission)}|],
[i| + block reward commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.bakingCommission)}|],
[i| + transaction commission: #{_cpPoolParameters ^. (ppPassiveCommissions . Types.transactionCommission)}|],
"",
[i|\# Parameters related to delegators: |],
Expand All @@ -1267,13 +1267,13 @@ printChainParametersV2 ChainParameters{..} =
[i|\# Parameters that affect rewards distribution:|],
[i| + mint amount per reward period: #{_cpTimeParameters ^. tpMintPerPayday}|],
[i| + mint distribution:|],
[i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * block reward: #{_cpRewardParameters ^. mdBakingReward}|],
[i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|],
[i| + transaction fee distribution:|],
[i| * validator: #{_cpRewardParameters ^. tfdBaker}|],
[i| * GAS account: #{_cpRewardParameters ^. tfdGASAccount}|],
[i| + GAS rewards:|],
[i| * baking a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * producing a block: #{_cpRewardParameters ^. gasBaker}|],
[i| * adding a finalization proof: |] <> showConditionally (_cpRewardParameters ^. gasFinalizationProof),
[i| * adding a credential deployment: #{_cpRewardParameters ^. gasAccountCreation}|],
[i| * adding a chain update: #{_cpRewardParameters ^. gasChainUpdate}|],
Expand Down
Loading
Loading