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

services/horizon: Batch liquidity pool updates/removals #3944

Merged
merged 2 commits into from
Sep 21, 2021

Conversation

2opremio
Copy link
Contributor

Fixes #3931

@2opremio 2opremio requested a review from bartekn September 20, 2021 16:16
@2opremio 2opremio force-pushed the 3931-lpchange-upsert branch from 387ae24 to 1b0df11 Compare September 20, 2021 16:49
@2opremio 2opremio force-pushed the 3931-lpchange-upsert branch from 1b0df11 to d5fb5c3 Compare September 20, 2021 16:52
lp := p.ledgerEntryToRow(change.Pre)
lp.Deleted = true
lp.LastModifiedLedger = p.sequence
lps = append(lps, lp)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should create RemoveLiquidityPools method and hide implementation of deleted objects (Deleted flag) from the caller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you be more specific? By implementation of deleted objects you mean factoring out the creation of a deleted liquidity pool value?

The deleted field is public anyhow

Copy link
Contributor

Choose a reason for hiding this comment

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

By implementation of deleted objects you mean factoring out the creation of a deleted liquidity pool value?

Exactly. If we ever change the implementation of how objects are removed (idk: we also add a deleted time or we will just remove the row) we'll have to change every instance of deletion upstream and fix a bunch of tests. I agree that Deleted field is public. We should probably also change this (not in this PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have given it a try, but I don't think it makes sense to attempt that sort of encapsulation without removing the Deleted field (which I think is out of the context of this PR).

Can we handle this separately?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK.

@bartekn bartekn linked an issue Sep 21, 2021 that may be closed by this pull request
@2opremio 2opremio merged commit 1aa506e into stellar:amm Sep 21, 2021
@2opremio 2opremio deleted the 3931-lpchange-upsert branch September 21, 2021 17:22
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.

LiquidityPoolsChangeProcessor: batch upsert and remove objects
2 participants