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

trampoline: handle edges with known fees in allocation

Public commit record

What the developer wrote

Authored by f321x

73/100 · Adequate
trampoline: handle edges with known fees in allocation

Handle `TrampolineEdge` with known fees when allocating fees to
`TrampolineEdge` with `PLACEHOLDER_FEE` during trampoline route
construction.

This allows to create a mixed route from edges where we know the exact
feerates (e.g. provided through lazy trampoline) and evenly spread the
remaining budget between the edges where the fees are unknown (`PLACEHOLDER_FEE`).

Co-Authored-By: SomberNight <somber.night@protonmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes how Electrum calculates fees for trampoline Lightning payments when some route edges have known fees and others are unknown placeholders. Previously, the code ignored known fees and split the entire budget evenly among placeholder edges, which could either overpay or exceed the intended fee budget. The new code solves a small linear equation so the final total fee stays within budget. This is a correctness and fee-budget safety improvement, not a direct theft-of-funds bug, but getting it wrong could cause payments to fail or users to pay more than expected.

Recommended action

Review the new linear allocation math for off-by-one and floor behavior; add unit tests covering mixed known/placeholder edges, proportional fees, and edge cases where budget_remaining <= 0 or coeff <= 0; verify is_route_within_budget still catches residual rounding overruns.

Security signals we found

01

fee budget correctness fix

02

payment routing logic change

03

placeholder fee allocation now accounts for known edge fees

04

potential overpayment / fee budget exceedance in prior logic

Risk score

Why this scored 31/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 6/15
Confidence 5/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.