-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Inconsistent setting of genesis supply #9372
Comments
I have a feeling this is going to be an SDK issue too. @shahankhatch if that is true, can you please move it to the SDK repo issues? |
I was not able to replicate this as a gaia error (I did however encounter scenarios which would result in an error, see below). Please check the following steps; if it doesn't match your scenario, please provide steps and a copy of the error. Here's what I did:
Two times that the testnet node gave errors is when I mixed the binary and the testnet configuration:
|
This is a bug in the SDK (regression as well). Using cosmos/gaia#834, I ran the same command and you can see the supply is empty in the genesis file. But as you say, cosmos/gaia#834 binary works fine and the older binary catches the error. This indicates that the SDK is not checking supply is valid when the supply is nil (despite coins from existing in bank) The reason you cannot replicate the error above is because the gaiad manager also runs I believe 834 against main testnet directory is due to an address migration issue and isn't a bug |
Thanks for the clear explanation @colin-axner. I agree with your point about inconsistent behaviour. Moving this issue to the sdk. |
looks like func initGenFiles(
clientCtx client.Context, mbm module.BasicManager, chainID string,
genAccounts []authtypes.GenesisAccount, genBalances []banktypes.Balance,
genFiles []string, numValidators int,
) error {
// --snip--
+ bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances)
+ for _, bal := range bankGenState.Balances {
+ bankGenState.Supply.Add(bal.Coins...)
+ }
// --snip-- I'll update this in the SDK. |
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: #9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: #9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit 179c819) # Conflicts: # simapp/simd/cmd/testnet.go
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: #9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit 179c819) # Conflicts: # simapp/simd/cmd/testnet.go
* fix: testnet cli command update genesis supply (#9497) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: #9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit 179c819) # Conflicts: # simapp/simd/cmd/testnet.go * fix errors * changelog entry Co-authored-by: Tyler <[email protected]> Co-authored-by: technicallyty <[email protected]>
* CLI: `query ibc-transfer escrow-address` (cosmos#9383) * Fix the liveliness test Docker error (cosmos#9396) (cosmos#9402) (cherry picked from commit 44a4138) Co-authored-by: Riccardo Montagnin <[email protected]> * docs: fix broken interfaces links (backport cosmos#9448) (cosmos#9478) * fix interfaces links (cosmos#9448) Co-authored-by: ryanchrypto <[email protected]> Co-authored-by: Amaury <[email protected]> (cherry picked from commit 37fc37d) # Conflicts: # docs/building-modules/messages-and-queries.md # docs/building-modules/module-interfaces.md # docs/building-modules/module-manager.md # docs/building-modules/query-services.md * resolve merge conflicts * revert rename codec Co-authored-by: Ryan Christoffersen <[email protected]> Co-authored-by: ryanchrypto <[email protected]> * backport: fix ibc genesis export bug (cosmos#9401) * correctly set next identifier sequence in genesis export for clients/connections/channels * add changelog * fix linting (cosmos#9531) * fix: testnet cli command update genesis supply (backport cosmos#9497) (cosmos#9513) * fix: testnet cli command update genesis supply (cosmos#9497) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: cosmos#9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. * feat: add header hash to `Context` (backport cosmos#9390) (cosmos#9395) * feat: add header hash to `Context` (cosmos#9390) * baseapp, types: add header hash to * changelog (cherry picked from commit 151d6c5) # Conflicts: # CHANGELOG.md * Fix conflicts Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Amaury M <[email protected]> * fix: x/gov deposits querier (Initial Deposit) (backport cosmos#9288) (cosmos#9453) * fix: x/gov deposits querier (Initial Deposit) (cosmos#9288) * copied from old PR * fix errors * add test * Update x/gov/client/utils/query.go Co-authored-by: Robert Zaremba <[email protected]> * fix tests * fix failing test * add test * update test * fix tests * fix deposit query * fix test * update tests * add more tests * address lint error * address lint error * review changes Co-authored-by: Robert Zaremba <[email protected]> (cherry picked from commit 66ee994) # Conflicts: # CHANGELOG.md # x/gov/client/cli/query.go # x/gov/client/testutil/cli_test.go # x/gov/client/utils/query.go * resolve conflicts Co-authored-by: MD Aleem <[email protected]> Co-authored-by: aleem1314 <[email protected]> * feat: add `RefundGas` function to `GasMeter` (backport cosmos#9403) (cosmos#9444) * feat: add `RefundGas` function to `GasMeter` (cosmos#9403) * feat: add RefundGas function to GasMeter * changelog * add comment about use case * Apply suggestions from code review Co-authored-by: Alessio Treglia <[email protected]> Co-authored-by: Amaury <[email protected]> (cherry picked from commit 90edeb6) # Conflicts: # CHANGELOG.md * conflicts * fix * Update CHANGELOG.md Co-authored-by: Amaury <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Amaury <[email protected]> * fix: Bank module init genesis optimization (backport cosmos#9428) (cosmos#9440) * fix: Bank module init genesis optimization (cosmos#9428) * optimize the bank module genesis initialization * remove k.setBalances & k.clearBalances and update changelog * fix lint Co-authored-by: Aaron Craelius <[email protected]> (cherry picked from commit 2ae7875) # Conflicts: # CHANGELOG.md # x/bank/keeper/genesis.go # x/bank/keeper/send.go * fix conflicts * Update CHANGELOG.md Co-authored-by: yys <[email protected]> Co-authored-by: Amaury M <[email protected]> * fix: update simapp to use correct default broadcast mode (backport cosmos#9408) (cosmos#9527) * fix: update simapp to use correct default broadcast mode (cosmos#9408) (cherry picked from commit 80330ec) * Add changelog Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Amaury M <[email protected]> * Backport: IBC query header/node-state fixes (cosmos#9385) * fix ibc query header/node-state cmds * changelog Co-authored-by: Amaury M <[email protected]> * build(deps): tendermint version (backport cosmos#9541) (cosmos#9542) * build(deps): tendermint version (cosmos#9541) * bump tendermint version * go mod tidy (cherry picked from commit e4673ad) * add changelog entry * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Marko <[email protected]> Co-authored-by: Amaury <[email protected]> * feat: add cosmos-sdk Version (backport cosmos#9429) (cosmos#9543) * feat: add cosmos-sdk Version (cosmos#9429) <!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description Add CosmosSDKVersion to nodeInfo. closes: cosmos#9420 (cherry picked from commit 105ad99) # Conflicts: # CHANGELOG.md # CONTRIBUTING.md # docs/core/proto-docs.md * resolve conflicts * resolve conflicts Co-authored-by: Marko <[email protected]> * fix: set header hash every block (backport cosmos#9552) (cosmos#9555) * fix: set header hash every block (cosmos#9552) ## Description - Sets the header hash on every block (ref cosmos#9390). Previously was only set during initialization for `deliverState`. - Closes cosmos#9514 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> * chore: Update release notes and Changelog for 0.42.6 (cosmos#9544) * Update release notes * Clean up changelog Co-authored-by: Ethan Buchman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Riccardo Montagnin <[email protected]> Co-authored-by: Ryan Christoffersen <[email protected]> Co-authored-by: ryanchrypto <[email protected]> Co-authored-by: colin axnér <[email protected]> Co-authored-by: Marko <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Amaury M <[email protected]> Co-authored-by: MD Aleem <[email protected]> Co-authored-by: aleem1314 <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: yys <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]>
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description closes: cosmos#9372 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> ### This PR makes the `testnet` command update the bank genesis supply. When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
Summary of Bug
The testnet command creates a staking token and a token corresponding to the directory name, but it doesn't update the genesis total supply. Previous versions of the SDK didn't do total supply validation of the value in the genesis file. Since the newer versions do, using this command doesn't function properly as the genesis generated is invalid
Version
master branch
Steps to Reproduce
Use the branch for cosmos/gaia#834 to generate a testnet and attempt to start the chain
For Admin Use
The text was updated successfully, but these errors were encountered: