diff --git a/CHANGELOG.md b/CHANGELOG.md index 32214288919c..764d481f887a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ BREAKING CHANGES * `cosmosvaladdr` / `cosmosvalpub` => `cosmosvaloper` / `cosmosvaloperpub` * [x/stake] [#1013] TendermintUpdates now uses transient store * [x/stake] [\#2435](https://github.com/cosmos/cosmos-sdk/issues/2435) Remove empty bytes from the ValidatorPowerRank store key - * [x/gov] [#2195] Governance uses BFT Time + * [x/gov] [\#2195](https://github.com/cosmos/cosmos-sdk/issues/2195) Governance uses BFT Time * [x/gov] [\#2256](https://github.com/cosmos/cosmos-sdk/issues/2256) Removed slashing for governance non-voting validators * [simulation] [\#2162](https://github.com/cosmos/cosmos-sdk/issues/2162) Added back correct supply invariants * [x/slashing] [\#2430](https://github.com/cosmos/cosmos-sdk/issues/2430) Simulate more slashes, check if validator is jailed before jailing @@ -138,7 +138,7 @@ FEATURES * Gaia CLI (`gaiacli`) * [cli] Cmds to query staking pool and params - * [gov][cli] #2062 added `--proposal` flag to `submit-proposal` that allows a JSON file containing a proposal to be passed in + * [gov][cli] [\#2062](https://github.com/cosmos/cosmos-sdk/issues/2062) added `--proposal` flag to `submit-proposal` that allows a JSON file containing a proposal to be passed in * [\#2040](https://github.com/cosmos/cosmos-sdk/issues/2040) Add `--bech` to `gaiacli keys show` and respective REST endpoint to provide desired Bech32 prefix encoding * [cli] [\#2047](https://github.com/cosmos/cosmos-sdk/issues/2047) [\#2306](https://github.com/cosmos/cosmos-sdk/pull/2306) Passing --gas=simulate triggers a simulation of the tx before the actual execution. @@ -156,8 +156,8 @@ FEATURES * [cli][\#2554](https://github.com/cosmos/cosmos-sdk/issues/2554) Make `gaiacli keys show` multisig ready. * Gaia - * [cli] #2170 added ability to show the node's address via `gaiad tendermint show-address` - * [simulation] #2313 Reworked `make test_sim_gaia_slow` to `make test_sim_gaia_full`, now simulates from multiple starting seeds in parallel + * [cli] [\#2170](https://github.com/cosmos/cosmos-sdk/issues/2170) added ability to show the node's address via `gaiad tendermint show-address` + * [simulation] [\#2313](https://github.com/cosmos/cosmos-sdk/issues/2313) Reworked `make test_sim_gaia_slow` to `make test_sim_gaia_full`, now simulates from multiple starting seeds in parallel * [cli] [\#1921] (https://github.com/cosmos/cosmos-sdk/issues/1921) * New configuration file `gaiad.toml` is now created to host Gaia-specific configuration. * New --minimum_fees/minimum_fees flag/config option to set a minimum fee. @@ -184,8 +184,8 @@ IMPROVEMENTS * [x/stake] Refactor REST utils * Gaia CLI (`gaiacli`) - * [cli] #2060 removed `--select` from `block` command - * [cli] #2128 fixed segfault when exporting directly after `gaiad init` + * [cli] [\#2060](https://github.com/cosmos/cosmos-sdk/issues/2060) removed `--select` from `block` command + * [cli] [\#2128](https://github.com/cosmos/cosmos-sdk/issues/2128) fixed segfault when exporting directly after `gaiad init` * [cli] [\#1255](https://github.com/cosmos/cosmos-sdk/issues/1255) open KeyBase in read-only mode for query-purpose CLI commands @@ -220,6 +220,7 @@ IMPROVEMENTS * [types/decimal] [\#2378](https://github.com/cosmos/cosmos-sdk/issues/2378) - Added truncate functionality to decimal * [client] [\#1184](https://github.com/cosmos/cosmos-sdk/issues/1184) Remove unused `client/tx/sign.go`. * [tools] [\#2464](https://github.com/cosmos/cosmos-sdk/issues/2464) Lock binary dependencies to a specific version + * #2573 [x/distribution] add accum invariance BUG FIXES @@ -240,8 +241,9 @@ BUG FIXES * [\#2158](https://github.com/cosmos/cosmos-sdk/issues/2158) Fix non-deterministic ordering of validator iteration when slashing in `gov EndBlocker` * [simulation] [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) Make simulation stop on SIGTERM * [\#2388](https://github.com/cosmos/cosmos-sdk/issues/2388) Remove dependency on deprecated tendermint/tmlibs repository. - * [\#2416](https://github.com/cosmos/cosmos-sdk/issues/2416) Refactored - `InitializeTestLCD` to properly include proposing validator in genesis state. + * [\#2416](https://github.com/cosmos/cosmos-sdk/issues/2416) Refactored `InitializeTestLCD` to properly include proposing validator in genesis state. + * #2573 [x/distribution] accum invariance bugfix + * #2573 [x/slashing] unbonding-delegation slashing invariance bugfix ## 0.24.2 diff --git a/PENDING.md b/PENDING.md index 02d136bbce26..4453ddf8e202 100644 --- a/PENDING.md +++ b/PENDING.md @@ -51,7 +51,5 @@ BUG FIXES * Gaia * SDK - - #2573 [x/distribution] accum invariance bugfix - - #2573 [x/slashing] unbonding-delegation slashing invariance bugfix * Tendermint diff --git a/docs/sdk/clients.md b/docs/sdk/clients.md index 01deeae41700..73d9a3b9a35b 100644 --- a/docs/sdk/clients.md +++ b/docs/sdk/clients.md @@ -10,6 +10,16 @@ 🚧 We are actively working on improving documentation for Gaiacli and Gaiad. ::: +::: tip Note +If you receive this error message: + +```bash +Must specify these options: --chain-id when --trust-node is false +``` + +you must choose whether you wish to verify lite client proofs. If you trust the node which you are querying, you can simply pass `--trust-node=true` - otherwise you'll need to specify `--chain-id`. +::: + `gaiacli` is the command line interface to manage accounts and transactions on Cosmos testnets. Here is a list of useful `gaiacli` commands, including usage examples. ### Keys @@ -70,6 +80,8 @@ View the validator pubkey for your node by typing: gaiad tendermint show-validator ``` +Note that this is the Tendermint signing key, *not* the operator key you will use in delegation transactions. + ::: danger Warning We strongly recommend _NOT_ using the same passphrase for multiple keys. The Tendermint team and the Interchain Foundation will not be responsible for the loss of funds. ::: @@ -79,7 +91,7 @@ We strongly recommend _NOT_ using the same passphrase for multiple keys. The Ten You can generate and print a multisig public key by typing: ```bash -gaiacli show -m K key1 key2...keyK +gaiacli show --multisig-threshold K name1 name2 name3 [...] ``` `K` is the minimum weight, e.g. minimum number of private keys that must have signed the transactions that carry the generated public key. @@ -95,7 +107,7 @@ The best way to get tokens is from the [Cosmos Testnet Faucet](https://faucetcos After receiving tokens to your address, you can view your account's balance by typing: ```bash -gaiacli account +gaiacli query account ``` ::: warning Note @@ -111,7 +123,7 @@ The following command could be used to send coins from one account to another: gaiacli tx send \ --amount=10faucetToken \ --chain-id= \ - --name= \ + --from= \ --to= ``` @@ -128,14 +140,14 @@ Gas estimate might be inaccurate as state changes could occur in between the end Now, view the updated balances of the origin and destination accounts: ```bash -gaiacli account -gaiacli account +gaiacli query account +gaiacli query account ``` You can also check your balance at a given block by using the `--block` flag: ```bash -gaiacli account --block= +gaiacli query account --block= ``` You can simulate a transaction without actually broadcasting it by appending the `--dry-run` flag to the command line: @@ -144,7 +156,7 @@ You can simulate a transaction without actually broadcasting it by appending the gaiacli tx send \ --amount=10faucetToken \ --chain-id= \ - --name= \ + --from= \ --to= \ --dry-run ``` @@ -155,7 +167,7 @@ Furthermore, you can build a transaction and print its JSON format to STDOUT by gaiacli tx send \ --amount=10faucetToken \ --chain-id= \ - --name= \ + --from= \ --to= \ --generate-only > unsignedSendTx.json ``` @@ -165,7 +177,7 @@ You can now sign the transaction file generated through the `--generate-only` fl ```bash gaiacli tx sign \ --chain-id= \ - --name= + --from= unsignedSendTx.json > signedSendTx.json ``` @@ -206,11 +218,19 @@ On the testnet, we delegate `steak` instead of `atom`. Here's how you can bond t ```bash gaiacli tx delegate \ --amount=10steak \ - --validator=$(gaiad tendermint show-validator) \ - --name= \ + --validator= \ + --from= \ --chain-id= ``` +`` is the operator address of the validator to which you intend to delegate. If you are running a local testnet, you can find this with: + +```bash +gaiacli keys show [name] --bech val +``` + +where `[name]` is the name of the key you specified when you initialized `gaiad`. + While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool. ::: tip Note @@ -237,24 +257,17 @@ You can also get previous delegation(s) status by adding the `--height` flag. #### Unbond Tokens -If for any reason the validator misbehaves, or you just want to unbond a certain amount of tokens, use this following command. You can unbond a specific `shares-amount` (eg:`12.1`\) or a `shares-percent` (eg:`25`) with the corresponding flags. +If for any reason the validator misbehaves, or you just want to unbond a certain amount of tokens, use this following command. You can unbond a specific `shares-amount` (eg:`12.1`\) or a `shares-fraction` (eg:`0.25`) with the corresponding flags. ```bash gaiacli tx unbond begin \ --validator= \ - --shares-percent=100 \ + --shares-fraction=0.5 \ --from= \ --chain-id= ``` -Later you must complete the unbonding process by using the `gaiacli tx unbond complete` command: - -```bash -gaiacli tx unbond complete \ - --validator= \ - --from= \ - --chain-id= -``` +The unbonding will be automatically completed when the unbonding period has passed. ##### Query Unbonding-Delegations @@ -288,21 +301,14 @@ A redelegation is a type delegation that allows you to bond illiquid tokens from gaiacli tx redelegate begin \ --addr-validator-source= \ --addr-validator-dest= \ - --shares-percent=50 \ + --shares-fraction=50 \ --from= \ --chain-id= ``` -Here you can also redelegate a specific `shares-amount` or a `shares-percent` with the corresponding flags. - -Later you must complete the redelegation process by using the `gaiacli tx redelegate complete` command: +Here you can also redelegate a specific `shares-amount` or a `shares-fraction` with the corresponding flags. -```bash -gaiacli tx unbond complete \ - --validator= \ - --from= \ - --chain-id= -``` +The redelegation will be automatically completed when the unbonding period has passed. ##### Query Redelegations @@ -357,7 +363,6 @@ gaiacli tx submit-proposal \ --title= \ --description=<description> \ --type=<Text/ParameterChange/SoftwareUpgrade> \ - --proposer=<account_cosmos> \ --deposit=<40steak> \ --from=<name> \ --chain-id=<chain_id> @@ -387,7 +392,6 @@ In order for a proposal to be broadcasted to the network, the amount deposited m ```bash gaiacli tx deposit \ --proposal-id=<proposal_id> \ - --depositer=<account_cosmos> \ --deposit=<200steak> \ --from=<name> \ --chain-id=<chain_id> @@ -402,7 +406,6 @@ After a proposal's deposit reaches the `MinDeposit` value, the voting period ope ```bash gaiacli tx vote \ --proposal-id=<proposal_id> \ - --voter=<account_cosmos> \ --option=<Yes/No/NoWithVeto/Abstain> \ --from=<name> \ --chain-id=<chain_id> @@ -428,9 +431,6 @@ gaiacli query parameters With the above command you will get the values for: -- Maximum and minumum Inflation rate -- Maximum annual change in inflation rate, -- Goal of bonded tokens (%) - Unbonding time - Maximum numbers of validators - Coin denomination for staking diff --git a/docs/validators/validator-setup.md b/docs/validators/validator-setup.md index 217a0d341c10..d07697136fbd 100644 --- a/docs/validators/validator-setup.md +++ b/docs/validators/validator-setup.md @@ -32,10 +32,9 @@ Don't use more `steak` thank you have! You can always get more by using the [Fau gaiacli tx create-validator \ --amount=5steak \ --pubkey=$(gaiad tendermint show-validator) \ - --from=<account_cosmosval> --moniker="choose a moniker" \ --chain-id=<chain_id> \ - --name=<key_name> \ + --from=<key_name> \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" @@ -53,13 +52,12 @@ The `--identity` can be used as to verify identity with systems like Keybase or ```bash gaiacli tx edit-validator - --validator=<account_cosmos> --moniker="choose a moniker" \ --website="https://cosmos.network" \ - --identity=6A0D65E29A4CBC8E - --details="To infinity and beyond!" + --identity=6A0D65E29A4CBC8E \ + --details="To infinity and beyond!" \ --chain-id=<chain_id> \ - --name=<key_name> \ + --from=<key_name> \ --commission-rate="0.10" ``` @@ -83,20 +81,18 @@ gaiacli query validator <account_cosmos> In order to keep track of a validator's signatures in the past you can do so by using the `signing-info` command: ```bash -gaiacli query signing-information <validator-pubkey>\ +gaiacli query signing-info <validator-pubkey>\ --chain-id=<chain_id> ``` ### Unjail Validator -When a validator is "jailed" for downtime, you must submit an `Unjail` transaction in order to be able to get block proposer rewards again (depends on the zone fee distribution). +When a validator is "jailed" for downtime, you must submit an `Unjail` transaction from the operator account in order to be able to get block proposer rewards again (depends on the zone fee distribution). ```bash gaiacli tx unjail \ --from=<key_name> \ --chain-id=<chain_id> - --validator=<account_cosmosval> \ - --chain-id=gaia-6002 ``` ### Confirm Your Validator is Running @@ -128,7 +124,7 @@ gaiad start Wait for your full node to catch up to the latest block. Next, run the following command. Note that `<cosmos>` is the address of your validator account, and `<name>` is the name of the validator account. You can find this info by running `gaiacli keys list`. ```bash -gaiacli tx unjail <cosmos> --chain-id=<chain_id> --name=<name> +gaiacli tx unjail <cosmos> --chain-id=<chain_id> --from=<from> ``` ::: danger Warning diff --git a/x/stake/client/cli/flags.go b/x/stake/client/cli/flags.go index 29237b6ba828..e4948f945628 100644 --- a/x/stake/client/cli/flags.go +++ b/x/stake/client/cli/flags.go @@ -15,7 +15,7 @@ const ( FlagPubKey = "pubkey" FlagAmount = "amount" FlagSharesAmount = "shares-amount" - FlagSharesPercent = "shares-percent" + FlagSharesFraction = "shares-fraction" FlagMoniker = "moniker" FlagIdentity = "identity" @@ -51,7 +51,7 @@ func init() { fsPk.String(FlagPubKey, "", "Go-Amino encoded hex PubKey of the validator. For Ed25519 the go-amino prepend hex is 1624de6220") fsAmount.String(FlagAmount, "", "Amount of coins to bond") fsShares.String(FlagSharesAmount, "", "Amount of source-shares to either unbond or redelegate as a positive integer or decimal") - fsShares.String(FlagSharesPercent, "", "Percent of source-shares to either unbond or redelegate as a positive integer or decimal >0 and <=1") + fsShares.String(FlagSharesFraction, "", "Fraction of source-shares to either unbond or redelegate as a positive integer or decimal >0 and <=1") fsDescriptionCreate.String(FlagMoniker, "", "validator name") fsDescriptionCreate.String(FlagIdentity, "", "optional identity signature (ex. UPort or Keybase)") fsDescriptionCreate.String(FlagWebsite, "", "optional website") diff --git a/x/stake/client/cli/tx.go b/x/stake/client/cli/tx.go index e3f1060eeffc..c43e1276e3e7 100644 --- a/x/stake/client/cli/tx.go +++ b/x/stake/client/cli/tx.go @@ -255,9 +255,9 @@ func GetCmdBeginRedelegate(storeName string, cdc *codec.Codec) *cobra.Command { // get the shares amount sharesAmountStr := viper.GetString(FlagSharesAmount) - sharesPercentStr := viper.GetString(FlagSharesPercent) + sharesFractionStr := viper.GetString(FlagSharesFraction) sharesAmount, err := getShares( - storeName, cdc, sharesAmountStr, sharesPercentStr, + storeName, cdc, sharesAmountStr, sharesFractionStr, delAddr, valSrcAddr, ) if err != nil { @@ -318,9 +318,9 @@ func GetCmdBeginUnbonding(storeName string, cdc *codec.Codec) *cobra.Command { // get the shares amount sharesAmountStr := viper.GetString(FlagSharesAmount) - sharesPercentStr := viper.GetString(FlagSharesPercent) + sharesFractionStr := viper.GetString(FlagSharesFraction) sharesAmount, err := getShares( - storeName, cdc, sharesAmountStr, sharesPercentStr, + storeName, cdc, sharesAmountStr, sharesFractionStr, delAddr, valAddr, ) if err != nil {