Improve release notes entry to cover full PR scope

This commit is contained in:
Osuji 2026-07-29 08:15:07 +01:00
parent dcad5673e9
commit fe84f76c5a

View file

@ -5,17 +5,23 @@ this release should add its entry under the appropriate section below.
## Code Health
- **Fix per-request options race condition in alias-resolution fan-outs**
- **Bound remaining unbounded LND alias-resolution fan-outs**
([#1651](https://github.com/Ride-The-Lightning/RTL/pull/1651), fixes
[#1630](https://github.com/Ride-The-Lightning/RTL/issues/1630)).
The module-level `options` variable in `server/controllers/lnd/channels.ts` and
`server/controllers/lnd/graph.ts` was reassigned per-request via
`options = common.getOptions(req)`, but `getAliasForChannel` and `getAliasFromPubkey`
read it by closure rather than receiving it as a parameter. Once alias-resolution tasks
were deferred across event-loop turns by `runWithConcurrencyLimit`, a concurrent request
to a different handler or node could overwrite `options` mid-fan-out, causing a task to
send with the wrong node's credentials or URL. The two functions now accept an explicit
`requestOptions` parameter, and each handler captures a per-request shallow copy before
building the task thunks. The catch blocks inside the concurrency-limit callbacks now
log raw exceptions directly instead of routing them through `handleError` (which expects
an HTTP-error-shaped value), matching the pattern used by `closeChannel`.
Mirrors the `runWithConcurrencyLimit(tasks, 20, done)` pattern introduced in #1629
across the remaining unbounded `Promise.all(map(...))` alias-resolution fan-outs in
the LND graph and channels controllers, preventing a large node from firing one
alias-lookup request per peer, channel, or hop all at once.
During review, a related race condition was found and fixed: the module-level
`options` variable in these controllers was reassigned per-request, but
`getAliasForChannel` and `getAliasFromPubkey` read it by closure rather than
receiving it as a parameter. Once alias-resolution tasks were deferred across
event-loop turns by the concurrency limiter, a concurrent request to a different
node could overwrite `options` mid-fan-out, causing a task to send with the wrong
node's credentials or URL. Both functions now accept an explicit `requestOptions`
parameter, and each handler captures a per-request copy before building the task
thunks. The catch blocks inside the concurrency-limit callbacks were also updated
to log raw exceptions directly instead of routing them through `handleError`
(which expects an HTTP-error-shaped value), matching the existing pattern used
by `closeChannel`.