-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(dogfood): asset ids, oracle usage #11
Conversation
k.setValidatorSetID(ctx, ctx.BlockHeight()+1, id) | ||
return []abci.ValidatorUpdate{} | ||
} | ||
defer k.ClearEpochEnd(ctx) | ||
// start with clearing the hold on the undelegations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen the code to increase the undelegationHoldCount. Why does it need to be decreased here? Additionally, I have looked at the related code about OnHold in Cosmos-SDK and Evmos, It's a great feature. But I didn't find this feature being used in Cosmos-SDK and Evmos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen the code to increase the undelegationHoldCount. Why does it need to be decreased here?
You are right; I made a mistake. The line that increases it was accidentally removed. I will add it back. Great catch!
Additionally, I have looked at the related code about OnHold in Cosmos-SDK and Evmos, It's a great feature. But I didn't find this feature being used in Cosmos-SDK and Evmos.
Evmos certainly does not use it, as far as I can tell. Cosmos-SDK introduced the feature to support interchain-security, which does use it. I do not think any standalone chains use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The line was accidentally deleted.
As #4 stands today, the dogfood module relies on operator and delegation hooks to decide the validator updates which need to be passed to Tendermint. However, in a multi-asset staking situation, this is not feasible because the price of the asset (which is being delegated / undelegated) may change during the epoch. Hence, a function called
GetAvgDelegatedValue
is envisaged in therestaking_assets_manage
keeper. This function should return the sum of the currently delegated values (not pending undelegation) multiplied by the average price of the assets within the epoch (derived from the oracle module). With this new design, a lot of the complexities of the previous design have been eliminated or offloaded to other modules; however, it is a heavier operation because of the iteration of validators that is required at each epoch.