-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dual staking #44
base: main
Are you sure you want to change the base?
Dual staking #44
Conversation
operate/services/manage.py
Outdated
staking_token_requirements = self._compute_staking_token_requirements( | ||
service_config_id, chain, staking_params | ||
) | ||
staking_token_requirements[staking_params["staking_token"]] = ( |
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.
it looks like we can avoid overwriting these requirement by just reading the on_chain_state also in the compute function, and having this logic there
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.
Yes and no.
The output of this method is the service asset requirements (native, tokens, dual tokens, etc) required to deploy a service from scratch.
On another method, we retrieve the bonded assets.
So, the requirements needed will be service_asset_requirements - bonded_assets
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 opted for this way to have separation between what's bonded and what's on the Safe. We can discuss.
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.
In other words, the following invariant must always be satisfied (*):
master_safe_balance + bonded_assets >= protocol_asset_requirements
=
master_safe_balance >= protocol_asset_requirements - bonded_assets
(*) Obviously, the value bonded_assets
and master_safe_balance
depend on the protocol state, but we have a methodology to compute these values.
Proposed changes
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply