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

feat(dogfood): asset ids, oracle usage #11

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

MaxMustermann2
Copy link
Contributor

@MaxMustermann2 MaxMustermann2 commented Mar 5, 2024

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 the restaking_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.

x/dogfood/keeper/genesis.go Fixed Show fixed Hide fixed
x/dogfood/keeper/genesis.go Fixed Show fixed Hide fixed
x/dogfood/keeper/abci.go Fixed Show fixed Hide fixed
k.setValidatorSetID(ctx, ctx.BlockHeight()+1, id)
return []abci.ValidatorUpdate{}
}
defer k.ClearEpochEnd(ctx)
// start with clearing the hold on the undelegations.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@TimmyExogenous TimmyExogenous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaxMustermann2 MaxMustermann2 merged commit f3df5ef into dogfood Mar 5, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants