Uh oh!
There was an error while loading. Please reload this page.
Expose next_channel_id in PaymentForwarded event - #1475
Conversation
Uh oh!
There was an error while loading. Please reload this page.
9c35b7f to
eb6a39dCompareCodecov Report
@@ Coverage Diff @@## main #1475 +/- ##
========================================
Coverage 90.88% 90.88% ========================================
Files 75 76 +1 Lines 41474 42081 +607 Branches 41474 42081 +607 ========================================
+ Hits 37695 38247 +552 - Misses 3779 3834 +55
Continue to review full report at Codecov.
|
Thanks for having a look at this! However, I'm not too sure if the change actually warrants this kind of refactoring? Also, not sure if it is just me, but every time I read |
Using the current approach all events are linked to an You're right about the different semantic use of Initially, I faced the confusion of nomenclature as well but I rationalized it because a node only knows about the prev/next nodes in the route. So for it the source and destination are the prev and next node, though I see how it is confusing. I added documentation to clarify what source/sink mean but if we still feel the naming is unintuitive, I'll update it. |
Generally we've been pretty open to this kind of refactoring in the past - its relatively trivial, most existing users don't implement this interface directly so won't even see it, but even if they do they won't have any trouble adapting to it. Its certainly a lot cleaner than changing the serialization format, IMO.
Hmm, fair enough. I'd suggested it as an alternative to "source+destination" which has that problem even worse, but I like your prev/next or incoming/outgoing suggestion. |
Uh oh!
There was an error while loading. Please reload this page.
So I'll do a couple of things
Thanks for the feedback and being patient with me! It really helps especially because I'm new to FOSS, Bitcoin, Lightning, and Rust. |
e386e61 to
9e67447Comparesink_channel_id in PaymentForwarded eventnext_channel_id in PaymentForwarded event
TheBlueMatt
left a comment
There was a problem hiding this comment.
A few nits but this looks good to me 🚀
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
44ec53c to
1bcdf98CompareUh oh!
There was an error while loading. Please reload this page.
valentinewallace
left a comment
There was a problem hiding this comment.
This looks good! Think I'm ACK after remaining feedback is addressed
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1bcdf98 to
6e76064Compareatalw
commented
May 14, 2022
Rebased |
6e76064 to
b60de85CompareThis update also includes a minor refactor. The return type of `pending_monitor_events` has been changed to a `Vec` tuple with the `OutPoint` type. This associates a `Vec` of `MonitorEvent`s with a funding outpoint. We've also renamed `source/sink_channel_id` to `prev/next_channel_id` in the favour of clarity.
b60de85 to
1ae1de9Compare
Closes#1391
There is a minor refactor included in this PR. The type of
pending_monitor_eventsinchainmonitorhas been changed toHashMap<OutPoint, Vec<MonitorEvent>>. This associates events with an outpoint, thereby removing the dependency in theMonitorEventenum to store the outpoint separately. One doubt I had is if the order of pending events matters. If it does, this approach will not work.