-
Notifications
You must be signed in to change notification settings - Fork 4
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
delegations: remove delegations with 0 shares #711
Conversation
@@ -338,15 +338,6 @@ var ( | |||
escrow_balance_active = chain.accounts.escrow_balance_active + $2, | |||
escrow_total_shares_active = chain.accounts.escrow_total_shares_active + $3` | |||
|
|||
ConsensusAddDelegationsUpsertReplace = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused.
0c6ff4c
to
919f1a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
6de81ec
to
fd295c6
Compare
fd295c6
to
78b8d75
Compare
@@ -921,6 +921,33 @@ func (m *processor) queueEscrows(batch *storage.QueryBatch, data *stakingData) e | |||
e.Owner.String(), | |||
e.ActiveShares.String(), | |||
) | |||
// Ideally this would be merged with the ConsensusDebondingStartDelegationsUpdate query above, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitjat note that the previous version didn't actually work, i had to refactor the CTE into two separate queries.
There are probably other workarounds, but just issuing two queries seemed the least complex.
This will ensure that the delegations with 0 shares get cleaned up/removed from the table.