To calculate rewards correctly, we need to withdraw rewards from validator (meta-staking) every time we do stake / unstake / withdraw rewards action on provider, this lead to a very complex msg tree talking with 3 contracts:
- Provider do IBC call to consumer
- Consumer do withdraw rewards call to meta-staking
- Meta staking withdraw rewards from validator
- Meta staking calculate rewards of the calling consumer
- Meta staking sends the funds to consumer
- Consumer calculate the rewards of the calling delegator
- Consumer sends IBC-funds to delegator.
Removing meta-staking will allow us to simplify this flow by a lot and go with a more straight forwards flow:
- Provider do IBC call to consumer
- Consumer withdraw rewards from validator
- Consumer calculate rewards of calling delegator
- Consumer sends IBC-funds to delegator.