Skip to content
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

Potential Offer Handling #85

Closed
wants to merge 3 commits into from
Closed

Conversation

carlaKC
Copy link
Collaborator

@carlaKC carlaKC commented Dec 20, 2023

Opening up to express some ideas around how we'd handle #81 and #84, not intended for merge.

We've already got a lot of the machinery in place to handle the onion messaging side of things in LDK, so I'd like to try to take advantage of that - if we provide an OfferMessageHandler that correctly queues messages, the existing onion messenger will drive sending / notifying of onion messages. That leaves our code responsible for:

  • Creating an invoice request and adding it to the handler's existing queue
  • Handling the invoice that comes back (validating it vs the original request / amount)
  • Tracking state to make sure we don't process anything twice

Hope that this adds some context to the review!

To allow external callers to shutdown lndk, we provide a shutdown
trigger and listener to the onion messenger, replacing the single use
channels that we previously used. This is useful for itests, so that
we can cleanly shut down and for callers of the library to manage
execution.
Provide end user with something to interact with when they want to
pay offers.
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (41a226c) 0.00% compared to head (e3c58c5) 0.00%.
Report is 2 commits behind head on master.

Files Patch % Lines
src/main.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master     #85   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines          12      16    +4     
======================================
- Misses         12      16    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orbitalturtle
Copy link
Collaborator

@carlaKC Ahh yup this makes sense to me, I think. I'll refactor with this (or something like it) as the base.

.await
.expect("failed to get info")
.into_inner();
pub struct OfferHandler {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm trying to think through a name that'll encompass that this struct is used both for forwarding onion messages (which might not be related to offers) and handling offer specific message. What about naming this something like... InternalOnionMessenger or OnionHandler so it doesn't conflict with LDK's OnionMessenger?

No rush to reply to this, I know you're on vacation haha. Just want to keep track of some of the questions I have here in the meantime...

@carlaKC
Copy link
Collaborator Author

carlaKC commented Jan 30, 2024

Closing this out as it was just an example- @orbitalturtle feel free to take this over / squash your changes as needed.

@carlaKC carlaKC closed this Jan 30, 2024
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