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

Make every withdrawal an optional 2 phase transfer #2662

Closed
2 tasks done
sabineschaller opened this issue Apr 16, 2024 · 2 comments · Fixed by #2671
Closed
2 tasks done

Make every withdrawal an optional 2 phase transfer #2662

sabineschaller opened this issue Apr 16, 2024 · 2 comments · Fixed by #2671
Assignees
Labels
breaking Issue/PR that introduces breaking changes pkg: backend Changes in the backend package.

Comments

@sabineschaller
Copy link
Member

sabineschaller commented Apr 16, 2024

Context

Currently, liquidity withdrawals on

  • asset
  • peer
  • walletAddress

are 2 phase transfers while withdrawals on

  • incomingPayment
  • outgoingPayment

are 1 phase transfers.

We want to make the payment withdrawals 2 phase transfers as well such that ASEs can

  1. create the transfer on Rafiki
  2. do accounting on their own backend
  3. post ( = Tigerbeetle language for complete) the withdrawal

That way, if something goes wrong on the ASEs backend, the withdrawal within Rafiki will just expire (or be voided = canceled) and we won't end up with bad state.

Note that we don't have to implement the post/void functionality. We can use PostLiquidityWithdrawal/VoidLiquidityWithdrawal for that.

Todos

  • update incoming payment and outgoing payment withdrawal method to include a timeout
  • add post / void step to docs about flow of funds / accounting between Rafiki and ASE
@sabineschaller sabineschaller added pkg: backend Changes in the backend package. breaking Issue/PR that introduces breaking changes labels Apr 16, 2024
@koekiebox
Copy link
Collaborator

koekiebox commented Apr 22, 2024

PR: #2671

@koekiebox koekiebox changed the title Make every withdrawal a 2 phase transfer Make every withdrawal an optional 2 phase transfer May 6, 2024
@koekiebox
Copy link
Collaborator

Ready for review.

@mkurapov mkurapov linked a pull request May 7, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Issue/PR that introduces breaking changes pkg: backend Changes in the backend package.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants