cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.25k stars 3.61k forks source link

Feature Request: Add autoclaimed rewards to delegation/undelegationResponse struct #13825

Open puneet2019 opened 1 year ago

puneet2019 commented 1 year ago

Summary

While using ICA to stake and unstake, the rewards that are auto claimed are not passed to the controller chain

Problem Definition

In Liquid staking for pstake using ICA, we have users ibc tokens to persistence chain, then do a custom liquid stake txn. So the staking/ unstaking amount, etc is always known and ICA Msgs can be sent for the same.

While claiming rewards - we get the claimed rewards in the MsgWithdrawDelegatorRewardResponse, But while staking/ unstaking rewards are also autoclaimed, which cannot be known to the controller chain.

This is the only reason so far that ICQ is being used in the liquid staking implementation of pstake ( i.e. query balance of reward_withdrawal_ica_account) so it can be restaked.

Proposal

  1. Remove auto-claim feature
  2. Add auto-claimed rewards to response struct
tac0turtle commented 1 year ago

Hey, thanks for opening the issue.

The proposal seems valid, haven't looked into the code yet. But I'll add it to our sprint.

puneet2019 commented 1 year ago

@anmol1696 from persistence also wants to help take this up

alexanderbez commented 1 year ago

I don't think it's tenable to remove auto-claiming -- it's just how the distribution system works. However, we can totally add fields to the *Response structs 👍

puneet2019 commented 1 year ago

hi @tac0turtle is this dropped? which version is this being aimed for?

tac0turtle commented 1 year ago

It was removed from the team sprint until we deliver 0.47