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

Rejected proposal deposits shouldn't be burned #4114

Closed
4 tasks
fedekunze opened this issue Apr 15, 2019 · 3 comments
Closed
4 tasks

Rejected proposal deposits shouldn't be burned #4114

fedekunze opened this issue Apr 15, 2019 · 3 comments
Labels
C:x/gov S:blocked Status: Blocked

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Apr 15, 2019

Summary of Bug

The DeleteDeposit should be renamed and the funds from rejected proposals should go to the community pool.

Quoting the whitepaper:

If more than half of the voters choose to take the deposit (e.g. because the proposal was spam), the deposit goes to the reserve pool, except any atoms which are burned.

Steps to Reproduce

See line 448:

cosmos-sdk/x/gov/keeper.go

Lines 438 to 455 in 21e0d3c

// Deletes all the deposits on a specific proposal without refunding them
func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID uint64) {
store := ctx.KVStore(keeper.storeKey)
depositsIterator := keeper.GetDeposits(ctx, proposalID)
defer depositsIterator.Close()
for ; depositsIterator.Valid(); depositsIterator.Next() {
deposit := &Deposit{}
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(depositsIterator.Value(), deposit)
// TODO: Find a way to do this without using accounts.
err := keeper.ck.SendCoins(ctx, DepositedCoinsAccAddr, BurnedDepositCoinsAccAddr, deposit.Amount)
if err != nil {
panic("should not happen")
}
store.Delete(depositsIterator.Key())
}
}

cc: @alessio @sunnya97


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Acceptance Criteria

AC1

Given a governance proposal
If the proposal is rejected
Then the existing Deposit (if any) amount should be transfer to the CommunityPool

AC2

Given a governance proposal P
Given P is rejected
When I query the CommunityPool using gaiacli q distr community-pool
Then it should return the updated amount of coins

AC3

Given a governance proposal P
Given P is rejected
When I query the CommunityPool using GET /distribution/community_pool
Then it should return the updated amount of coins

@alessio
Copy link
Contributor

alessio commented Apr 15, 2019

/cc @zmanian

@alexanderbez
Copy link
Contributor

Per Zaki's suggestion, which I think is obvious, this should be implemented given the approval of a text governance proposal.

@fedekunze fedekunze added the S:blocked Status: Blocked label Apr 17, 2019
@fedekunze
Copy link
Collaborator Author

merged to master #4373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gov S:blocked Status: Blocked
Projects
None yet
Development

No branches or pull requests

3 participants