From d5274d4322db270d5c9ac9dae3278d8d93e2d710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 9 Nov 2023 22:16:15 +0100 Subject: [PATCH] Renaming bakers to validators. --- ChangeLog.md | 4 + src/Concordium/Client/Commands.hs | 129 +++++++++++++++----------- src/Concordium/Client/Output.hs | 60 ++++++------ src/Concordium/Client/Runner.hs | 148 +++++++++++++++--------------- 4 files changed, 182 insertions(+), 159 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index dd56ca84..899356ef 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,10 @@ - Revise client's reconnect handling so that the client will no longer attempt to automatically reconnect on timeouts and node resource exhaustion. +- Rename bakers to validators in output. +- Add additional configuration options that use `validator` in place of `baker`. + For example `concordium-client validator add`. + The older options still exist, but are hidden. ## 6.1.0 diff --git a/src/Concordium/Client/Commands.hs b/src/Concordium/Client/Commands.hs index 992999e1..ca839220 100644 --- a/src/Concordium/Client/Commands.hs +++ b/src/Concordium/Client/Commands.hs @@ -658,19 +658,25 @@ interactionOptsParser = programOptions :: Parser Options programOptions = Options - <$> hsubparser - ( metavar "command" - <> transactionCmds - <> accountCmds - <> moduleCmds - <> contractCmds - <> configCmds - <> consensusCmds - <> blockCmds - <> bakerCmds - <> delegatorCmds - <> identityCmds - <> rawCmds + <$> ( hsubparser + ( metavar "command" + <> transactionCmds + <> accountCmds + <> moduleCmds + <> contractCmds + <> configCmds + <> consensusCmds + <> blockCmds + <> bakerCmds "validator" + <> delegatorCmds + <> identityCmds + <> rawCmds + ) + <|> hsubparser + ( metavar "command" + <> bakerCmds "baker" + <> internal + ) ) <*> backendParser <*> optional (strOption (long "config" <> metavar "DIR" <> help "Path to the configuration directory.")) @@ -713,7 +719,7 @@ transactionSubmitCmd = <$> strArgument (metavar "FILE" <> help "File containing the transaction parameters in JSON format.") <*> interactionOptsParser ) - (progDesc "Parse transaction and send it to the baker.") + (progDesc "Parse transaction and send it to the node.") ) transactionDeployCredentialCmd :: Mod CommandFields TransactionCmd @@ -725,7 +731,7 @@ transactionDeployCredentialCmd = <$> strArgument (metavar "FILE" <> help "File containing the credential deployment information.") <*> interactionOptsParser ) - (progDesc "Parse credential and send it to the baker.") + (progDesc "Parse credential and send it to the node.") ) transactionStatusCmd :: Mod CommandFields TransactionCmd @@ -1556,10 +1562,14 @@ consensusShowParametersCmd = ( info ( ConsensusShowParameters <$> optional (strOption (long "block" <> metavar "BLOCK" <> help "Hash of the block (default: \"best\").")) - <*> switch (long "include-bakers" <> help "Include the \"lottery power\" of individual bakers.") + <*> ( switch (internal <> long "include-bakers" <> includeHelp) + <|> switch (hidden <> long "include-validators" <> includeHelp) + ) ) (progDesc "Show election parameters for given block.") ) + where + includeHelp = help "Include the \"lottery power\" of individual validators." consensusShowChainParametersCmd :: Mod CommandFields ConsensusCmd consensusShowChainParametersCmd = @@ -1605,14 +1615,14 @@ blockShowCmd = ( BlockShow <$> optional (strArgument (metavar "BLOCK" <> help "Hash of the block (default: \"best\").")) ) - (progDesc "Show the backend's information about a specific block. Note that some fields (e.g. slot time) are objective while others (e.g. arrival time) are specific to the particular baker being queried.") + (progDesc "Show the node's information about a specific block. Note that some fields (e.g. block time) are objective while others (e.g. arrival time) are specific to the particular node being queried.") ) -bakerCmds :: Mod CommandFields Cmd -bakerCmds = - command - "baker" - ( info +bakerCmds :: String -> Mod CommandFields Cmd +bakerCmds name = command name subcommands + where + subcommands = + info ( BakerCmd <$> hsubparser ( bakerGenerateKeysCmd @@ -1627,8 +1637,7 @@ bakerCmds = <> bakerGetEarliestWinTime ) ) - (progDesc "Commands for creating and deploying baker credentials.") - ) + (progDesc "Commands for creating and deploying validator credentials.") delegatorCmds :: Mod CommandFields Cmd delegatorCmds = @@ -1645,6 +1654,11 @@ delegatorCmds = (progDesc "Commands for delegation.") ) +validatorOrBakerId :: Parser (Maybe BakerId) +validatorOrBakerId = common (internal <> long "baker-id") <|> common (long "validator-id") + where + common props = optional (option auto (props <> metavar "VALIDATORID" <> help "Optionally provide the validator id to be included with generated baker keys.")) + bakerGenerateKeysCmd :: Mod CommandFields BakerCmd bakerGenerateKeysCmd = command @@ -1652,11 +1666,11 @@ bakerGenerateKeysCmd = ( info ( BakerGenerateKeys <$> optional (strArgument (metavar "FILE" <> help "File to write keys to.")) - <*> optional (option auto (long "baker-id" <> metavar "BAKERID" <> help "Optionally provide the baker id to be included with generated baker keys.")) + <*> validatorOrBakerId ) ( progDescDoc $ docFromLines - [ "Create baker credentials and write them to a file or stdout.", + [ "Create validator credentials and write them to a file or stdout.", "If the output file is specified secret keys are written to it,", " and public keys are written to the file with the same name but '.pub.json' extension.", "Format:", @@ -1678,27 +1692,32 @@ rangesHelpString name = ++ name ++ "." +bakerOrValidatorUrl :: Parser String +bakerOrValidatorUrl = strOption (internal <> long "baker-url" <> commonProps) <|> strOption (long "validator-url" <> commonProps) + where + commonProps = metavar "URL" <> help "A link to information about the validator." + bakerAddCmd :: Mod CommandFields BakerCmd bakerAddCmd = command "add" ( info ( BakerAdd - <$> strArgument (metavar "FILE" <> help "File containing the baker credentials.") + <$> strArgument (metavar "FILE" <> help "File containing the validator credentials.") <*> transactionOptsParser <*> option (eitherReader amountFromStringInform) (long "stake" <> metavar "CCD-AMOUNT" <> help "The amount of CCD to stake.") - <*> (not <$> switch (long "no-restake" <> help "If supplied, the earnings will not be added to the baker stake automatically.")) + <*> (not <$> switch (long "no-restake" <> help "If supplied, the earnings will not be added to the validator stake automatically.")) <*> optional ( ExtraBakerAddData <$> (option (eitherReader openStatusFromStringInform) (long "open-delegation-for" <> metavar "SELECTION" <> help helpOpenDelegationFor)) - <*> (strOption (long "baker-url" <> metavar "URL" <> help "A link to information about the baker.")) - <*> (option (eitherReader amountFractionFromStringInform) (long "delegation-transaction-fee-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the baker 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 baker takes in commission from delegators on baking rewards. " ++ rangesHelpString "baking reward commission"))) - <*> (option (eitherReader amountFractionFromStringInform) (long "delegation-finalization-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the baker takes in commission from delegators on finalization rewards. " ++ rangesHelpString "finalization reward commission"))) + <*> 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"))) + <*> (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 baker credentials to, in case of successful transaction. These can be used to start the node.")) + <*> 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 baker credentials to the chain.") + (progDesc "Deploy validator credentials to the chain.") ) allowedValuesOpenDelegationForAsString :: String @@ -1717,7 +1736,7 @@ openStatusFromStringInform s = helpOpenDelegationFor :: String helpOpenDelegationFor = - "Select whether the baker will allow other parties (delegators) to delegate CCD to the pool. Available values for SELECTION are:\n" ++ allowedValuesOpenDelegationForAsString ++ "." + "Select whether the validator will allow other parties (delegators) to delegate CCD to the pool. Available values for SELECTION are:\n" ++ allowedValuesOpenDelegationForAsString ++ "." bakerConfigureCmd :: Mod CommandFields BakerCmd bakerConfigureCmd = @@ -1728,18 +1747,18 @@ bakerConfigureCmd = <$> transactionOptsParser <*> optional (option (eitherReader amountFromStringInform) (long "stake" <> metavar "CCD-AMOUNT" <> help "The amount of CCD to stake.")) <*> optional - ( flag' True (long "restake" <> help "The earnings will be added to the baker stake automatically.") - <|> flag' False (long "no-restake" <> help "The earnings will not be added to the baker stake automatically.") + ( flag' True (long "restake" <> help "The earnings will be added to the validator stake automatically.") + <|> flag' False (long "no-restake" <> help "The earnings will not be added to the validator stake automatically.") ) <*> optional (option (eitherReader openStatusFromStringInform) (long "open-delegation-for" <> metavar "SELECTION" <> help helpOpenDelegationFor)) - <*> optional (strOption (long "baker-url" <> metavar "URL" <> help "A link to information about the baker.")) - <*> optional (option (eitherReader amountFractionFromStringInform) (long "delegation-transaction-fee-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the baker 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 baker takes in commission from delegators on baking rewards. " ++ rangesHelpString "baking reward commission"))) - <*> optional (option (eitherReader amountFractionFromStringInform) (long "delegation-finalization-commission" <> metavar "DECIMAL-FRACTION" <> help ("Fraction the baker takes in commission from delegators on finalization rewards. " ++ rangesHelpString "finalization reward commission"))) - <*> optional (strOption (long "keys-in" <> metavar "FILE" <> help "File containing baker credentials.")) - <*> optional (strOption (long "keys-out" <> metavar "FILE" <> help "File to write updated baker credentials to, in case of successful transaction. These can be used to start the node.")) + <*> 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 (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.")) ) - (progDesc "Add a new baker, remove an existing baker or update an existing baker.") + (progDesc "Add a new validator, update or remove an existing one.") ) bakerUpdateUpdateMetadataURL :: Mod CommandFields BakerCmd @@ -1748,10 +1767,10 @@ bakerUpdateUpdateMetadataURL = "update-url" ( info ( BakerUpdateMetadataURL - <$> strArgument (metavar "URL" <> help "Link to information about the baker.") + <$> strArgument (metavar "URL" <> help "Link to information about the validator.") <*> transactionOptsParser ) - (progDesc "Change link to information about the baker.") + (progDesc "Change link to information about the validator.") ) bakerUpdateOpenDelegationStatus :: Mod CommandFields BakerCmd @@ -1763,7 +1782,7 @@ bakerUpdateOpenDelegationStatus = <$> argument (eitherReader openStatusFromStringInform) (metavar "SELECTION" <> help helpOpenDelegationFor) <*> transactionOptsParser ) - (progDesc "Change whether to allow other parties to delegate stake to the baker.") + (progDesc "Change whether to allow other parties to delegate stake to the validator.") ) bakerGetEarliestWinTime :: Mod CommandFields BakerCmd @@ -1772,7 +1791,7 @@ bakerGetEarliestWinTime = "win-time" ( info ( BakerGetEarliestWinTime - <$> argument auto (metavar "BAKER-ID" <> help "Baker ID to query.") + <$> argument auto (metavar "VALIDATOR-ID" <> help "Validator ID to query.") <*> switch ( long "local-time" <> help "Display time in the local time zone (instead of UTC)." @@ -1782,7 +1801,7 @@ bakerGetEarliestWinTime = <> help "Repeatedly poll for the latest time." ) ) - (progDesc "Show the earliest time the baker may be expected to bake a block.") + (progDesc "Show the earliest time the validator may be expected to produce a block.") ) bakerSetKeysCmd :: Mod CommandFields BakerCmd @@ -1793,11 +1812,11 @@ bakerSetKeysCmd = ( BakerSetKeys <$> strArgument (metavar "FILE" <> help "File containing the new public and private keys.") <*> transactionOptsParser - <*> optional (strOption (long "out" <> metavar "FILE" <> help "File to write the baker credentials to, in case of succesful transaction. These can be used to start the node.")) + <*> optional (strOption (long "out" <> metavar "FILE" <> help "File to write the validator credentials to, in case of succesful transaction. These can be used to start the node.")) ) ( progDescDoc $ docFromLines - [ "Update the keys of a baker. Expected format of the key file:", + [ "Update the keys of a validator. Expected format of the key file:", " {", " \"signatureSignKey\": ...,", " \"signatureVerifyKey\": ...", @@ -1818,7 +1837,7 @@ bakerRemoveCmd = ( BakerRemove <$> transactionOptsParser ) - (progDesc "Remove a baker from the chain.") + (progDesc "Remove a validator from the chain.") ) bakerUpdateRestakeCmd :: Mod CommandFields BakerCmd @@ -1842,17 +1861,17 @@ bakerUpdateStakeCmd = <$> option (eitherReader amountFromStringInform) (long "stake" <> metavar "CCD-AMOUNT" <> help "The amount of CCD to stake.") <*> transactionOptsParser ) - (progDesc "Update the amount staked for the baker.") + (progDesc "Update the amount staked for the validator.") ) allowedValuesDelegationTargetAsString :: String allowedValuesDelegationTargetAsString = - "'Passive' (for passive delegation), BAKERID (delegate stake to baker pool with baker id BAKERID), ACCOUNT (delegate stake to baker with account ACCOUNT)" + "'Passive' (for passive delegation), VALIDATORID (delegate stake to a staking pool with validator id VALIDATORID), ACCOUNT (delegate stake to validator with account ACCOUNT)" helpDelegationTarget :: Mod OptionFields Text helpDelegationTarget = help $ - "Select whether to delegate stake passively or to a baker. Available values for TARGET are: " ++ allowedValuesDelegationTargetAsString ++ "." + "Select whether to delegate stake passively or to a staking pool. Available values for TARGET are: " ++ allowedValuesDelegationTargetAsString ++ "." delegatorConfigureCmd :: Mod CommandFields DelegatorCmd delegatorConfigureCmd = diff --git a/src/Concordium/Client/Output.hs b/src/Concordium/Client/Output.hs index f353b864..67251d5e 100644 --- a/src/Concordium/Client/Output.hs +++ b/src/Concordium/Client/Output.hs @@ -250,7 +250,7 @@ printAccountInfo addr a verbose showEncrypted mEncKey = do case Types.aiStakingInfo a of Types.AccountStakingNone -> tell ["Baking or delegating stake: no"] Types.AccountStakingBaker{..} -> do - let bkid = [i|Baker: \##{show . Types._bakerIdentity $ asiBakerInfo}|] + let bkid = [i|Validator: \##{show . Types._bakerIdentity $ asiBakerInfo}|] stkstr = [i| - Staked amount: #{showCcd asiStakedAmount}|] case asiPendingChange of Types.NoChange -> @@ -273,7 +273,7 @@ printAccountInfo addr a verbose showEncrypted mEncKey = do tell ["Delegating stake: yes"] let targetStr = case asiDelegationTarget of Types.DelegatePassive -> "Passive delegation" - Types.DelegateToBaker bid -> "Baker pool with ID " ++ show bid + Types.DelegateToBaker bid -> "Staking pool with ID " ++ show bid let target = [i|Delegation target: #{targetStr}|] stkstr = [i| - Staked amount: #{showCcd asiStakedAmount}|] case asiDelegationPendingChange of @@ -793,29 +793,29 @@ showEvent verbose ciM = \case verboseOrNothing $ printf "credential with registration '%s' deployed onto account '%s'" (show ecdRegId) (show ecdAccount) Types.BakerAdded{..} -> let restakeString :: String = if ebaRestakeEarnings then "Earnings are added to the stake." else "Earnings are not added to the stake." - in verboseOrNothing $ printf "baker %s added, staking %s CCD. %s" (showBaker ebaBakerId ebaAccount) (Types.amountToString ebaStake) restakeString + in verboseOrNothing $ printf "validator %s added, staking %s CCD. %s" (showBaker ebaBakerId ebaAccount) (Types.amountToString ebaStake) restakeString Types.BakerRemoved{..} -> - verboseOrNothing $ printf "baker %s, removed" (showBaker ebrBakerId ebrAccount) + verboseOrNothing $ printf "validator %s, removed" (showBaker ebrBakerId ebrAccount) Types.BakerStakeIncreased{..} -> - verboseOrNothing $ printf "baker %s stake increased to %s" (showBaker ebsiBakerId ebsiAccount) (showCcd ebsiNewStake) + verboseOrNothing $ printf "validator %s stake increased to %s" (showBaker ebsiBakerId ebsiAccount) (showCcd ebsiNewStake) Types.BakerStakeDecreased{..} -> - verboseOrNothing $ printf "baker %s stake decreased to %s" (showBaker ebsiBakerId ebsiAccount) (showCcd ebsiNewStake) + verboseOrNothing $ printf "validator %s stake decreased to %s" (showBaker ebsiBakerId ebsiAccount) (showCcd ebsiNewStake) Types.BakerSetRestakeEarnings{..} -> - verboseOrNothing $ printf "baker %s restake earnings %s" (showBaker ebsreBakerId ebsreAccount) (if ebsreRestakeEarnings then "set" :: String else "unset") + verboseOrNothing $ printf "validator %s restake earnings %s" (showBaker ebsreBakerId ebsreAccount) (if ebsreRestakeEarnings then "set" :: String else "unset") Types.BakerKeysUpdated{..} -> - verboseOrNothing $ printf "baker %s keys updated" (showBaker ebkuBakerId ebkuAccount) + verboseOrNothing $ printf "validator %s keys updated" (showBaker ebkuBakerId ebkuAccount) Types.CredentialsUpdated{..} -> verboseOrNothing $ [i|credentials on account #{cuAccount} have been updated.\nCredentials #{cuRemovedCredIds} have been removed, and credentials #{cuNewCredIds} have been added.\nThe new account threshold is #{cuNewThreshold}.|] Types.BakerSetOpenStatus{..} -> - verboseOrNothing $ printf "baker %s open status changed to %s" (showBaker ebsosBakerId ebsosAccount) (show ebsosOpenStatus) + verboseOrNothing $ printf "validator %s open status changed to %s" (showBaker ebsosBakerId ebsosAccount) (show ebsosOpenStatus) Types.BakerSetMetadataURL{..} -> - verboseOrNothing $ printf "baker %s URL changed to %s" (showBaker ebsmuBakerId ebsmuAccount) (show ebsmuMetadataURL) + verboseOrNothing $ printf "validator %s URL changed to %s" (showBaker ebsmuBakerId ebsmuAccount) (show ebsmuMetadataURL) Types.BakerSetTransactionFeeCommission{..} -> - verboseOrNothing $ printf "baker %s changed transaction fee commission to %s" (showBaker ebstfcBakerId ebstfcAccount) (show ebstfcTransactionFeeCommission) + verboseOrNothing $ printf "validator %s changed transaction fee commission to %s" (showBaker ebstfcBakerId ebstfcAccount) (show ebstfcTransactionFeeCommission) Types.BakerSetBakingRewardCommission{..} -> - verboseOrNothing $ printf "baker %s changed baking reward commission to %s" (showBaker ebsbrcBakerId ebsbrcAccount) (show ebsbrcBakingRewardCommission) + verboseOrNothing $ printf "validator %s changed baking reward commission to %s" (showBaker ebsbrcBakerId ebsbrcAccount) (show ebsbrcBakingRewardCommission) Types.BakerSetFinalizationRewardCommission{..} -> - verboseOrNothing $ printf "baker %s changed finalization reward commission to %s" (showBaker ebsfrcBakerId ebsfrcAccount) (show ebsfrcFinalizationRewardCommission) + verboseOrNothing $ printf "validator %s changed finalization reward commission to %s" (showBaker ebsfrcBakerId ebsfrcAccount) (show ebsfrcFinalizationRewardCommission) Types.DelegationStakeIncreased{..} -> verboseOrNothing $ printf "delegator %s stake increased to %s" (showDelegator edsiDelegatorId edsiAccount) (showCcd edsiNewStake) Types.DelegationStakeDecreased{..} -> @@ -880,7 +880,7 @@ showEvent verbose ciM = \case showDelegationTarget :: Types.DelegationTarget -> String showDelegationTarget Types.DelegatePassive = "Passive delegation" - showDelegationTarget (Types.DelegateToBaker bid) = "Baker ID " ++ show bid + showDelegationTarget (Types.DelegateToBaker bid) = "Validator ID " ++ show bid -- Attempt to decode a bytestring according to a schema. -- If there is no schema, or decoding fails @Nothing@ is returned. @@ -986,7 +986,7 @@ showRejectReason verbose = \case let (contractName, funcName) = Wasm.contractAndFunctionName receiveName in [i|'#{funcName}' in '#{contractName}' at #{showCompactPrettyJSON contractAddress} failed with code #{rejectReason}|] Types.InvalidProof -> - "proof that baker owns relevant private keys is not valid" + "proof that validator owns relevant private keys is not valid" Types.DuplicateAggregationKey k -> if verbose then printf "duplicate aggregation key '%s'" (show k) @@ -1010,10 +1010,10 @@ showRejectReason verbose = \case Types.FirstScheduledReleaseExpired -> "the first release has already expired" Types.ScheduledSelfTransfer acc -> printf "attempted to make an scheduled transfer to the same account '%s'" (show acc) - Types.AlreadyABaker bid -> printf "already a registered baker with ID %s" (show bid) - Types.NotABaker addr -> printf "attempt to remove a baker account %s that is not a baker" (show addr) + Types.AlreadyABaker bid -> printf "already a registered validator with ID %s" (show bid) + Types.NotABaker addr -> printf "attempt to remove a validator account %s that is not a validator" (show addr) Types.InsufficientBalanceForBakerStake -> "the balance on the account is insufficient to cover the desired stake" - Types.BakerInCooldown -> "change could not be completed because the baker is in the cooldown period" + Types.BakerInCooldown -> "change could not be completed because the validator is in the cooldown period" Types.NonExistentCredentialID -> "credential ID does not exist on the account" Types.InvalidCredentials -> "one or more of the credentials is not valid" Types.DuplicateCredIDs cids -> [i|credential registration ids #{cids} are duplicate|] @@ -1024,7 +1024,7 @@ showRejectReason verbose = \case 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 baker" + 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.TransactionFeeCommissionNotInRange -> "transaction fee commission fee was not within the allowed range" @@ -1037,7 +1037,7 @@ showRejectReason verbose = \case Types.PoolWouldBecomeOverDelegated -> "fraction of delegated capital to baking 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 baker id" (show bid) + Types.DelegationTargetNotABaker bid -> printf "delegation target %s is not a validator id" (show bid) -- CONSENSUS @@ -1153,9 +1153,9 @@ printChainParameters cp = do printChainParametersV0 :: ChainParameters' 'ChainParametersV0 -> Printer printChainParametersV0 ChainParameters{..} = tell - [ [i|\# Baker parameters |], + [ [i|\# Validator parameters |], [i| + baker extra cooldown: #{(_cpBakerExtraCooldownEpochs _cpCooldownParameters)} epochs|], - [i| + stake threshold to become a baker: #{showCcd (_ppBakerStakeThreshold _cpPoolParameters)}|], + [i| + stake threshold to become a validator: #{showCcd (_ppBakerStakeThreshold _cpPoolParameters)}|], "", [i|\# Exchange rate parameters: |], [i| + EUR per CCD rate (approx): #{printf "%.4f" (realToFrac (1000000 / _erMicroGTUPerEuro _cpExchangeRates) :: Double) :: String}|], @@ -1168,7 +1168,7 @@ printChainParametersV0 ChainParameters{..} = [i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|], [i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|], [i| + transaction fee distribution:|], - [i| * fraction for the baker: #{_cpRewardParameters ^. tfdBaker}|], + [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}|], @@ -1187,10 +1187,10 @@ printChainParametersV1 :: ChainParameters' 'ChainParametersV1 -> Printer printChainParametersV1 ChainParameters{..} = tell [ "", - [i|\# Parameters related to baker pools:|], + [i|\# Parameters related to staking pools:|], [i| + minimum equity capital: #{showCcd (_cpPoolParameters ^. ppMinimumEquityCapital)}|], [i| + maximum fraction of total stake a pool is allowed to hold: #{_cpPoolParameters ^. ppCapitalBound}|], - [i| + maximum factor a pool may stake relative to the baker's stake: #{_cpPoolParameters ^. ppLeverageBound}|], + [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))}|], @@ -1215,7 +1215,7 @@ printChainParametersV1 ChainParameters{..} = [i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|], [i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|], [i| + transaction fee distribution:|], - [i| * baker: #{_cpRewardParameters ^. tfdBaker}|], + [i| * validator: #{_cpRewardParameters ^. tfdBaker}|], [i| * GAS account: #{_cpRewardParameters ^. tfdGASAccount}|], [i| + GAS rewards:|], [i| * baking a block: #{_cpRewardParameters ^. gasBaker}|], @@ -1236,10 +1236,10 @@ printChainParametersV2 :: ChainParameters' 'ChainParametersV2 -> Printer printChainParametersV2 ChainParameters{..} = tell [ "", - [i|\# Parameters related to baker pools:|], + [i|\# Parameters related to staking pools:|], [i| + minimum equity capital: #{showCcd (_cpPoolParameters ^. ppMinimumEquityCapital)}|], [i| + maximum fraction of total stake a pool is allowed to hold: #{_cpPoolParameters ^. ppCapitalBound}|], - [i| + maximum factor a pool may stake relative to the baker's stake: #{_cpPoolParameters ^. ppLeverageBound}|], + [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))}|], @@ -1264,7 +1264,7 @@ printChainParametersV2 ChainParameters{..} = [i| * baking reward: #{_cpRewardParameters ^. mdBakingReward}|], [i| * finalization reward: #{_cpRewardParameters ^. mdFinalizationReward}|], [i| + transaction fee distribution:|], - [i| * baker: #{_cpRewardParameters ^. tfdBaker}|], + [i| * validator: #{_cpRewardParameters ^. tfdBaker}|], [i| * GAS account: #{_cpRewardParameters ^. tfdGASAccount}|], [i| + GAS rewards:|], [i| * baking a block: #{_cpRewardParameters ^. gasBaker}|], @@ -1335,7 +1335,7 @@ printBlockInfo b = printf "Height: %s" (show $ Queries.biBlockHeight b), printf "Height since last genesis: %s" (show $ Queries.biEraBlockHeight b), printf "Genesis index: %s" (show $ Queries.biGenesisIndex b), - printf "Baker: %s" (showMaybe show $ Queries.biBlockBaker b), + printf "Validator: %s" (showMaybe show $ Queries.biBlockBaker b), printf "Transaction count: %d" (Queries.biTransactionCount b), printf "Transaction energy cost: %s" (showNrg $ Queries.biTransactionEnergyCost b), printf "Transactions size: %d" (Queries.biTransactionsSize b), diff --git a/src/Concordium/Client/Runner.hs b/src/Concordium/Client/Runner.hs index e293584e..de229303 100644 --- a/src/Concordium/Client/Runner.hs +++ b/src/Concordium/Client/Runner.hs @@ -660,7 +660,7 @@ processTransactionCmd action baseCfgDir verbose backend = withClient backend $ do tx <- processTransaction source let hash = getBlockItemHash tx - logSuccess [printf "transaction '%s' sent to the baker" (show hash)] + logSuccess [printf "transaction '%s' sent to the node" (show hash)] when (ioTail intOpts) $ do tailTransaction_ verbose hash -- logSuccess [ "transaction successfully completed" ] @@ -670,7 +670,7 @@ processTransactionCmd action baseCfgDir verbose backend = withClient backend $ do tx <- processCredential source let hash = getBlockItemHash tx - logSuccess [printf "transaction '%s' sent to the baker" (show hash)] + logSuccess [printf "transaction '%s' sent to the node" (show hash)] when (ioTail intOpts) $ do tailTransaction_ verbose hash -- logSuccess [ "credential deployed successfully" ] @@ -1348,7 +1348,7 @@ getBakerStakeThresholdOrDie = do StatusInvalid -> Left "GRPC response contained an invalid status code." RequestFailed err -> Left $ "I/O error: " <> err case res of - Left err -> logFatal ["Could not retrieve the baker stake threshold: " <> err] + Left err -> logFatal ["Could not retrieve the validator stake threshold: " <> err] Right (Queries.EChainParametersAndKeys (ecpParams :: ChainParameters' cpv) _) -> return $ case Types.chainParametersVersion @cpv of Types.SChainParametersV0 -> ecpParams ^. cpPoolParameters . ppBakerStakeThreshold @@ -1460,7 +1460,7 @@ accountDecryptTransactionConfirm AccountDecryptTransactionConfig{..} confirm = d confirmed <- askConfirmation Nothing unless confirmed exitTransactionCancelled --- | Encode, sign, and send transaction off to the baker. +-- | Encode, sign, and send transaction off to the node. -- If confirmNonce is set, the user is asked to confirm using the next nonce -- if there are pending transactions. startTransaction :: @@ -1495,7 +1495,7 @@ startTransaction txCfg pl confirmNonce maybeAccKeys = do StatusInvalid -> Left "GRPC response contained an invalid status code." RequestFailed err -> Left $ "I/O error: " <> err case res of - Left err -> logFatal ["Transaction not accepted by the baker: " <> err] + Left err -> logFatal ["Transaction not accepted by the node: " <> err] Right _ -> return tx -- | Fetch next nonces relative to the account's most recently committed and @@ -1552,7 +1552,7 @@ sendAndTailTransaction :: sendAndTailTransaction verbose txCfg pl intOpts = do tx <- startTransaction txCfg pl (ioConfirm intOpts) Nothing let hash = getBlockItemHash tx - logSuccess [printf "transaction '%s' sent to the baker" (show hash)] + logSuccess [printf "transaction '%s' sent to the node" (show hash)] if ioTail intOpts then Just <$> tailTransaction verbose hash else return Nothing @@ -2810,9 +2810,9 @@ processConsensusCmd action _baseCfgDir verbose backend = StatusInvalid -> Left "GRPC response contained an invalid status code." RequestFailed err -> Left $ "I/O error: " <> err case res of - Left err -> logFatal ["Transaction not accepted by the baker: " <> err] + Left err -> logFatal ["Transaction not accepted by the node: " <> err] Right _ -> do - logSuccess [[i|Update instruction '#{hash}' sent to the baker|]] + logSuccess [[i|Update instruction '#{hash}' sent to the node|]] when (ioTail intOpts) $ tailTransaction_ verbose hash @@ -2919,11 +2919,11 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa _ -> do logWarn $ [ init - ( "To add a baker, more options are necessary. The following are missing " + ( "To add a validator, more options are necessary. The following are missing " ++ (if isNothing cbCapital then "\n--stake," else "") ++ (if isNothing cbOpenForDelegation then "\n--open-delegation-for," else "") ++ (if isNothing inputKeysFile then "\n--keys-in," else "") - ++ (if isNothing metadataURL then "\n--baker-url," else "") + ++ (if isNothing metadataURL then "\n--validator-url," else "") ++ (if isNothing cbTransactionFeeCommission then "\n--delegation-transaction-fee-commission," else "") ++ (if isNothing cbBakingRewardCommission then "\n--delegation-baking-commission," else "") ++ (if isNothing cbFinalizationRewardCommission then "\n--delegation-finalization-commission," else "") @@ -2933,13 +2933,13 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa confirmed <- askConfirmation $ Just "This transaction will most likely be rejected by the chain, do you wish to send it anyway" unless confirmed exitTransactionCancelled askUntilEqual credentials = do - pwd <- askPassword "Enter password for encryption of baker credentials (leave blank for no encryption): " + pwd <- askPassword "Enter password for encryption of validator credentials (leave blank for no encryption): " case Password.getPassword pwd of "" -> do - logInfo [printf "Empty password, not encrypting baker credentials"] + logInfo [printf "Empty password, not encrypting validator credentials"] return $ AE.encodePretty credentials _ -> do - pwd2 <- askPassword "Re-enter password for encryption of baker credentials: " + pwd2 <- askPassword "Re-enter password for encryption of validator credentials: " if pwd == pwd2 then AE.encodePretty <$> Password.encryptJSON Password.AES256 Password.PBKDF2SHA256 credentials pwd else do @@ -2976,10 +2976,10 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa logFatal ["Unexpected status."] tryPrintKeyUpdateEventToOutputFile bakerKeys Types.BakerAdded{..} = do - logInfo ["Baker with ID " ++ show ebaBakerId ++ " added."] + logInfo ["Validator with ID " ++ show ebaBakerId ++ " added."] printToOutputFileIfJust bakerKeys ebaBakerId tryPrintKeyUpdateEventToOutputFile bakerKeys Types.BakerKeysUpdated{..} = do - logInfo ["Keys for baker with ID " ++ show ebkuBakerId ++ " updated."] + logInfo ["Keys for validator with ID " ++ show ebkuBakerId ++ " updated."] printToOutputFileIfJust bakerKeys ebkuBakerId tryPrintKeyUpdateEventToOutputFile _ _ = return () @@ -3006,7 +3006,7 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa warnIfCapitalIsSmall capital = when (capital /= 0) $ do minimumBakerStake <- getBakerStakeThresholdOrDie when (capital < minimumBakerStake) $ do - logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum baker stake threshold (#{showCcd minimumBakerStake}).|]] + logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum validator stake threshold (#{showCcd minimumBakerStake}).|]] confirmed <- askConfirmation $ Just "This transaction will most likely be rejected by the chain, do you wish to send it anyway" unless confirmed exitTransactionCancelled @@ -3015,26 +3015,26 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa bcpRes <- getBlockChainParameters Best case getResponseValue bcpRes of Left (_, err) -> do - logError ["Could not get the baker cooldown period: " <> err] + logError ["Could not get the validator cooldown period: " <> err] exitTransactionCancelled Right v -> getBakerCooldown v when (capital < stakedAmount) $ do let removing = capital == 0 if removing - then logWarn ["This will remove the baker."] - else logWarn ["The new staked value appears to be lower than the amount currently staked on chain by this baker."] - let decreaseOrRemove = if removing then "Removing a baker" else "Decreasing the amount a baker is staking" - logWarn [decreaseOrRemove ++ " will lock the stake of the baker for a cooldown period before the CCD are made available."] - logWarn ["During this period it is not possible to update the baker's stake, or stop the baker."] - logWarn [[i|The current baker cooldown would last until approximately #{cooldownDate}|]] - let confirmStr = if removing then "remove the baker" else "update the baker's stake" + then logWarn ["This will remove the validator."] + else logWarn ["The new staked value appears to be lower than the amount currently staked on chain by this validator."] + let decreaseOrRemove = if removing then "Removing a validator" else "Decreasing the amount a validator is staking" + logWarn [decreaseOrRemove ++ " will lock the stake of the validator for a cooldown period before the CCD are made available."] + logWarn ["During this period it is not possible to update the validator's stake, or stop the validator."] + logWarn [[i|The current validator cooldown would last until approximately #{cooldownDate}|]] + let confirmStr = if removing then "remove the validator" else "update the validator's stake" confirmed <- askConfirmation $ Just $ "Confirm that you want to " ++ confirmStr unless confirmed exitTransactionCancelled warnIfCapitalIsBig capital amount = when ((capital * 100) > (amount * 95)) $ do logWarn ["You are attempting to stake >95% of your total CCD on this account. Staked CCD is not available for spending."] - logWarn ["Be aware that updating or stopping your baker in the future will require some amount of non-staked CCD to pay for the transactions to do so."] + logWarn ["Be aware that updating or stopping your validator in the future will require some amount of non-staked CCD to pay for the transactions to do so."] confirmed <- askConfirmation $ Just "Confirm that you wish to stake this much CCD" unless confirmed exitTransactionCancelled @@ -3051,7 +3051,7 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa Just _ -> return . Just $ bakerConfigureEnergyCostWithKeys (Types.payloadSize payload) txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "configuring baker with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), + ( [ printf "configuring validator with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ++ configureCapitalLogMsg @@ -3083,9 +3083,9 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa configureOpenForDelegationLogMsg = case cbOpenForDelegation of Nothing -> [] - Just Types.OpenForAll -> ["baker pool will be open for delegation"] - Just Types.ClosedForNew -> ["baker pool will be closed for new delegators"] - Just Types.ClosedForAll -> ["baker pool will be closed for delegators and existing delegators will be moved to passive delegation"] + Just Types.OpenForAll -> ["staking pool will be open for delegation"] + Just Types.ClosedForNew -> ["staking pool will be closed for new delegators"] + Just Types.ClosedForAll -> ["staking pool will be closed for delegators and existing delegators will be moved to passive delegation"] configureTransactionFeeCommissionLogMsg = case cbTransactionFeeCommission of @@ -3108,7 +3108,7 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa Nothing -> return (Nothing, Nothing) Just inf -> do bakerKeysMaybeEncrypted <- handleReadFile BS.readFile inf - let pwdAction = askPassword "Enter password for decrypting baker keys: " + let pwdAction = askPassword "Enter password for decrypting validator keys: " Password.decodeMaybeEncrypted pwdAction bakerKeysMaybeEncrypted >>= \case Left err -> logFatal [printf "error: %s" err] Right (keys, enc) -> do @@ -3155,13 +3155,13 @@ processBakerAddCmd baseCfgDir verbose backend txOpts abBakingStake abRestakeEarn mapM_ (tryPrintKeyUpdateEventToOutputFile bakerKeys) events where askUntilEqual credentials = do - pwd <- askPassword "Enter password for encryption of baker credentials (leave blank for no encryption): " + pwd <- askPassword "Enter password for encryption of validator credentials (leave blank for no encryption): " case Password.getPassword pwd of "" -> do - logInfo [printf "Empty password, not encrypting baker credentials"] + logInfo [printf "Empty password, not encrypting validator credentials"] return $ AE.encodePretty credentials _ -> do - pwd2 <- askPassword "Re-enter password for encryption of baker credentials: " + pwd2 <- askPassword "Re-enter password for encryption of validator credentials: " if pwd == pwd2 then AE.encodePretty <$> Password.encryptJSON Password.AES256 Password.PBKDF2SHA256 credentials pwd else do @@ -3218,14 +3218,14 @@ processBakerAddCmd baseCfgDir verbose backend txOpts abBakingStake abRestakeEarn warnIfCapitalIsSmall capital = do minimumBakerStake <- getBakerStakeThresholdOrDie when (capital < minimumBakerStake) $ do - logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum baker stake threshold (#{showCcd minimumBakerStake}).|]] + logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum validator stake threshold (#{showCcd minimumBakerStake}).|]] confirmed <- askConfirmation $ Just "This transaction will most likely be rejected by the chain, do you wish to send it anyway" unless confirmed exitTransactionCancelled warnIfCapitalIsBig capital amount = when ((capital * 100) > (amount * 95)) $ do logWarn ["You are attempting to stake >95% of your total CCD on this account. Staked CCD is not available for spending."] - logWarn ["Be aware that updating or stopping your baker in the future will require some amount of non-staked CCD to pay for the transactions to do so."] + logWarn ["Be aware that updating or stopping your validator in the future will require some amount of non-staked CCD to pay for the transactions to do so."] confirmed <- askConfirmation $ Just "Confirm that you wish to stake this much CCD" unless confirmed exitTransactionCancelled @@ -3249,7 +3249,7 @@ processBakerAddCmd baseCfgDir verbose backend txOpts abBakingStake abRestakeEarn nrgCost _ = return . Just $ bakerAddEnergyCost $ Types.payloadSize payload txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "adding baker with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), + ( [ printf "adding validator with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ++ configureCapitalLogMsg @@ -3315,13 +3315,13 @@ processBakerSetKeysCmd baseCfgDir verbose backend txOpts inputKeysFile outputKey mapM_ (tryPrintKeyUpdateEventToOutputFile bakerKeys) events where askUntilEqual credentials = do - pwd <- askPassword "Enter password for encryption of baker credentials (leave blank for no encryption): " + pwd <- askPassword "Enter password for encryption of validator credentials (leave blank for no encryption): " case Password.getPassword pwd of "" -> do - logInfo [printf "Empty password, not encrypting baker credentials"] + logInfo [printf "Empty password, not encrypting validator credentials"] return $ AE.encodePretty credentials _ -> do - pwd2 <- askPassword "Re-enter password for encryption of baker credentials: " + pwd2 <- askPassword "Re-enter password for encryption of validator credentials: " if pwd == pwd2 then AE.encodePretty <$> Password.encryptJSON Password.AES256 Password.PBKDF2SHA256 credentials pwd else do @@ -3354,7 +3354,7 @@ processBakerSetKeysCmd baseCfgDir verbose backend txOpts inputKeysFile outputKey logFatal ["Unexpected status."] tryPrintKeyUpdateEventToOutputFile bakerKeys Types.BakerKeysUpdated{..} = do - logInfo ["Keys for baker with ID " ++ show ebkuBakerId ++ " updated."] + logInfo ["Keys for validator with ID " ++ show ebkuBakerId ++ " updated."] printToOutputFileIfJust bakerKeys ebkuBakerId tryPrintKeyUpdateEventToOutputFile _ _ = return () @@ -3378,7 +3378,7 @@ processBakerSetKeysCmd baseCfgDir verbose backend txOpts inputKeysFile outputKey nrgCost _ = return . Just $ bakerSetKeysEnergyCost $ Types.payloadSize payload txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "setting new keys for baker with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), + ( [ printf "setting new keys for validator with account %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ) @@ -3393,7 +3393,7 @@ processBakerSetKeysCmd baseCfgDir verbose backend txOpts inputKeysFile outputKey readInputKeysFile baseCfg = do encSignData <- getAccountCfgFromTxOpts baseCfg txOpts bakerKeysMaybeEncrypted <- handleReadFile BS.readFile inputKeysFile - let pwdAction = askPassword "Enter password for decrypting baker keys: " + let pwdAction = askPassword "Enter password for decrypting validator keys: " Password.decodeMaybeEncrypted pwdAction bakerKeysMaybeEncrypted >>= \case Left err -> logFatal [printf "error: %s" err] Right (keys, enc) -> do @@ -3434,14 +3434,14 @@ processBakerRemoveCmd baseCfgDir verbose backend txOpts = do bcpRes <- getBlockChainParameters Best case getResponseValue bcpRes of Left (_, err) -> do - logError ["Could not get the baker cooldown period: " <> err] + logError ["Could not get the validator cooldown period: " <> err] exitTransactionCancelled Right v -> do getBakerCooldown v - logWarn ["Stopping a baker that is staking will lock the stake of the baker for a cooldown period before the CCD are made available."] - logWarn ["During this period it is not possible to update the baker's stake, or restart the baker."] - logWarn [[i|The current baker cooldown would last until approximately #{cooldownDate}|]] - confirmed <- askConfirmation $ Just "Confirm that you want to send the transaction to stop this baker" + logWarn ["Stopping a validator that is staking will lock the stake of the validator for a cooldown period before the CCD are made available."] + logWarn ["During this period it is not possible to update the validator's stake, or restart the validator."] + logWarn [[i|The current validator cooldown would last until approximately #{cooldownDate}|]] + confirmed <- askConfirmation $ Just "Confirm that you want to send the transaction to stop this validator" unless confirmed exitTransactionCancelled transactionForBakerRemove confirm = do @@ -3450,7 +3450,7 @@ processBakerRemoveCmd baseCfgDir verbose backend txOpts = do nrgCost _ = return . Just $ bakerRemoveEnergyCost $ Types.payloadSize payload txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "submitting transaction to remove baker with %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), + ( [ printf "submitting transaction to remove validator with %s" (show (naAddr $ esdAddress tcEncryptedSigningData)), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ) @@ -3501,7 +3501,7 @@ processBakerUpdateStakeBeforeP4Cmd baseCfgDir verbose backend txOpts ubsStake = warnIfCapitalIsSmall capital = do minimumBakerStake <- getBakerStakeThresholdOrDie when (capital < minimumBakerStake) $ do - logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum baker stake threshold (#{showCcd minimumBakerStake}).|]] + logWarn [[i|The staked amount (#{showCcd capital}) is lower than the minimum validator stake threshold (#{showCcd minimumBakerStake}).|]] confirmed <- askConfirmation $ Just "This transaction will most likely be rejected by the chain, do you wish to send it anyway" unless confirmed exitTransactionCancelled @@ -3510,27 +3510,27 @@ processBakerUpdateStakeBeforeP4Cmd baseCfgDir verbose backend txOpts ubsStake = bcpRes <- getBlockChainParameters Best case getResponseValue bcpRes of Left (_, err) -> do - logError ["Could not get the baker cooldown period: " <> err] + logError ["Could not get the validator cooldown period: " <> err] exitTransactionCancelled Right v -> do getBakerCooldown v if capital < stakedAmount then do - logWarn ["The new staked value appears to be lower than the amount currently staked on chain by this baker."] - logWarn ["Decreasing the amount a baker is staking will lock the stake of the baker for a cooldown period before the CCD are made available."] - logWarn ["During this period it is not possible to update the baker's stake, or stop the baker."] - logWarn [[i|The current baker cooldown would last until approximately #{cooldownDate}|]] - confirmed <- askConfirmation $ Just "Confirm that you want to update the baker's stake" + logWarn ["The new staked value appears to be lower than the amount currently staked on chain by this validator."] + logWarn ["Decreasing the amount a validator is staking will lock the stake of the validator for a cooldown period before the CCD are made available."] + logWarn ["During this period it is not possible to update the validator's stake, or stop the validator."] + logWarn [[i|The current validator cooldown would last until approximately #{cooldownDate}|]] + confirmed <- askConfirmation $ Just "Confirm that you want to update the validator's stake" unless confirmed exitTransactionCancelled else do - logInfo ["Note that decreasing the amount a baker is staking will lock the stake of the baker for a cooldown period before the CCD are made available."] - logInfo ["During this period it is not possible to update the baker's stake, or stop the baker."] - logInfo [[i|The current baker cooldown would last until approximately #{cooldownDate}|]] + logInfo ["Note that decreasing the amount a validator is staking will lock the stake of the validator for a cooldown period before the CCD are made available."] + logInfo ["During this period it is not possible to update the validator's stake, or stop the validator."] + logInfo [[i|The current validator cooldown would last until approximately #{cooldownDate}|]] warnIfCapitalIsBig capital amount = when ((capital * 100) > (amount * 95)) $ do logWarn ["You are attempting to stake >95% of your total CCD on this account. Staked CCD is not available for spending."] - logWarn ["Be aware that updating or stopping your baker in the future will require some amount of non-staked CCD to pay for the transactions to do so."] + logWarn ["Be aware that updating or stopping your validator in the future will require some amount of non-staked CCD to pay for the transactions to do so."] confirmed <- askConfirmation $ Just "Confirm that you wish to stake this much CCD" unless confirmed exitTransactionCancelled @@ -3540,7 +3540,7 @@ processBakerUpdateStakeBeforeP4Cmd baseCfgDir verbose backend txOpts ubsStake = nrgCost _ = return . Just $ bakerUpdateStakeEnergyCost $ Types.payloadSize payload txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "submitting transaction to update stake of baker to %s" (showCcd ubsStake), + ( [ printf "submitting transaction to update stake of validator to %s" (showCcd ubsStake), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ) @@ -3573,7 +3573,7 @@ processBakerUpdateRestakeCmd baseCfgDir verbose backend txOpts ubreRestakeEarnin nrgCost _ = return . Just $ bakerUpdateRestakeEnergyCost $ Types.payloadSize payload txCfg@TransactionConfig{..} <- getTransactionCfg baseCfg txOpts nrgCost logSuccess - ( [ printf "submitting transaction to change restaking switch of baker to %s" (show ubreRestakeEarnings), + ( [ printf "submitting transaction to change restaking switch of validator to %s" (show ubreRestakeEarnings), printf "allowing up to %s to be spent as transaction fee" (showNrg tcEnergy) ] ) @@ -3598,8 +3598,8 @@ processBakerUpdateStakeCmd baseCfgDir verbose backend txOpts newStake = do ok <- if newStake == 0 then do - logWarn ["Updating stake to 0 will remove baker", "it is possible to add the baker back with a 'baker add' transaction"] - askConfirmation $ Just "confirm that you want to remove baker" + logWarn ["Updating stake to 0 will remove validator", "it is possible to add the validator back with a 'validator add' transaction"] + askConfirmation $ Just "confirm that you want to remove validator" else return True when ok $ processBakerConfigureCmd baseCfgDir verbose backend txOpts False (Just newStake) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing @@ -3611,13 +3611,13 @@ processBakerCmd action baseCfgDir verbose backend = BakerGenerateKeys outputFile maybeBakerId -> do keys <- generateBakerKeys maybeBakerId let askUntilEqual = do - pwd <- askPassword "Enter password for encryption of baker keys (leave blank for no encryption): " + pwd <- askPassword "Enter password for encryption of validator keys (leave blank for no encryption): " case Password.getPassword pwd of "" -> do - logInfo [printf "Empty password, not encrypting baker keys"] + logInfo [printf "Empty password, not encrypting validator keys"] return $ AE.encodePretty keys _ -> do - pwd2 <- askPassword "Re-enter password for encryption of baker keys: " + pwd2 <- askPassword "Re-enter password for encryption of validator keys: " if pwd == pwd2 then AE.encodePretty <$> Password.encryptJSON Password.AES256 Password.PBKDF2SHA256 keys pwd else do @@ -3629,7 +3629,7 @@ processBakerCmd action baseCfgDir verbose backend = Nothing -> do -- TODO Store in config. BSL8.putStrLn out - logInfo [printf "to add a baker to the chain using these keys, store it in a file and use 'concordium-client baker add FILE'"] + logInfo [printf "to add a validator to the chain using these keys, store it in a file and use 'concordium-client validator add FILE'"] Just f -> do keysSuccess <- handleWriteFile BSL.writeFile PromptBeforeOverwrite verbose f out when keysSuccess $ do @@ -3637,7 +3637,7 @@ processBakerCmd action baseCfgDir verbose backend = logSuccess [ printf "keys written to file '%s'" f, "DO NOT LOSE THIS FILE", - printf "to add a baker to the chain using these keys, use 'concordium-client baker add %s'" f + printf "to add a validator to the chain using these keys, use 'concordium-client validator add %s'" f ] pubSuccess <- handleWriteFile BSL.writeFile PromptBeforeOverwrite verbose pubFile publicBakerKeysJSON when pubSuccess $ do @@ -3651,9 +3651,9 @@ processBakerCmd action baseCfgDir verbose backend = else do when (isNothing extraData) $ do logWarn $ - [ "To add a baker, all of the options\n" + [ "To add a validator, all of the options\n" ++ "--open-delegation-for,\n" - ++ "--baker-url,\n" + ++ "--validator-url,\n" ++ "--delegation-transaction-fee-commission,\n" ++ "--delegation-baking-commission,\n" ++ "--delegation-finalization-commission\nmust be present" @@ -3702,7 +3702,7 @@ processBakerCmd action baseCfgDir verbose backend = processBakerConfigureCmd baseCfgDir verbose backend txOpts False Nothing Nothing (Just status) Nothing Nothing Nothing Nothing Nothing Nothing BakerGetEarliestWinTime bakerId useLocalTime doPoll -> do winTimestamp <- getWinTimestamp - putStrLn [i|Baker #{bakerId} is expected to bake no sooner than:|] + putStrLn [i|Validator #{bakerId} is expected to produce a block no sooner than:|] if doPoll then polling 0 (0 :: Int) winTimestamp else void $ displayTime 0 winTimestamp putStrLn "" where @@ -3879,7 +3879,7 @@ processDelegatorConfigureCmd baseCfgDir verbose backend txOpts cdCapital cdResta case cdDelegationTarget of Nothing -> [] Just Types.DelegatePassive -> ["stake will be delegated passively"] - Just (Types.DelegateToBaker bid) -> [printf "stake will be delegated to baker %s" (show bid)] + Just (Types.DelegateToBaker bid) -> [printf "stake will be delegated to validator %s" (show bid)] -- | Process a 'delegator ...' command. processDelegatorCmd :: DelegatorCmd -> Maybe FilePath -> Verbose -> Backend -> IO () @@ -3908,7 +3908,7 @@ processDelegatorCmd action baseCfgDir verbose backend = in if n >= 0 && n <= fromIntegral (maxBound :: Word64) then return $ Just $ Types.DelegateToBaker $ Types.BakerId $ Types.AccountIndex w else do - logWarn $ ["The BAKERID '" ++ s ++ "'" ++ " is out of range."] + logWarn $ ["The VALIDATORID '" ++ s ++ "'" ++ " is out of range."] exitTransactionCancelled s -> do logWarn $ ["Unexpected delegation target '" ++ s ++ "'. The allowed values are: " ++ COM.allowedValuesDelegationTargetAsString] @@ -3948,7 +3948,7 @@ processLegacyCmd action backend = source <- handleReadFile BSL.readFile fname t <- withClient backend $ processTransaction source putStrLn $ - "Transaction sent to the baker. Its hash is " + "Transaction sent to the node. Its hash is " ++ show (getBlockItemHash t) GetConsensusInfo -> withClient backend $