-
Notifications
You must be signed in to change notification settings - Fork 276
Balance estimate per side #2272
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
Conversation
06e3c41 to
64ccad4
Compare
I don't understand why, can you detail this statement? Also, the PR doesn't even build, you probably want to fix that. |
|
If you consider the total capacity, being able to send |
|
I understand what you mean, the missing information is that you may send I think this really is the right model. Even with EDIT: Actually on second though, it is more complex than that, I see different limitations to each model:
I think the second model still works better, but on |
6bf5ee2 to
e32f06d
Compare
e32f06d to
60488df
Compare
60488df to
53fa189
Compare
|
Fixed a bunch of things and added some tests. Should be ready now. |
Codecov Report
@@ Coverage Diff @@
## master #2272 +/- ##
==========================================
+ Coverage 84.32% 84.43% +0.11%
==========================================
Files 194 195 +1
Lines 14411 14508 +97
Branches 567 587 +20
==========================================
+ Hits 12152 12250 +98
+ Misses 2259 2258 -1
|
We refactor the balance estimates to be bundled with the graph in router data. This lets the compiler find for us places where we forgot to update balances, such as when pruning channels. The changes to Validation.scala are probably easier to compare against master than comparing them to the base PR, they make the change more obvious compared to master. We almost never use the `a max b` syntax in the codebase, we always use a more explicit function call, so I updated it in BalanceEstimate for consistency. This commit doesn't contain meaningful business logic changes and should be easy to review.
* Fix division by zero * Add didReceive * Add tests
Currently when a payment fails we ban the faulty channel for some time (60 seconds by default). There are several problems with that:
In this PR, we introduce a probabilistic estimation of the channel balance to replace this binary behavior. We use information from every payment attempt to update the probability distribution of channels balances. We use a half-life relaxation model to relax our estimations towards the uniform balance distribution baseline when we don't have new data to feed into the estimation engine.