ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 889 forks source link

Askrene refactor #7614

Open Lagrang3 opened 3 weeks ago

Lagrang3 commented 3 weeks ago

Askrene refactor

Description

Remove recursiveness of reserve_add and reserve_remove. This allows compiler optimizations and avoids the remote possibility of a double failure which breaks atomicity.

eg. Imagine I call reserve_add for a path of 4 elements and I was promised I was atomic (either the changes succeed or no changes are applied). Then it fails at the 3rd step, then reserve_add calls reserve_remove to unwind the changed and we don't check the success of that call. If that call to reserve_remove fails, then the promise of atomicity is broken.

Related Issues

Changes Made

Checklist

Ensure the following tasks are completed before submitting the PR:

Additional Notes