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

DO NOT MERGE #66

Closed
wants to merge 1 commit into from
Closed

DO NOT MERGE #66

wants to merge 1 commit into from

Conversation

jrwbabylonlab
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@gusin13 gusin13 left a comment

Choose a reason for hiding this comment

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

I thought about this again, I kind of like your original idea (option2) i.e keeping another field in db. This saves us from overcomplicating the original indexer states.

In short why don't we have another field which is basically a sub_state

type BTCDelegationDetails struct {
// ... existing fields ...


State types.DelegationState bson:"state"
SubState string bson:"sub_state,omitempty"


// ... existing fields ...
}

The sub_state would be limited to three values: (this is in sync with our btc script paths)

  • timelock
  • unbonding
  • slashing

This field would only be present when the parent state is:

  • unbonding
  • withdrawable
  • withdrawn

we can name this field sth else as well like btc_script_path etc
wdyt?

@jrwbabylonlab
Copy link
Collaborator Author

I thought about this again, I kind of like your original idea (option2) i.e keeping another field in db. This saves us from overcomplicating the original indexer states.

In short why don't we have another field which is basically a sub_state

type BTCDelegationDetails struct {
// ... existing fields ...


State types.DelegationState bson:"state"
SubState string bson:"sub_state,omitempty"


// ... existing fields ...
}

The sub_state would be limited to three values: (this is in sync with our btc script paths)

  • timelock
  • unbonding
  • slashing

This field would only be present when the parent state is:

  • unbonding
  • withdrawable
  • withdrawn

we can name this field sth else as well like btc_script_path etc wdyt?

Sounds good to me. my only question is with this sub-state approach, do you need to delete this field value when state changed to the next one?

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