Skip to content

renepay: don't keep the onion on a pending route - #79

Merged
kwsantiago merged 1 commit into
blake2b-unifiedfrom
renepay-onion-leak
Oct 31, 2026
Merged

kwsantiago merged 1 commit into
blake2b-unifiedfrom
renepay-onion-leak

Conversation

@kwsantiago

Copy link
Copy Markdown

renepay serialized each route's onion onto the route, and nothing kept a pointer to it after the request was built. The route stays in the pending map until its HTLC resolves, so stopping the node with a payment in flight reported the onion as a memory leak. This made test_renepay.py::test_limits flaky. The onion now lives on tmpctx, and the shared secrets stay on the route.

The leak check also missed the per-payment disabled channel maps, which a payment in progress reported as leaks. It now scans them.

test_pending_route_onion holds an HTLC at the middle node and stops the payer. Both leak reports appeared before this change, and neither does now.

Changelog-None

@kwsantiago
kwsantiago merged commit 5c61c27 into blake2b-unified Oct 31, 2026
46 of 49 checks passed
@kwsantiago
kwsantiago deleted the renepay-onion-leak branch October 31, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant