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

fix: ensure withdraw_rewards events are always emitted on reward withdrawal (backport #13323) #13340

Merged
merged 4 commits into from
Sep 20, 2022

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 20, 2022

This is an automatic backport of pull request #13323 done by Mergify.
Cherry-pick of c1c23a7 has failed:

On branch mergify/bp/release/v0.45.x/pr-13323
Your branch is up to date with 'origin/release/v0.45.x'.

You are currently cherry-picking commit c1c23a75d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   CHANGELOG.md
	deleted by us:   tests/integration/distribution/keeper/delegation_test.go
	deleted by us:   testutil/sims/app_helpers.go
	both modified:   x/distribution/keeper/delegation.go
	both modified:   x/distribution/keeper/delegation_test.go
	both modified:   x/distribution/keeper/keeper.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot added the conflicts label Sep 20, 2022
@github-actions github-actions bot added the C:x/distribution distribution module related label Sep 20, 2022
alexanderbez and others added 3 commits September 20, 2022 14:32
…drawal (#13323)

(cherry picked from commit c1c23a7)

# Conflicts:
#	CHANGELOG.md
#	tests/integration/distribution/keeper/delegation_test.go
#	testutil/sims/app_helpers.go
#	x/distribution/keeper/delegation.go
#	x/distribution/keeper/delegation_test.go
#	x/distribution/keeper/keeper.go
@julienrbrt julienrbrt force-pushed the mergify/bp/release/v0.45.x/pr-13323 branch from 21dc5bf to a663638 Compare September 20, 2022 12:33
### Improvements

* [#13323](https://github.com/cosmos/cosmos-sdk/pull/13323) Ensure `withdraw_rewards` rewards are emitted from all actions that result in rewards being withdrawn.
* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage.
Copy link
Member

Choose a reason for hiding this comment

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

@tac0turtle tac0turtle merged commit 63a7c45 into release/v0.45.x Sep 20, 2022
@tac0turtle tac0turtle deleted the mergify/bp/release/v0.45.x/pr-13323 branch September 20, 2022 13:26
Comment on lines +191 to +200
if finalRewards.IsZero() {
baseDenom, _ := sdk.GetBaseDenom()
if baseDenom == "" {
baseDenom = sdk.DefaultBondDenom
}

// Note, we do not call the NewCoins constructor as we do not want the zero
// coin removed.
finalRewards = sdk.Coins{sdk.NewCoin(baseDenom, sdk.ZeroInt())}
}
Copy link
Member

Choose a reason for hiding this comment

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

@alexanderbez I think this is state breaking? can we remove since it was out of scope of the pr

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed out of band. Assured that this is not state machine breaking as it:

  1. Adds new events
  2. Moves existing SM logic from one method to another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants