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

introduce loglevels and make prints in SyncSimulatedPayment Session optional #17

Open
renepickhardt opened this issue May 13, 2022 · 0 comments
Labels
enhancement New feature or request feature request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@renepickhardt
Copy link
Owner

As discussed with @sebulino the payment session currently computes a lot of statistics and depicts them to the user via the command line. However it is pretty pointless if one wants to automate tests, conduct full simulations and automatically evaluate the computed statistics.

I think it would be great to introduce a logging framework and make the outputs optional depending on the loglevel (and potentially to a log file instead of cli) also it might make sense to return the statistics of the paymentsession in a json dict that can be evaluated automatically in a simulation setting.

@renepickhardt renepickhardt added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers feature request labels May 13, 2022
@renepickhardt renepickhardt added this to the alpha release: 0.1 milestone May 13, 2022
sebulino added a commit to sebulino/pickhardtpayments that referenced this issue Jun 24, 2022
renepickhardt pushed a commit that referenced this issue Apr 12, 2023
* introduce register payment method on OracleLightningNetwork.py

* adding settlement_payment in OracleLightningNetwork

first stub of a method as described in  #16
Still needs to be tested

* rewriting setter for `actual_liquidity` using properties (python way)

* adjust channels in both directions when payment is made

* Settlement of onions with partial payments only after all onions were routed successfully

* deletion of unused import

* updating to rene/main

* introducing logging
#17

* refactoring min cost flow solver in Payment Class

* updating the PaymentSession so that the calls to the Payment method are clear.
Balances are still wrong, but pushing this, so that @Lagrang3 can have a look at the PaymenSession structure

* first code cleanup in PaymentSession

* Settlement and Payment completely implemented.
- In UncertaintyNetwork in_flights, minimum and maximum liquidity are adjusted accordingly after result of send_onion.
- In OracleNetwork in_flights are adjusted after changing attempt status to INFLIGHT and SETTLED.
this is a very verbose version, lots of logging everywhere :) ideal for testing and checking if amounts are adjusted correctly in the respective situations

* Verbosity removed.
Verbosity removed, because a lot of the logging of nodes were tied to the specific ChannelGraph.
Checks added, for
- when the OracleNetwork is updated and reverse channels might not be public
- when the UncertaintyNetwork is updated and reverse channels might not exist

* settlement implemented

* adding info on return channel when updating knowledge in UncertaintyNetwork

* settle_payment changed to settle_attempt
the payment iterates over the attempts and for each attempt calls the method (on oracle and uncertainty network). Thus, naming is now correct.

* example fails. logging of channel characteristics added.
currently the example in this commit fails. This might be because the in_flights are not handled correctly and min_liquidity (of max_liquidity?) might be adjusted incorrectly.
to monitor this, I added some logging verbosity for the main sections in the process.

* good example to check the learning of the UncertaintyNetwork
This is an example for the current implementation of learning from successful and unsuccessful onions. for better visualisation it's run on the smaller graph `channels.sample.json` with four nodes. The logfile is very verbose and demonstrates the changes step by step.

* refactoring update_knowledge
now update_knowledge does not need a flag from send_onion and takes the result from the attempt status.

* adding a new example for the simulation
simulation_example.py uses the "small graph" and executes the pickhard payment twice - one successful payment and one failing. The logfile is rather verbose and the change of information in the uncertainty network can nicely be observed.

* Channel balances now randomized again

* catching error if MCF throws infeasible
Added Exception handling if MCF solver throws infeasible.
Also moved to counter for MCF computations, so that failed computations are included.

* adding loglevel to method call to manage verbosity

* corrected update_knowledge method
corrected update_knowledge method and added bits of comments and documentation

* debug message corrected and seed added
There was a call in a debug message that lead to a reference error.
In line with Eduardo's works I added the seed initialisation with the same seed.

* adding debug level in simulation example to pickhard_pay call

* initialization of randomness in OracleNetwork. logging adjusted.

* adding code improvements from master thesis

* adding method for consistency check in uncertainty network

* Raising ValueError if path Argument in Attempt() is not a List of Channels

* redundancy removed when logging errors in update_knowledge method

---------

Co-authored-by: Sebastian <sebulino@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant