routing: implement bimodal probability estimator

Implements a new probability estimator based on a probability theory
framework.

The computed probability consists of:
* the direct channel probability, which is estimated based on a
  depleted liquidity distribution model, formulas and broader concept derived
  after Pickhardt et al. https://arxiv.org/abs/2103.08576
* an extension of the probability model to incorporate knowledge decay
  after time for previous successes and failures
* a mixed node probability taking into account successes/failures on other
  channels of the node (similar to the apriori approach)
This commit is contained in:
bitromortac committed 2023-02-14 13:34:25 +01:00
1 parent b8c6227383
commit 686816d784
4 files changed
+1219

No files matched your search

+8
View File
@@ -87,6 +87,8 @@ func (c *estimatorTestContext) assertPairProbability(now time.Time,
// TestProbabilityEstimatorNoResults tests the probability estimation when no
// results are available.
func TestProbabilityEstimatorNoResults(t *testing.T) {
t.Parallel()
ctx := newEstimatorTestContext(t)
// A zero amount does not trigger capacity rescaling.
@@ -104,6 +106,8 @@ func TestProbabilityEstimatorNoResults(t *testing.T) {
// TestProbabilityEstimatorOneSuccess tests the probability estimation for nodes
// that have a single success result.
func TestProbabilityEstimatorOneSuccess(t *testing.T) {
t.Parallel()
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{
@@ -144,6 +148,8 @@ func TestProbabilityEstimatorOneSuccess(t *testing.T) {
// TestProbabilityEstimatorOneFailure tests the probability estimation for nodes
// that have a single failure.
func TestProbabilityEstimatorOneFailure(t *testing.T) {
t.Parallel()
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{
@@ -171,6 +177,8 @@ func TestProbabilityEstimatorOneFailure(t *testing.T) {
// TestProbabilityEstimatorMix tests the probability estimation for nodes for
// which a mix of successes and failures is recorded.
func TestProbabilityEstimatorMix(t *testing.T) {
t.Parallel()
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{