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

Bug: Makes user wait for the full timeout unnecessarily #173

Open
orbitalturtle opened this issue Sep 9, 2024 · 0 comments
Open

Bug: Makes user wait for the full timeout unnecessarily #173

orbitalturtle opened this issue Sep 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@orbitalturtle
Copy link
Collaborator

orbitalturtle commented Sep 9, 2024

Describe the bug

Sometimes when sending a payment we get the following logs:

2024-09-02T02:31:39.942959744+00:00 INFO lndk::server - Received a request: PayOfferRequest { offer: "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2zfjx7mnpw35k7m3qw3hjqetrd3skjuskyyp9rukfmyt66fshn8mdztq8u66lqc78t5mvr9mmxr90rpqwfcwc20q", amount: Some(10000), payer_note: None, response_invoice_timeout: Some(15) }
2024-09-02T02:31:40.127491291+00:00 DEBUG lndk::lndk_offers - In invoice request, we chose 02981e025eea62bf1ef5643a303edfa287ed4ad236d8604ed340c36ac705ab2ac0 as the introduction node of the reply path
2024-09-02T02:31:40.223949647+00:00 TRACE ldk - Failed to find path when sending OffersMessage
2024-09-02T02:31:40.629845903+00:00 DEBUG lndk::onion_messenger - Peer events sent: PeerConnected(PublicKey(3c851d4e0e84f1ca307b97c1365dc763f0b5e6072cd1f6991726ad17d9c9f2515a60f2335653e7ce1688ac878f7ca90136d06d5ac448536c46fa69667d423152), true).
2024-09-02T02:31:40.629871467+00:00 INFO lndk::onion_messenger - Consume messenger events received: messenger event: 0251f2c9d917ad261799f6d12c07e6b5f063c75d36c1977b30caf1840e4e1d853c connected, onion message support: true.
2024-09-02T02:31:55.129010939+00:00 ERROR lndk - Did not receive invoice in 15 seconds.

Expected behavior: What should happen is once we get to ldk - Failed to find path when sending OffersMessage, the payment should fail and return the error to the user.

Actual behavior: But what actually happens is it waits another 15 seconds for an invoice to come back, and returns a timeout error to the user.

In addition to making the user wait longer than they need to, it also falsely gives users the impression that we already sent the invoice request and the problem is the offer node we're communicating with didn't send back an invoice. When in reality the problem is that we couldn't find a route to send the invoice request.

To Reproduce

This can be replicated on bolt12 playground when paying Eclair2 for the first time (subsequent calls will work properly).

Additional context

Fixing this is a little more complicated than it looks. That's because ldk - Failed to find path when sending OffersMessage is an error that occurs when ldk's DefaultMessengeRouter is called: https://github.com/lightningdevkit/rust-lightning/blob/475f736c22c8dd1b3169bc13c0aa46a558459b7b/lightning/src/onion_message/messenger.rs#L847. So with the way things are setup currently, the only way to handle this error in the OfferHandler is to directly is to override the DefaultMessageRouter. See an example of this here: #172

@orbitalturtle orbitalturtle added the bug Something isn't working label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant