Skip to content

Implement Release Stake on Delegation contract #61

@ethanfrey

Description

@ethanfrey

Closes https://github.com/Lay3rLabs/commitments/issues/23
After https://github.com/Lay3rLabs/commitments/issues/60

Implement ReleaseStake method on the delegation contract.

TODO: determine what should happen when this occurs. The below is a first draft that needs comments to refine it.

Note: it has to do lazy math, as there may be 1000 (or arbitrary N) delegators (provider side) on one delegate (consumer side)

My first intuition is that we should mark this, and each delegate but then claim to update... but we need to store some accounting (or TODOs) to account for rewards and slashing

When a delegator calls "ReleaseUnbonded" or similar, it should check for outstanding ReleaseStake that are assigned to it, and then release those up the tree. I assume that it should also update the delegation flows (percentages) to account for this missing. The common case is an operator stopping operations, so nothing should be delegated again.

eg. X has staked 1000 FOO at 40% A, 30% B, 30% C.
We get a ReleaseStake from A, for the half their total amount (divided over all delegates). This is somehow lazy recorded.
When X calls ReleaseUnbonded, it will:

  • Call ReleaseStake on the provider for those 200 FOO tokens
  • Update X's delegation ratios to (normalizing 200A, 300B, 300C) -> 25% A, 37.5% B, 37.5% C

NOTE These calculations are not clearly defined, but my first thoughts, please think them through and come up with a refined plan as part of #125

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions