AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 24 Bitcoin

askrene: refine: add a step to increase flows ...

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
askrene: refine: add a step to increase flows ...

by a small amount if the deliver amount is less than the requested
amount by X.
This step saves runtime by avoiding calling an extra MCF
and it helps us solve a small percentage of cases where the only
available routes have HTLCmin that is bigger than X.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a small optimization to Core Lightning's payment routing plugin (askrene). After computing payment routes, if the deliverable amount is slightly short of the requested amount, the code now nudges each route's amount upward by up to 2% (without exceeding each route's maximum). The goal is to avoid an extra expensive computation and to handle edge cases where a channel's minimum HTLC size is larger than the leftover shortfall. There is no indication in the commit that this fixes a security vulnerability.

Recommended action

Review the new `increase_flows()` logic for integer-overflow and rounding-edge cases, especially the hard-coded 0.02 tolerance and the interaction with the following HTLC-min violation loop. Consider whether the tolerance should be configurable and whether aborting on arithmetic failure is the desired failure mode for a plugin.

Security signals we found

01

New amount arithmetic in routing plugin with hard-coded 2% tolerance

02

Function aborts on `amount_msat_add`/`amount_msat_sub`/`amount_msat_accumulate` failure, which could crash the plugin on unexpected overflow/underflow

03

No explicit bounds check that `tolerance` is non-negative or finite before scaling

04

No changelog or security disclosure in commit message

Risk score

Why this scored 24/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 5/15
Confidence 4/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.