Skip to content

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Sep 10, 2025

Adds functionality for LSPs to hold onion messages for their clients until they come back online.

Depends on lightningdevkit/rust-lightning#4046

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 10, 2025

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@joostjager joostjager changed the base branch from main to develop September 10, 2025 12:01
@joostjager joostjager requested a review from tnull September 10, 2025 12:12
@joostjager joostjager force-pushed the onion-mailbox branch 2 times, most recently from 8612c01 to d9545a8 Compare September 11, 2025 14:30
@joostjager joostjager self-assigned this Sep 11, 2025
@joostjager joostjager force-pushed the onion-mailbox branch 2 times, most recently from 9818d0c to 89d74d5 Compare September 12, 2025 07:27
@@ -1491,6 +1497,11 @@ impl Node {
Error::PersistenceFailed
})
}

#[allow(missing_docs)]
pub fn om_mailbox_is_empty(&self) -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to expose this to the integration test, but not sure how to do it without introducing an extra cfg flag

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@ldk-reviews-bot
Copy link

🔔 2nd Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

This needs a rebase now.

@joostjager joostjager force-pushed the onion-mailbox branch 2 times, most recently from 8192f71 to a971ee4 Compare September 16, 2025 07:32
@joostjager
Copy link
Contributor Author

Rebased after merge of #621

With the merge of
lightningdevkit/rust-lightning#4049,
it is now possible for a static invoice server to forward the invoice
request to the recipient if they are online.
This introduces an in-memory mailbox to hold onion messages until the
receiver comes online. This is required for async payment
`held_htlc_available` messages.

The mailbox is bounded by a maximum number of peers and a maximum
number of messages per peer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants