-
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
feat: Add server implementation of Group module #10570
Conversation
…khita/group-server-implementation
…khita/group-server-implementation
…khita/group-server-implementation
…khita/group-server-implementation
…khita/group-server-implementation
Codecov Report
@@ Coverage Diff @@
## master #10570 +/- ##
==========================================
+ Coverage 65.03% 65.40% +0.37%
==========================================
Files 612 634 +22
Lines 57798 60651 +2853
==========================================
+ Hits 37590 39670 +2080
- Misses 18101 18681 +580
- Partials 2107 2300 +193
|
…khita/group-server-implementation
…os/cosmos-sdk into likhita/group-server-implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I looked more closely into these parts:
- Exec() server impl
- proto defs
up @anilcse @robert-zaremba @aaronc could you have a look so we can move forward with this PR please? It's blocking some follow-up group module PRs. Thanks. |
x/group/keeper/msg_server.go
Outdated
} | ||
|
||
accountDerivationKey = buf.Bytes() | ||
accountAddr = address.Module(group.ModuleName, accountDerivationKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we 100% sure we won't have any other account type in the group module? If there will be other one (eg other type of groups, or some helper accounts), then we should use derivation:
parentAcc := address.Module(group.ModuleName, groupTablePrefix)
groupAddr := address.Derive(parentAcc, bytes_id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was hesitating on that but I think it's probably safest to use derivation indeed.
But I don't get why we would use groupTablePrefix
here, maybe groupAccountTablePrefix
would be more appropriate in this particular case of group account address creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robert-zaremba it's now using derivation, lmk what you think
} | ||
|
||
acc := k.accKeeper.NewAccount(ctx, &authtypes.ModuleAccount{ | ||
BaseAccount: &authtypes.BaseAccount{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a BaseAccount
for groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would we use instead? It's a ModuleAccount
btw, not just a BaseAccount
After thinking more about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I agree with @robert-zaremba on replacing group-ids
A group is just an aggregation of accounts with associated weights, it doesn't have any decision or execution power without a decision policy, while a group with a decision policy = a group account does and has an address.
|
I partially worked on this PR so I can't really review it
@robert-zaremba I'll put automerge on so we can move forward with this and unblock the rest of the group PRs. Please create a separate issue if there's anything that you'd like to be addressed in a follow-up PR. |
If we look at the go.sum file here, this brings the trouble that left us in v0.44.5 back in. |
I might have been reacting to nothing? Or maybe not? https://go.dev/ref/mod#minimal-version-selection via @marbar3778 |
<!-- 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#9897 Closes: cosmos#9905 Adds server implementation of Group module and wires it up in simapp --- ### 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 - [ ] 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) - [x] 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` - [x] 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)
Description
Closes: #9897
Closes: #9905
Adds server implementation of Group module and wires it up in simapp
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change