-
Notifications
You must be signed in to change notification settings - Fork 367
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
Add HTLCHandlingFailed event #1403
Add HTLCHandlingFailed event #1403
Conversation
hey @TheBlueMatt, some of the tests affected by this change use the this makes sense; since we only send the thanks! |
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.
As for the test macros/updates, yes, this kind of change tends to end up with a ton of test changes spewn throughout. Hopefully my comment below may make it simplier (actually just update the expect_pending_htlcs_forwardable_ignore
/expect_pending_htlcs_forwardable
macro(s) to detect the new event, with either a new argument to indicate at the test-sites if its required or something like PaymentFailedConditions
to set a list of conditions and pass that in.
@TheBlueMatt got it! thanks for the guidance 😄 |
2b96fe0
to
d16f1aa
Compare
Codecov Report
@@ Coverage Diff @@
## main #1403 +/- ##
==========================================
+ Coverage 90.87% 91.77% +0.90%
==========================================
Files 80 80
Lines 44645 49595 +4950
Branches 44645 49595 +4950
==========================================
+ Hits 40569 45518 +4949
- Misses 4076 4077 +1
Continue to review full report at Codecov.
|
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.
I think I have implemented this PR to the fullest of my knowledge of how things work... I added some comments in places I want to call out because I'm not 100% confident of them.
Also need some help in places, specifically with identifying when to not send our node_id
as the sink_node_id
update: still working on this PR. stepping away to catch up with some other deadlines. hope to make my next iteration by end of the week :) |
a5a23df
to
bb6d9bd
Compare
Looks like this is starting to shape up! Let me know when you want another round of review on this. |
@TheBlueMatt yeah I just got a little stuck finding the |
0c07c76
to
6bb663f
Compare
@TheBlueMatt not a PR I have super high confidence about getting right the first time, but will like to see how I can improve :D |
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.
A number of comments about data provided and structure before I jump into reviewing all the creation sites for correctness.
Looks like this needs rebase. |
3b6131d
to
7b52102
Compare
oops, sorry. thought I was being helpful, lol. |
8e21ce2
to
d6e0d0e
Compare
@TheBlueMatt I saw your comment in my email notifications but can't find it on GitHub for this line you said:
I'm looking to correct this, but when you say that "the destination is exactly the last entry in the destination vec," is this what you mean?:
because that seems to imply that the event order when calling |
Yea, sorry, I deleted that comment because I'm not sure we need/want tests to assert on a precise event ordering given a set of HTLCs get failed at the same time. In general we do want to avoid tests that just check that each of a series of events is in some set - we want to make sure all of the set get returned - but we don't want to be overly prescriptive in event ordering in case we change it in the future. |
d6e0d0e
to
145e500
Compare
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.
Code changes look good. Please make sure to wrap your commit messages (including descriptions) at 70-80 lines long.
145e500
to
9f5b999
Compare
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.
Largely looks good. Just a bunch of nits.
9f5b999
to
62c907f
Compare
62c907f
to
6c5af58
Compare
cleaned up commit messages |
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.
Code LGTM, some doc notes but this should be basically ready.
6c5af58
to
5410e4a
Compare
5410e4a
to
205aef4
Compare
Adds a HTLCHandlingFailed that expresses failure by our node to process a specific HTLC. A HTLCDestination enum is defined to express the possible cases that causes the handling to fail.
205aef4
to
8f0d9b0
Compare
We add `HTLCHandlingFailedConditions` to express the failure parameters, that will be enforced by a new macro, `expect_pending_htlcs_forwardable_conditions`.
8f0d9b0
to
3a7844a
Compare
In `ChannelManager::fail_htlc_backwards_internal`, we push a `HTLCHandlingFailed` containing some information about the HTLC
3a7844a
to
ac842ed
Compare
Addresses #1392
When
forward_htlcs
is empty,forward_event
does not get set, so I assume that means that represents an instance where forwarding has failed since we have no HTLCs to forward (?). may be completely off here.if possible, I will like some help finding the test where this event is suppose to be called 😄 thanks!edit: functional_tests helped me find those failing tests 😅 will fix