-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: ensure withdraw_rewards events are always emitted on reward withdrawal (backport #13323) #13340
Conversation
21dc5bf
to
a663638
Compare
### 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. |
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.
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())} | ||
} |
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.
@alexanderbez I think this is state breaking? can we remove since it was out of scope of the pr
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.
Discussed out of band. Assured that this is not state machine breaking as it:
- Adds new events
- Moves existing SM logic from one method to another.
…drawal (backport cosmos#13323) (cosmos#13340) * fix: ensure withdraw_rewards events are always emitted on reward withdrawal (cosmos#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 * fix conflicts * move changelog to right place * fix typo Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This is an automatic backport of pull request #13323 done by Mergify.
Cherry-pick of c1c23a7 has failed:
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>
branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com