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

It should be possible to see the amount of the auto-withdraw that happens on delegate and undelegate txs #4728

Closed
4 tasks
Onefox opened this issue Jul 17, 2019 · 6 comments

Comments

@Onefox
Copy link

Onefox commented Jul 17, 2019

Summary of Bug

When bonding or unbonding coins the potential outstanding reward from the delegator gets auto-withdrawn to the delegator or the set reward address.
This auto-withdrawn is not shown in any form on the MsgDelegate or MsgUndelegate Tx.
This makes it very difficult to know how much was withdrawn while delegating or undelegating.

I would propose to add the same tag to the tx that is already in use when withdrawing rewards also to the MsgDelegate and MsgUndelegate txs.
Here an example of the tag:
https://hubble.figment.network/cosmos/chains/cosmoshub-2/blocks/1074949/transactions/CD89DBC2AA8FA8AB118CF7C1CF4A54D800E50341D3D2E16DD0B0076F1A8173DE?format=json
{"key":"rewards","value":"13618319uatom"}

Interestingly the following txs has non such tag:
https://hubble.figment.network/cosmos/chains/cosmoshub-2/blocks/470256/transactions/2A5B98E9077B28E9429A279825667F424BB49ED0BA0443996DA6B6022E7CDD50?format=json

I am not sure why could it be that the tx was just done before (#3850) was in place?

Version

Current mainnet.

Steps to Reproduce

  1. Use a fresh account with some funds.
  2. Stake to a validator X funds.
  3. Wait until there are some rewards on the validator.
  4. Stake some more funds.
  5. Check your balance, It has gone down by the amount you staked and up by the reward you got.
  6. There is no explanation for the reward amount on chain.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@Onefox
Copy link
Author

Onefox commented Jul 17, 2019

I think its fixed with the events added to 0.36.0 here:
https://github.com/cosmos/cosmos-sdk/pull/4541/files#diff-9d701528d2ee67dd081cf7ca4d484c05

@alexanderbez
Copy link
Contributor

Yes, you'll be able to see all these events through the new events system 👍

@UdiIlan
Copy link

UdiIlan commented Jul 23, 2019

I see that the information isn't available in the events in version 0.36.
This is an example fir such tx:

{"height":"105","txhash":"D3DFF4AD99142529D9E4480239ACF2BBFDC36522353A8D677AF44E3DF62FBEA8","raw_log":"[{"msg_index":0,"success":true,"log":""}]","logs":[{"msg_index":0,"success":true,"log":""}],"gas_wanted":"200000","gas_used":"100447","events":[{"type":"delegate","attributes":[{"key":"validator","value":"cosmosvaloper1jp6wup6v8s6dqxdeq2epwt8u6pxpw3pf37hgru"},{"key":"amount","value":"100000"}]},{"type":"message","attributes":[{"key":"action","value":"delegate"},{"key":"sender","value":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl"},{"key":"module","value":"staking"},{"key":"sender","value":"cosmos1y3qhvhmnd4cae5zfj9w48je3pfkckn0fm99g99"}]},{"type":"transfer","attributes":[{"key":"recipient","value":"cosmos1y3qhvhmnd4cae5zfj9w48je3pfkckn0fm99g99"}]}],"tx":{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgDelegate","value":{"delegator_address":"cosmos1y3qhvhmnd4cae5zfj9w48je3pfkckn0fm99g99","validator_address":"cosmosvaloper1jp6wup6v8s6dqxdeq2epwt8u6pxpw3pf37hgru","amount":{"denom":"stake","amount":"100000"}}}],"fee":{"amount":[],"gas":"200000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AyKLozcl3YXspKx3hyorGJMnAGqoW9BBZB4m0OJZXr35"},"signature":"n5G+GFldmCPeqMPs68EadXscgztv+9ux2f+vNsoegx9Ce9GavcHUWRmCQNFX0ngb0cqwjLFagEHMWQo6echDeA=="}],"memo":""}},"timestamp":"2019-07-23T14:17:49Z"}

@alexanderbez
Copy link
Contributor

@UdiIlan indeed! We are emitting the event, but just not the amount. I'll update this accordingly. Thank you!

@UdiIlan
Copy link

UdiIlan commented Jul 24, 2019

@alexanderbez do you think that the amount can be added any time soon?
Thanks!

@alexanderbez
Copy link
Contributor

alexanderbez commented Jul 24, 2019

@UdiIlan yes, it'll be in the release coming out shortly.

ref: #4772

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

No branches or pull requests

3 participants