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

Finalize producer apis #19

Merged
merged 4 commits into from
May 4, 2023
Merged

Finalize producer apis #19

merged 4 commits into from
May 4, 2023

Conversation

ethanfrey
Copy link
Collaborator

@ethanfrey ethanfrey commented May 3, 2023

Closes #2

Copy link
Collaborator

@JakeHartnell JakeHartnell left a comment

Choose a reason for hiding this comment

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

LGTM! Having owner_by_proxy query is a good add.

@ethanfrey ethanfrey force-pushed the finalize-producer-apis branch from cbf4a7d to 3b07623 Compare May 3, 2023 20:18
@ethanfrey ethanfrey marked this pull request as ready for review May 4, 2023 08:00
Comment on lines +20 to +21
Lien - A claim on some collateral (from local- or cross-staking contract). Collateral with existing
liens may not be withdrawn.
Copy link
Member

Choose a reason for hiding this comment

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

Do Liens represent both:

  • how much could be under slashing risk
  • duration it must be locked for?

Or is the duration it must be locked for each 'lien' tracked separately?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The duration is tracked by the LocalStaking / CrossStaking contract.

The vault doesn't care if it is bonded or unbonding. Only when it is finally released do we remove the lien.

(It is only the first point)

Comment on lines +56 to +58
For each user, the total amount of potential slashing over all liens is less than or
equal to their total collateral (important if doing many cross-stakes, or with high slashing rates):
`liens(user).map(|x| x.lien * x.max_slashing_rate).sum() <= collateral(user)`
Copy link
Member

Choose a reason for hiding this comment

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

We should add a todo for ourselves, to reason about how to express chain's restrictions on when you could go above max slashing rate. (Issue being that correlated slashing can make the max slashing rate quite high)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please make an issue for this.

I don't fully understand the question - or what "correlated slashing" is

@ethanfrey ethanfrey merged commit 20b1b96 into main May 4, 2023
@ethanfrey ethanfrey deleted the finalize-producer-apis branch May 4, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finalize documentation for provider side
3 participants