Skip to content

Time out incoming HTLCs when we reach cltv_expiry (+ test)#252

Closed
TheBlueMatt wants to merge 1 commit intolightningdevkit:masterfrom
TheBlueMatt:2018-11-fail-inbound
Closed

Time out incoming HTLCs when we reach cltv_expiry (+ test)#252
TheBlueMatt wants to merge 1 commit intolightningdevkit:masterfrom
TheBlueMatt:2018-11-fail-inbound

Conversation

@TheBlueMatt
Copy link
Copy Markdown
Collaborator

We only do this for incoming HTLCs directly as we rely on channel
closure and HTLC-Timeout broadcast to fail any HTLCs which we
relayed onwards where our next-hop doesn't update_fail in time.

Partially addresses #215. Note that the failing of inbound HTLCs which we forwarded based on the confirming of downstream HTLC-Timeout transactions is not yet implemented, but that will be the rest of #215.

We only do this for incoming HTLCs directly as we rely on channel
closure and HTLC-Timeout broadcast to fail any HTLCs which we
relayed onwards where our next-hop doesn't update_fail in time.
});
channel_state.claimable_htlcs.retain(|payment_hash, htlcs| {
htlcs.retain(|htlc| {
if htlc.cltv_expiry <= height { // XXX: Or <?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry what means "XXX: or <?" ? You want to substract a safe delay to height ?

Copy link
Copy Markdown
Collaborator Author

@TheBlueMatt TheBlueMatt Nov 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, lol, ffs, I really need to double-check my own commits before opening PRs, I blame sleep deprivation after 16 hours of being in a plane, thanks for reviewing...That was a note to myself that I'm not sure if the comparison was supposed to be <= or <, I'll double check and fix the PR.

@ariard
Copy link
Copy Markdown

ariard commented Nov 16, 2018

utACK, will handle the second part after #198, get done, same kind of problems

@ariard
Copy link
Copy Markdown

ariard commented Dec 8, 2018

As mentionned in #215, we need also to fail AwatingRemoteRAA::AddHTLC if they timed out, so implemented there ariard@56d72cf need to add test and fix the height comparison as for yours (maybe we want to subtract a safe delay to height?)

On the last point, don't get you on "failing of inbound HTLCs which we forwarded based on the confirming of downstream HTLC-Timeout transactions" ? If we detect an onchain channel closure why send back UpdateFail to downstream remote peer ?

@TheBlueMatt
Copy link
Copy Markdown
Collaborator Author

Now a part of #441, including @ariard's commit as well (though no test for that bit yet).

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.

2 participants