lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.63k stars 2.07k forks source link

Route Blinding Receive: follow ups #8965

Closed ellemouton closed 1 month ago

ellemouton commented 1 month ago

Issue just to track adding some UX improvements for route blinding receives before we ship them in 0.18.3.

Shout out to @Roasbeef for all the testing & suggestions. Linking the main points here:

I'll get on these first thing Monday ⚡

Roasbeef commented 1 month ago

One other request: a tester tried to pay an invoice from an unupdated node and got "no route found". We should do stricter checks up front to detect that there's an unknown required feature bit, error'ing out with a nice message.

ellemouton commented 1 month ago

a tester tried to pay an invoice from an unupdated node and got "no route found". We should do stricter checks up front to detect that there's an unknown required feature bit, error'ing out with a nice message.

cool yeah we actually already do the strict check so it's just a matter of a nicer error message.

https://github.com/lightningnetwork/lnd/blob/c46b1a467afd96109c9e5f1fced1eae8aed6c98d/routing/payment_session.go#L107-L117

where we switch out errUnknownRequiredFeature to channeldb.FailureReasonNoRoute

The issue is that we persist things as channeldb.FailureReasonNoRoute... so i dont think its as simple as adding a new channeldb Failure reason since then past errors are inconsistent with newer ones.

So perhaps rather a matter of just passing the noRouteError back through to the CLI so the user can see this more useful error

ellemouton commented 1 month ago

ok the error message for the above should be more clear now with the latest update in the PR. the only thing is that this will only be useful for the next unknown feature bit since any node that has updated to the code with the better error message will also understand the route blinding feature bit 🤓

ellemouton commented 1 month ago

regarding this suggestion:

Command to unblind blinded paths as the creator. Can be useful for debugging.

This will be covered in PR 4 of the series (outlined here

This PR will start persisting blinded route information with the invoice. So this will be a good place to address this suggestion i think.

For now though, I added logging of chosen paths so that you can at least tell which paths have been chosen. Example:

[DBG] BLPT: Route selected for blinded path: [02cfe333599d4ecbe15673981b66121369dde97c5a72b6ba261f03cc2f96dff2ce (intro node)]--<485984139673600>-->[0360771d81f5a3d4bdc5cac0c46b946a572684ae66b8d30ab1774b18d9219d6f36]--->[dummy hop]