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: block on swap payment #2019

Closed
wants to merge 2 commits into from
Closed

feat: block on swap payment #2019

wants to merge 2 commits into from

Conversation

ralph-pichler
Copy link
Member

@ralph-pichler ralph-pichler commented Jun 7, 2021

adds blocking (but non-locking) semantics to Reserve if the reserve is full but swap payment is already ongoing.

the logic is:

  • if we are near enough the threshold we trigger time settlement and wait for it
  • if that was not enough or we could not time settle at all we trigger swap settlement
  • in the meantime we can continue until we burn through the rest of the reserve
  • if swap settlement is not complete by the time the reserve is full, we wait for swap to complete (or the source request to time out)
  • if afterwards we still cannot afford it (e.g. too little amount or payment failed) overdraft error is returned

this should also reduce the flakes seen in push-sync and pss test (however there is at least one other tag related issue in the push-sync test).

This change is Reviewable

@ralph-pichler ralph-pichler force-pushed the swap_block branch 4 times, most recently from b01e2ac to bd42310 Compare June 7, 2021 17:23
@ralph-pichler ralph-pichler marked this pull request as ready for review June 7, 2021 17:24
@ralph-pichler ralph-pichler self-assigned this Jun 7, 2021
@ralph-pichler ralph-pichler added the ready for review The PR is ready to be reviewed label Jun 7, 2021
@Eknir
Copy link
Contributor

Eknir commented Jun 8, 2021

Is this expected to speed up insert/retrieve?
How can we validate if this is indeed fixing something, or is working?

@ralph-pichler
Copy link
Member Author

closing this for now as it might not be needed

@ralph-pichler ralph-pichler deleted the swap_block branch December 6, 2021 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants