Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add strict forwarding option
Description
When receiving a forward request lightningd selects the best channel with
the next peer based on its ability to add an HTLC and its spendable amount.
If two forwarding request arrive at the same time pointing to the same
peer we can have a race condition in which both HTLCs compete
concurrently for the same spendable amount.
There shouldn't be a race condition if both requests are supposed to be
allocated on different parallel channels. However, non-strict forwarding is allowed
in the protocol and it is reasonable that node operators can decide which channel
to use when forwarding to a peer.
Therefore we add configuration option
dev-strict-forwarding
default to false,to enforce strict forwarding. With that flag we no longer need to skip parallel channel
tests in renepay (9d88ce3).
Related Issues
Changes Made
Checklist
Ensure the following tasks are completed before submitting the PR:
TODOs
have been addressed or removed.Additional Notes
This is not a solution to the race condition, it only avoids it by removing the freedom to choose the forward channel.