Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow custom message types in Genesis Transactions #12833

Closed
robert-zaremba opened this issue Aug 5, 2022 · 5 comments · Fixed by #12956
Closed

Allow custom message types in Genesis Transactions #12833

robert-zaremba opened this issue Aug 5, 2022 · 5 comments · Fixed by #12956
Labels
C:x/genutil genutil module issues

Comments

@robert-zaremba
Copy link
Collaborator

Problem Definition

Cosmos SDK v0.46 introduced Genesis Txs check in genutil/CollectTx: https://github.com/cosmos/cosmos-sdk/pull/11500/files#diff-2229579c6bd4f3a72250a8aff043a3a0580097d284535719d08b0ea1bbfcbab5R114

This check was previously performed only in ValidateGenesis - called through app validate-genesis CLI.
Adding it to collect-gentxs breaks some application flow which required other transactions to be included in genesis. Notably, Gravity Bridge requires orchestrator and ethereum contract registration.

  1. Is there any reason we have that limitation in genutil/ValidateGenesis?
  2. Why we allow only one message / transaction?
  3. Is it safe to remove that limitation or can we customize it (eg by

Proposal

Allow more Msg types in Genesis Tranactions by adding a new parameter to Genutil ModuleBasic: list of Msg types that we accept in genesis transactions

@robert-zaremba robert-zaremba added the C:x/genutil genutil module issues label Aug 5, 2022
@alexanderbez
Copy link
Contributor

Because validation is typically a good thing. Write your own gentx CLI command.

@robert-zaremba
Copy link
Collaborator Author

I'm all for validation. However, I don't understand why we have such a limit without providing an easy / natural way to customize it.
By default, technically we could even allow a transaction with many MsgCreateValidator messages.

Moreover, writing custom CLI is not sufficient. One would need to overwrite the ValidateGenesis function form the ModuleBasic.
Instead, I think it's better to customize it: allow module basic to have a parameter which will define valid messages.

@alexanderbez
Copy link
Contributor

alexanderbez commented Aug 8, 2022

gentx is not a one-size-fits-all CLI command. It served the basic use case for the Hub when it launched. Write your own :)

@robert-zaremba
Copy link
Collaborator Author

What's wrong with adding a parameter? It can be nicely done on Module Basic level. It will be less work for anyone who needs that, rather than cloning SDK or copying few file.

@alexanderbez
Copy link
Contributor

You can do that too, but again, gentx was never meant to be app agnostic, for the same reason genesis account CLI command is app specific.

@mergify mergify bot closed this as completed in #12956 Aug 23, 2022
mergify bot pushed a commit that referenced this issue Aug 23, 2022
## Description

Closes: #12833



---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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
- [ ] 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)
robert-zaremba added a commit to umee-network/cosmos-sdk that referenced this issue Oct 6, 2022
Closes: cosmos#12833

---

*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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

*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)
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this issue May 22, 2023
## Description

Closes: cosmos#12833



---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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
- [ ] 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/genutil genutil module issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants