Skip to content

MsgDelegate is not auto-compounding #166

@hieuvubk

Description

@hieuvubk

Context

In the origin Cosmos SDK delegate behavior, stakers can stake their unclaimed rewards via a hook that calls BeforeDelegationSharesModified → distribution.WithdrawDelegationRewards. This withdraws the user's rewards to their balance before the delegation runs, enabling reward auto-compounding within a single transaction.

In our multi-staking delegate, we lock the bonded token before calling cosmos staking.Delegate, which means the hook fires after the bonded token is already locked. As a result, unclaimed rewards are not available to cover the delegation amount at the time of escrow.

This is not a security bug but a UX limitation — users need one additional transaction to delegate the rewards that were auto-withdrawn by the previous delegate message.

Resolve approach

  • Add withdraw user reward before locking token in delegate, redelegate
  • It not a security bug so we can just announce to validator

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions