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

refactor!: Refactor CommunityPoolSpendProposal #12852

Merged
merged 15 commits into from
Aug 22, 2022

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Aug 8, 2022

Description

This PR introduces the ability for v1 x/gov to execute a message that directly spends tokens from the community pool opposed to having to execute the legacy CommunityPoolSpendProposal proposal.

This provides the ability for governance to spend tokens from the community pool, either to itself (x/gov module account) or to another account.

Changelog

  • Deprecate CommunityPoolSpendProposal
  • Create MsgCommunityPoolSpend with x/gov as the authority (by default)
  • Remove x/gov from SimApps's x/bank deny list (so it can directly received funds)

ref: #12831 (comment)
closes: #12098

cc @hxrts @nooomski


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 in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • 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 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)

@github-actions github-actions bot added C:CLI C:Simulations C:x/distribution distribution module related labels Aug 8, 2022
@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #12852 (4e5681a) into main (4fe7797) will decrease coverage by 0.17%.
The diff coverage is 61.44%.

❗ Current head 4e5681a differs from pull request most recent head e50e7c0. Consider uploading reports for the commit e50e7c0 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12852      +/-   ##
==========================================
- Coverage   55.87%   55.70%   -0.18%     
==========================================
  Files         646      648       +2     
  Lines       54895    54940      +45     
==========================================
- Hits        30675    30606      -69     
- Misses      21762    21863     +101     
- Partials     2458     2471      +13     
Impacted Files Coverage Δ
baseapp/abci.go 64.09% <0.00%> (-0.33%) ⬇️
client/flags/flags.go 19.35% <0.00%> (-0.32%) ⬇️
client/rpc/status.go 66.66% <ø> (ø)
client/utils.go 34.92% <0.00%> (ø)
server/rosetta/client_online.go 1.35% <0.00%> (ø)
server/swagger.go 0.00% <0.00%> (ø)
simapp/app.go 82.66% <0.00%> (+3.55%) ⬆️
testutil/list.go 0.00% <0.00%> (ø)
types/result.go 76.74% <ø> (ø)
x/auth/tx/query.go 0.00% <ø> (ø)
... and 62 more

@alexanderbez alexanderbez marked this pull request as ready for review August 8, 2022 16:39
@alexanderbez alexanderbez requested a review from a team as a code owner August 8, 2022 16:39
Copy link
Member

@facundomedica facundomedica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (just missing changelog entry)

@@ -166,3 +166,37 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam

return &types.MsgUpdateParamsResponse{}, nil
}

func (k msgServer) CommunityPoolSpend(goCtx context.Context, req *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should bump consensus version here (if it wasn't done already since 0.46)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to bump consensus versions even when no state changed, correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes when a module introduces a consensus-breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 2 on v0.46 and thus should be 3 here. Not sure why it got changed to 4.

proto/cosmos/distribution/v1beta1/tx.proto Show resolved Hide resolved
@alexanderbez
Copy link
Contributor Author

@hxrts @nooomski would you folks mind taking a look at the high-level approach here and if you think it would suite the needs you're looking to solve re gov and community pool?

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the technical side. Would still like approval on gov people on the UX side

@alexanderbez
Copy link
Contributor Author

I received approval from @hxrts and @nooomski. So will resolve conflicts and merge.

@alexanderbez alexanderbez merged commit 9cec22d into main Aug 22, 2022
@alexanderbez alexanderbez deleted the bez/12098-community-pool-spend-refactor branch August 22, 2022 20:09
minttypes.ModuleName,
stakingtypes.BondedPoolName,
stakingtypes.NotBondedPoolName,
govtypes.ModuleName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious about this line, why is it blocked while it is commented below that it isn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops!

good catch

#13003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gov module can spend from community pool
4 participants