-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax relaying requirement on expiry #1497
Conversation
We previously refused to relay HTLCs that would result in a low expiry delta for the next node. However it's not our decision to make, it's the remote's. We should forward these HTLCs and let the remote decide whether they fail them because the expiry is too close or fulfill them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will that not cause force-close if we remove the check in sendAdd
but not in receiveAdd
?
I think this change makes sense, but I'm a bit uncomfortable with accepting HTLCs that are possibly already expired; curious what other implementations are doing?
I'm not seeing any related check in There's nothing in the spec that relates to that check we were doing, and nothing that says a low HTLC expiry should trigger a force-close. On the contrary, a low HTLC expiry should simply trigger an |
This cannot happen, as these would not pass the check on our |
Indeed! This inconsistency is by itself a red flag for current implementation. The culprit is #687. Looking at the description of that PR, the rationale for case b) is not very convincing (guilty!). At least I'm consistent with myself from 2 years ago.
We will accept and sign them, but not relay them. I agree this should be harmless, it just feels strange to sign a htlc for which the counter-party can immediately claim the corresponding output using the timeout branch. |
It's true that it feels a bit weird! But I think the right behavior in that case is to accept the HTLC and immediately fail it (since there's no way to un-add an HTLC), which will be our behavior. Otherwise if we added a force-close in that case, I believe it could be exploited to force us to close channels. |
We previously refused to relay HTLCs that would result in a low expiry delta for the next node.
However it's not our decision to make, it's the remote's.
We should forward these HTLCs and let the remote decide whether they fail them because the expiry is too close or fulfill them.