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

Missing withdraw_rewards event in transactions that claim rewards #13295

Closed
ljk662 opened this issue Sep 14, 2022 · 1 comment · Fixed by #13323
Closed

Missing withdraw_rewards event in transactions that claim rewards #13295

ljk662 opened this issue Sep 14, 2022 · 1 comment · Fixed by #13323
Assignees

Comments

@ljk662
Copy link

ljk662 commented Sep 14, 2022

Summary of Bug

There's an explicit transaction to claim staking rewards (as seen in this CLI command) which emits an event of type withdraw_rewards. This Event has attributes to describe the tokens claimed by the calling account.

There are a few other transactions which, in certain circumstances, result in pending rewards being claimed such as delegate, redelegate, and undelegate. When these transactions are executed they emit a transfer event which describes the tokens that claimed but they do not emit a withdraw_rewards event which I would expect.

Can the transactions I list above emit a withdraw_rewards event similar to when a user explicitly withdraw rewards through the withdraw-rewards transaction.

Version

I've been experiencing this issue on chains that run 0.45.X version of the CosmosSDK but I believe this behavior is present in all past versions of the SDK.

Steps to Reproduce

Using the Provenance Explorer to display an example:

  • This delegate transaction has a transfer event which shows rewards being claimed by the caller. It does not have a withdraw_rewards event emitted.
@cosmos cosmos deleted a comment Sep 15, 2022
@alexanderbez
Copy link
Contributor

So this event is emitted in WithdrawDelegationRewards, but as you've pointed out, the other mechanisms which automatically withdraw rewards rely on x/distribution hooks, which internally call withdrawDelegationRewards (notice the private method).

So by moving the event emission to the private method should cover all cases. Will open a PR.

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

Successfully merging a pull request may close this issue.

2 participants