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

Move Min Cost flow Computation to Payment Class? #31

Open
renepickhardt opened this issue Jun 22, 2022 · 2 comments
Open

Move Min Cost flow Computation to Payment Class? #31

renepickhardt opened this issue Jun 22, 2022 · 2 comments

Comments

@renepickhardt
Copy link
Owner

The PaymentSession consists usually of a payment loop and sends out attempts either synchronously (mostely for simulations) or concurrently (in mainnet). It seems as if the min cost flow computation is part of a payment. Thus we might regactor some things into the Payment class and have it very concise and shielded.

A counter argument would be that the min cost clow solver with the new Library by @Lagrang3 will store the uncertainty network and maintain the arcs of the solver for the next round of computation during the payment session. In that sense it seems reasonable that the solver lives outside the payments but within the session.

On the other hand the beauty of moving the solver would be that the payment would be responsible for planning the payment independently how the loop is handeling and updating everything.

Looking forward to also have the discussion with @sebulino

@Lagrang3
Copy link

If you ask me, a PaymentSession is not able to send out attempts it only does computation. The user feeds the PaymentSession with the information it gets from a LN node (or a simulation), then retrieves the MPP that the session suggests and this MPP is then forwarded back to LN to try a payment, and this process is iterative.
We don't know a priori which will be the LN oracle, and we shouldn't care because that is not our job.

@Lagrang3
Copy link

Maybe I am confused because you understand payment what I call PaymentSession, while for you a PaymentSession is a simulation of how payment works. I think we should clarify these concepts.

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

No branches or pull requests

2 participants