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

delegations: remove delegations with 0 shares #711

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jun 18, 2024

This will ensure that the delegations with 0 shares get cleaned up/removed from the table.

@@ -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 = `
Copy link
Member Author

Choose a reason for hiding this comment

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

This was unused.

@ptrus ptrus force-pushed the ptrus/fix/clean-zero-delegations branch 2 times, most recently from 0c6ff4c to 919f1a9 Compare June 18, 2024 16:46
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

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

Thank you!

@ptrus ptrus force-pushed the ptrus/fix/clean-zero-delegations branch 2 times, most recently from 6de81ec to fd295c6 Compare June 19, 2024 19:10
@ptrus ptrus force-pushed the ptrus/fix/clean-zero-delegations branch from fd295c6 to 78b8d75 Compare June 19, 2024 19:11
@@ -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,
Copy link
Member Author

@ptrus ptrus Jun 19, 2024

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.

@ptrus ptrus merged commit 61400ef into main Jun 19, 2024
16 checks passed
@ptrus ptrus deleted the ptrus/fix/clean-zero-delegations branch June 19, 2024 20:02
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