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: Pay before Persist experiment #1373

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

MantisClone
Copy link
Member

@MantisClone MantisClone commented Mar 29, 2024

Towards #1331
Related #1251

Problem

In theory, we can Pay a request before persisting it in the Request Network protocol.

In other words, we create a Request in memory without persisting it. Then, we prompt the end user to send payment against that request. Finally, we persist the request - so that it may serve as a receipt for the payment.

However, the existing SDK functions assume that the request is persisted immediately after being created.

Motivation

This shortens the critical path for a user making a payment. This is especially desirable for payment apps - in which a payer wants to buy something. The workflow is driven by the payer instead of the payee, so why make them wait for the request to be persisted before allowing them to send a payment?

Changes

  • feat: public funcs for creating a request in memory without persisting

Why were these variables/functions chosen?

I traced the RequestNetwork.createRequest() and the RequestLogic.acceptRequest() functions and changed all the internal variables/functions private => public.

Considerations

Rather than implementing this new logic, this PR only changes several private functions and variables to be public, thus empowering external contributors to experiment with the "Pay before Persist" workflow. The expectation is that once these experiments are complete, we either:

  1. Revert this PR
    or
  2. Implement the "Pay before Persist" functions in the RN SDK.

@MantisClone MantisClone changed the title feat: public funcs for creating a request in memory without persisting feat: Pay before Persist Experiment Mar 29, 2024
@MantisClone MantisClone changed the title feat: Pay before Persist Experiment feat: Pay before Persist experiment Mar 29, 2024
@MantisClone MantisClone self-assigned this Mar 29, 2024
@MantisClone MantisClone marked this pull request as ready for review March 29, 2024 19:06
@MantisClone MantisClone requested review from skiv71 and sstefdev March 29, 2024 19:07
@MantisClone
Copy link
Member Author

@limone-eth Here's the PR that will enable your Pay before Persist experiment.

@MantisClone MantisClone requested a review from vrolland March 29, 2024 19:10
@MantisClone MantisClone merged commit bdc6eb4 into master Mar 29, 2024
27 checks passed
@MantisClone MantisClone deleted the create-without-publish branch March 29, 2024 19:23
@MantisClone MantisClone linked an issue Apr 9, 2024 that may be closed by this pull request
MantisClone added a commit that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
3 participants