Skip to content

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

Closed
@morehouse

Description

@morehouse

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions