Open champo opened 3 years ago
I also see no mention of the preimageBeacon
logs that indicate the preimage has been recorded, which seems weird.
In my tests, the HTLC seems to have been claimed by lnd
If they were claimed by the lnd
node under your control, then this isn't actually a forward. As a result, it won't come across as a forward since your node is the terminal node (you received the payment).
They are a forward since the next step of the route was claimed by another node (just not a full BOLT compliant node). But rather than argue semantics, what I'd like is to understand where this claim is reflected and how to access it for accounting purpouses. The HTLC intercept API has no feedback on whether the SETTLE
command was successful and we could simply be loosing funds and we have no way to find out AFAICT.
It isn't a question of semantics given both the outgoing edge wasn't fully specified in the onion itself, as your system resolves it manually. A forward as defined within lnd
is something that enters and exits lnd via the existing automated process, you've added an entirely new flow. Therefore the class of transactions you're referring to won't show up in ForwardingHistory
at the outgoing edge is essentially "unknown".
As a result, you'll need to externally account for this "special" case as lnd
doesn't understand (nor does it need to really) what you're doing at a higher level.
If you want to track this progress externally, you can use the ScubrscribeHtlcEvents
call on the router-rpc sub-server. You'll be able to view all HTLC progress from the PoV of the link (the channel) rather than the switch.
the outgoing edge wasn't fully specified in the onion itself
I think you have a misconception here. In our impl the outgoing edge is specified in the onion, LND is not the last hop of the onion but rather the previous one. We are simply implementing the outgoing link via HTTP. All the data ForwardingHistory
needs is present, which is why I expected to find those HTLCs there.
As a result, you'll need to externally account for this "special" case as lnd doesn't understand (nor does it need to really) what you're doing at a higher level.
I dont understand this rationale. As I see it money gets shuffled around by the node and that should be recorded somewhere. It might be "special", but it still is a transaction executed by LND.
ScubrscribeHtlcEvents
Perfect! We can make do with that.
Background
At Muun we're using the HTLC interceptor RPC to settle HTLCs for our implementation of reverse swaps. I'm trying to determine whether the HTLC was properly claimed after the RPC call, but the fwdinghistory CLI command doesn't seem to include these HTLCs. In my tests, the HTLC seems to have been claimed by lnd since the sender received the preimage and the channel balances changed, but there seems to be no other record of this operation.
Your environment
lnd
:0.11.0-beta
Linux lnd-03-mainnet-0 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 Linux
0.19.0
Expected behaviour
See the HTLCs in the fwdinghistory for accounting purpouses.
Actual behaviour
They don't show up.