diff --git a/ChangeLog.md b/ChangeLog.md index cc9954cd..313d6067 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,8 @@ ## Unreleased +## 6.2.0 + - 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. diff --git a/concordium-client.cabal b/concordium-client.cabal index ca88bf7e..e30e7545 100644 --- a/concordium-client.cabal +++ b/concordium-client.cabal @@ -5,7 +5,7 @@ cabal-version: 1.24 -- see: https://github.com/sol/hpack name: concordium-client -version: 6.1.1 +version: 6.2.0 description: Please see the README on GitHub at homepage: https://github.com/Concordium/concordium-client#readme bug-reports: https://github.com/Concordium/concordium-client/issues diff --git a/package.yaml b/package.yaml index 56585733..14be6266 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: concordium-client -version: 6.1.1 +version: 6.2.0 github: "Concordium/concordium-client" author: "Concordium" maintainer: "developers@concordium.com" diff --git a/src/Concordium/Client/Cli.hs b/src/Concordium/Client/Cli.hs index ad8ef139..34606541 100644 --- a/src/Concordium/Client/Cli.hs +++ b/src/Concordium/Client/Cli.hs @@ -269,7 +269,7 @@ data BakerCredentials = BakerCredentials } instance AE.ToJSON BakerCredentials where - toJSON BakerCredentials{..} = object (("bakerId" .= bcIdentity) : bakerKeysToPairs bcKeys) + toJSON BakerCredentials{..} = object (("bakerId" .= bcIdentity) : ("validatorId" .= bcIdentity) : bakerKeysToPairs bcKeys) instance AE.FromJSON BakerKeys where parseJSON = withObject "Baker keys" $ \v -> do @@ -279,7 +279,15 @@ instance AE.FromJSON BakerKeys where bkElectionVerifyKey <- v .: "electionVerifyKey" bkSigSignKey <- v .: "signatureSignKey" bkSigVerifyKey <- v .: "signatureVerifyKey" - bkBakerId <- v .:? "bakerId" + mbkBakerId <- v .:? "bakerId" + mvalidatorId <- v .:? "validatorId" + bkBakerId <- case (mbkBakerId, mvalidatorId) of + (Just bid, Just vid) + | bid == vid -> return (Just bid) + | otherwise -> fail "Both 'bakerId' and 'validatorId' are present, and different." + (Just bid, Nothing) -> return (Just bid) + (Nothing, Just vid) -> return (Just vid) + (Nothing, Nothing) -> return Nothing return BakerKeys{..} bakerKeysToPairs :: BakerKeys -> [Pair] @@ -291,7 +299,7 @@ bakerKeysToPairs v = "signatureSignKey" .= bkSigSignKey v, "signatureVerifyKey" .= bkSigVerifyKey v ] - ++ ["bakerId" .= bid | bid <- maybeToList (bkBakerId v)] + ++ concat [["bakerId" .= bid, "validatorId" .= bid] | bid <- maybeToList (bkBakerId v)] instance AE.ToJSON BakerKeys where toJSON = object . bakerKeysToPairs @@ -303,7 +311,7 @@ bakerPublicKeysToPairs v = "electionVerifyKey" .= bkElectionVerifyKey v, "signatureVerifyKey" .= bkSigVerifyKey v ] - ++ ["bakerId" .= bid | bid <- maybeToList (bkBakerId v)] + ++ concat [["bakerId" .= bid, "validatorId" .= bid] | bid <- maybeToList (bkBakerId v)] -- | Hardcoded network ID. defaultNetId :: Int diff --git a/src/Concordium/Client/Runner.hs b/src/Concordium/Client/Runner.hs index 7c8b27ad..455fb51a 100644 --- a/src/Concordium/Client/Runner.hs +++ b/src/Concordium/Client/Runner.hs @@ -2981,9 +2981,9 @@ processBakerConfigureCmd baseCfgDir verbose backend txOpts isBakerConfigure cbCa in unless encrypted $ case inputKeysFile of Nothing -> - logInfo [printf "To use it add \"bakerId\": %s to the keys file." (show bakerId)] + logInfo [printf "To use it add \"validatorId\": %s to the keys file." (show bakerId)] Just inf -> - logInfo [printf "To use it add \"bakerId\": %s to the keys file %s." (show bakerId) inf] + logInfo [printf "To use it add \"validatorId\": %s to the keys file %s." (show bakerId) inf] eventsFromTransactionResult Nothing = return [] eventsFromTransactionResult (Just result) = do @@ -3201,7 +3201,7 @@ processBakerAddCmd baseCfgDir verbose backend txOpts abBakingStake abRestakeEarn _ -> let encrypted = snd bakerKeys in unless encrypted $ - logInfo [printf "To use it add \"bakerId\": %s to the keys file %s." (show bakerId) inputKeysFile] + logInfo [printf "To use it add \"validatorId\": %s to the keys file %s." (show bakerId) inputKeysFile] eventsFromTransactionResult Nothing = return [] eventsFromTransactionResult (Just result) = do @@ -3361,7 +3361,7 @@ processBakerSetKeysCmd baseCfgDir verbose backend txOpts inputKeysFile outputKey _ -> let encrypted = snd bakerKeys in unless encrypted $ - logInfo [printf "To use it add \"bakerId\": %s to the keys file %s." (show bakerId) inputKeysFile] + logInfo [printf "To use it add \"validatorId\": %s to the keys file %s." (show bakerId) inputKeysFile] eventsFromTransactionResult Nothing = return [] eventsFromTransactionResult (Just result) = do