Skip to content

Do not return UpdateFailHTLC updates until the HTLC is committed #124

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

This fixes a violation of BOLT 2 and allows cleaning up some of the HTLC update event stuff. See individual commits for more.

@TheBlueMatt
Copy link
Collaborator Author

Is based on #123 and will needlessly conflict with #114 so probably just gonna wait on those two.

@TheBlueMatt TheBlueMatt force-pushed the 2018-08-htlc-fail-spec branch from 2590ee0 to 62ca481 Compare August 22, 2018 21:41
return_err!("Forwarding channel is not in a ready state.", 0x1000 | 7, &chan_update.encode_with_len()[..]);
}
}
} else { unreachable!(); }
Copy link

Choose a reason for hiding this comment

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

Seems useless else branch for me, I build without it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@TheBlueMatt TheBlueMatt force-pushed the 2018-08-htlc-fail-spec branch from 62ca481 to 6d9085b Compare August 23, 2018 19:30
This fixes a violation of BOLT 2 and will let us consolidate some
HTLC update handling. Good bit of code movement, but is mostly
refactor to store HTLC failure status in pending_htlcs in Channel.
UpdateFailHTLC isn't really an error anymore now that its handled
async after channel commitment (as required by BOLT 2), and since
its unused this is free. To resolve the TODO which intended to use
it for HTLC failure when trying to route forwards, we instead opt
to merge all the HTLC update events into one UpdateHTLCs event
which just contains a CommitmentUpdate object.
@TheBlueMatt TheBlueMatt force-pushed the 2018-08-htlc-fail-spec branch from 6d9085b to ab00e4c Compare August 23, 2018 20:12
@TheBlueMatt TheBlueMatt merged commit dbff601 into lightningdevkit:master Aug 23, 2018
TheBlueMatt added a commit that referenced this pull request Aug 23, 2018
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Aug 24, 2018
I'm rapidly starting to regret holding failed HTLCs in Channel,
given we allow them to violate the no-duplicate-hashes
precondition.

Found by fuzzer
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Aug 24, 2018
I'm rapidly starting to regret holding failed HTLCs in Channel,
given we allow them to violate the no-duplicate-hashes
precondition.

Found by fuzzer
TheBlueMatt added a commit that referenced this pull request Aug 26, 2018
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Aug 30, 2018
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