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

[bug]: routing: BimodalEstimator fails when channel capacity >1M sat #9085

Open
morehouse opened this issue Sep 10, 2024 · 1 comment
Open
Assignees
Labels
bug Unintended code behaviour needs triage path finding

Comments

@morehouse
Copy link
Collaborator

BimodalEstimator.probabilityFormula returns zero when its parameters are on the order of ~1M sat because the exponentials calculated in BimodalEstimator.primitive become tiny and round to 0.

Initially detected by @dergoegge running the FuzzProbability fuzz target. Sample failure:

Input:

go test fuzz v1
uint64(1000000000)
uint64(300000000)
uint64(400000000)
uint64(300000000)

Trace:

--- FAIL: FuzzProbability (0.18s)
    --- FAIL: FuzzProbability (0.00s)
        probability_bimodal_test.go:708:
                Error Trace:    /workdir/lnd/routing/probability_bimodal_test.go:708
                                                        /usr/local/go/src/reflect/value.go:596
                                                        /usr/local/go/src/reflect/value.go:380
                                                        /usr/local/go/src/testing/fuzz.go:335
                Error:          Received unexpected error:
                                normalization factor is zero, capacity: 1e+09, success amount: 3e+08, fail amount: 4e+08
                Test:           FuzzProbability
                Messages:       c: 1000000000 s: 300000000 f: 400000000 a: 300000000
@bitromortac
Copy link
Collaborator

Thanks for the report! This is because the success and fail amount drive the bimodal model into regions where the model doesn't give good predictions and therefore has problems with numerics. I tested this with #8330, where it passed, so this should be fixed by that PR in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage path finding
Projects
None yet
Development

No branches or pull requests

2 participants