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

[API] support period delegation APIs #313

Open
ezreal1997 opened this issue Oct 25, 2024 — with Linear · 2 comments
Open

[API] support period delegation APIs #313

ezreal1997 opened this issue Oct 25, 2024 — with Linear · 2 comments
Assignees

Comments

Copy link
Contributor

support period delegation related APIs in story-indexer

@zsystm
Copy link
Collaborator

zsystm commented Nov 7, 2024

@ezreal1997

Hi ezreal. I apologize for the unrelated question on this issue. I wanted to ask in the piplabs/cosmos-sdk repository, but I noticed that issue creation is currently disabled, so I hope it’s okay to reach out here.

I noticed in the delegation.go file that Unbond requests are restricted even after a PeriodDelegation’s EndTime has passed, which seems counterintuitive.

Initially, I assumed that PeriodDelegation.EndTime would ensure a predictable unbonding period by fixing the end time at the point of delegation creation. This way, users would be able to initiate unbonding freely once this period had elapsed. However, in the current implementation, when creating an UnbondEntry, the end time is instead set to current block time + params.unbondPeriod. This setup appears to override PeriodDelegation.EndTime by allowing unbonding entries to be created even before this end time.

Could you confirm if this behavior is intentional? My understanding was that PeriodDelegation.EndTime would establish a minimum staking period, after which users could unbond without restrictions. It would be great to hear your opnions on this.

Thank you.

@ezreal1997
Copy link
Contributor Author

ezreal1997 commented Nov 25, 2024

hi @zsystm , sry for my late reply.

There are two kinds of completion time:

  1. The first is the completion time based on staking period (flexible or fixed period) delegator chose during stake, which is used to check if delegator can perform unstake or not. Here we check 1) if this period delegation is a flexible delegation 2) if it's not flexible, did it reach the completion time based on its staking period.
  2. When it meets the unstake conditions, delegator should wait for unbonding_time to get his tokens back, which is system-level config for security.

For more details, you could refer staking period spec.

And the issue creation now is open for piplabs/cosmos-sdk, feel free to share your thoughts.

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

No branches or pull requests

3 participants