lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
506 stars 90 forks source link

Litd crashes when paying an asset invoice while connected to the demo price oracle. #876

Open HannahMR opened 1 day ago

HannahMR commented 1 day ago

When running the demo price oracle along side litd I am able to use the oracle to return RFQ info and have a connected node generate invoices with my node as the rfq peer, however, when I go to pay that invoice litd crashes.

Expected behavior

What I am expecting is to pay the invoice without litd crashing and for litd to communicate with the oracle and to reliably return rfq data on request.

Actual behavior

When connected to the price oracle litd crashes when paying an asset invoice.

System information

I am running lightning-terminal-v0.13.995-experimental in integrated mode via systemd on a Ubuntu server. Also on that same server I am running the price oracle as a separate systemd service. I'm running the latest version of the demo price oracle found in PR 1140. The oracle is listening on port 8095. Litd is aware of the oracle via this config line in my lit.conf file...

taproot-assets.experimental.rfq.priceoracleaddress=rfqrpc://127.0.0.1:8095

rate = 63000000 is the current setting in the demo price oracle on my machine.

To reproduce

I have two testnet3 nodes running. Node1 is the one that is running the price oracle. Node2 is set to accept rfq quotes from Node1.

On Node2 I am generating an asset invoice using this command:

$ litcli --network=testnet --macaroonpath=~/.lnd/data/chain/bitcoin/testnet/admin.macaroon ln addinvoice --memo "helpful memo" --asset_id a75bf2f898071c7897e496a10e70fab6aad26ca38b9e744f6838cb2d862543c2 --asset_amount 5000 --rfq_peer_pubkey 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b

This successfully generates an asset invoice. On Node1 I then attempt to pay that invoice using the below command:

$ litcli --network=testnet --tlscertpath ~/.lit/tls.cert --macaroonpath ~/.lnd/data/chain/bitcoin/testnet/admin.macaroon ln payinvoice --outgoing_chan_id 3160297684414758912 --pay_req [invoice] --asset_id a75bf2f898071c7897e496a10e70fab6aad26ca38b9e744f6838cb2d862543c2

I have also tried this using the --rfq_peer_pubkey flag.

The command hangs and litd crashes.

This is generally what I find in the logs shortly before the crash:

[WRN] RFQS: Unable to unmarshal channel asset data: unexpected end of JSON input

full logs attached. rfqcrashOct11lnd.log

dstadulis commented 1 day ago

@hannahmr Were you running this with systemd or within a shell.

Team is trying to determine if the daemon actually panicked (in which case the trace would have been dumped to stderr) or merely halted.

if the process was running in a shell and you have the trace, will you please share that?

ffranr commented 1 day ago

I think that the relevant crash trace is missing from the log file. So we should pipe stdout and stderr from litd and litcli to separate files:

command &> outputfile

or

command > outputfile 2>&1

So maybe we run litcli command as:

litcli --network=testnet --macaroonpath=~/.lnd/data/chain/bitcoin/testnet/admin.macaroon ln addinvoice --memo "helpful memo" --asset_id a75bf2f898071c7897e496a10e70fab6aad26ca38b9e744f6838cb2d862543c2 --asset_amount 5000 --rfq_peer_pubkey 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b > litcli-outputfile.log 2>&1

And then modify the litd run command in the same way.

dstadulis commented 8 hours ago

Alternative @HannahMR

# Start LND and background the process
nohup lnd&