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: delegation state transition #25

Merged
merged 7 commits into from
Oct 22, 2024
Merged

Conversation

gusin13
Copy link
Collaborator

@gusin13 gusin13 commented Oct 21, 2024

This PR

  1. Implements phase 2 delegation state transition
    If the staker is following old flow, the state transitions will be Pending -> Active -> Unbonded
    If the staker if following the new pre-approval flow, it will be Pending -> Verified -> Active -> Unbonded

  2. Indexer will now panic and exit/stop everything if encountered any error in processing events.

  3. Improves validation functions.

Notes

  • came across a bug have created a ticket - ref
  • have some doubts in certain states in babylon, opened a slack thread ref. Basically babylon stakers can follow either old flow/ or the new pre-approval flow which is why i was getting confused earlier. the inclusion proof is optional in MsgCreateBTCDelegation ref.
    State transition in this pr performs certain validations and first identifies if the staker is following old flow or new flow and then perform appropriate transition. This is in sync with Babylon's logic ref ref2

@gusin13 gusin13 marked this pull request as ready for review October 21, 2024 22:23
@gusin13 gusin13 merged commit 4bd50fe into main Oct 22, 2024
11 checks passed
@gusin13 gusin13 deleted the gusin13/state-transitions branch October 22, 2024 14:32
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.

2 participants