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

grpc error and payment claims #332

Open
EricPgh opened this issue Nov 20, 2024 · 8 comments
Open

grpc error and payment claims #332

EricPgh opened this issue Nov 20, 2024 · 8 comments
Assignees

Comments

@EricPgh
Copy link

EricPgh commented Nov 20, 2024

I'm having an issue on a swapin. The state of the active swap on my LBTC node shows:
"state": "State_SwapInSender_AwaitClaimPayment"

The state of my counterpart's lightning node shows:
"state": "State_ClaimedPreimage"

The opening tx has confirmed on mempool for thousands of confirmations. The decoded LN invoice shows my node as destination, I'm running LND. The peerswapd terminal is showing a grpc error constantly since the swapin: [DEBUG] [grpc_conn]: grpc_retry attempt: ####, backoff for 30s, with an increasing number of retries ####.

The pscli is able to connect to the LND RPC. It shows available peer channels and their current channel balances. I don't currently believe the RPC pathway to be at fault. The LND node has been operational for months. The LBTC node is recent but has handled receives from Aqua without a problem.

@grubles
Copy link
Collaborator

grubles commented Nov 20, 2024

Hello, could you share what LND version and peerswap commit you are running?

@EricPgh
Copy link
Author

EricPgh commented Nov 20, 2024

Commit 30c0dfa
lnd version 0.18.0-beta.rc1

Edit:
I wanted to offer my conf file if it helps. I got most from the github docs.
bitcoinswaps=False
lnd.tlscertpath=mypath
lnd.macaroonpath=mypath
lnd.host=127.0.0.1:10009 (I added this line this morning to no avail)
elementsd.rpcuser=me
elementsd.rpcpass=donthackme
elementsd.rpchost=http://127.0.0.1
elementsd.rpcport=7041
elementsd.rpcwallet=peerswap

@EricPgh
Copy link
Author

EricPgh commented Nov 22, 2024

I've checked the preimage against the payment hash on the bolt11 invoice. They match. My lncli lookupinvoice shows the payment as settled. Should I mention I'm not using the docker?
When I restart peerswapd it's adding a new payment watcher for the invoice, looking for 'claim' and immediately logs a grpc_conn problem. LND shows an RPC server on 10009 but a gRPC proxy on 8080. Does peerswap use these differently? It gets most of LND data from RPC but still uses gRPC?

@ElementsProject ElementsProject deleted a comment Nov 25, 2024
@YusukeShimizu
Copy link
Contributor

Thank you for reporting the issue.
I understand that even after restarting, it remains in the state State_SwapInSender_AwaitClaimPayment.

Could you directly provide the logs that seem to be relevant?

In peerswap, the connection with lnd is made via gRPC.

@YusukeShimizu YusukeShimizu self-assigned this Nov 25, 2024
@EricPgh
Copy link
Author

EricPgh commented Nov 25, 2024

fedora:~/peerswap$ peerswapd
[INFO] PeerSwap LND starting up with commit 30c0dfa and cfg: Host localhost:42069, ConfigFile /home/user/.peerswap/peerswap.conf, Datadir /home/user/.peerswap, Bitcoin enabled: false, Lnd Config: host: 127.0.0.1:10009, macaroonpath /run/media/user/mirror/.lnd/data/chain/bitcoin/mainnet/admin.macaroon, tlspath /run/media/user/mirror/.lnd/tls.cert, elements: elements: rpcuser: xxxx, rpchost: http://127.0.0.1, rpcport 7041, rpcwallet: peerswap, liquidswaps: true, lwk config: lwk: signername: defaultPeerswapSigner, walletname: defaultPeerswapWallet, lwkendpoint: http://localhost:32111, electrumendpoint: blockstream.info:465, network: liquid-testnet, liquidswaps: false
[INFO] DB version: v0.2, Protocol version: 3
[INFO] Running with lnd node: <pubkey>
[INFO] Waiting for lnd to be synced...
[INFO] Lnd synced, continue...
[INFO] Bitcoin swaps disabled
[INFO] Liquid swaps enabled
[INFO] [PeerListener]: Start listening for peer events
[INFO] using policy:
allow_new_swaps: true
min_swap_amount_msat: 100000000
reserve_onchain_msat: 0
allowlisted_peers: [<peer pubkeys>]
accept_all_peers: true
suspicious_peers: []
[DEBUG] Waiting for all pending swaps to recover.
[INFO] [MsgListener]: Start listening for custom messages
[INFO] peerswapd grpc listening on localhost:42069
[INFO] peerswapd rest listening on localhost:42070
[DEBUG] Received poll from peer <pubkey>: {"version":3,"assets":["btc","lbtc"],"peer_allowed":true}
[DEBUG] Received poll from peer <pubkey>: {"version":3,"assets":["btc","lbtc"],"peer_allowed":false}
[DEBUG] Received poll from peer <pubkey>: {"version":3,"assets":["btc","lbtc"],"peer_allowed":false}
[DEBUG] Received poll from peer <pubkey>: {"version":3,"assets":["lbtc"],"peer_allowed":true}
[DEBUG] Received poll from peer <pubkey>: {"version":3,"assets":["lbtc"],"peer_allowed":true}
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_SwapInSender_OnSwapInRequested on
[INFO] [Swap:0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43] Start new swap-in: peer: <pubkey> chanId: 870802:1390:1 initiator: <pubkey> amount 400000
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_ActionSucceeded on State_SwapInSender_CreateSwap
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_ActionSucceeded on State_SwapInSender_SendRequest
[DEBUG] [Messenger] From: <pubkey> got msgtype: a459 for swap: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_SwapInSender_OnAgreementReceived on State_SwapInSender_AwaitAgreement
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_ActionSucceeded on State_SwapInSender_BroadcastOpeningTx
[DEBUG] [RedundantSender] start sending messages of type 42077 to <pubkey>
[DEBUG] [FSM] event:id: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43, Event_ActionSucceeded on State_SwapInSender_SendTxBroadcastedMessage
[DEBUG] [PaymentWatcher] Swap: 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43: Add new payment watcher for payreq <invoice> of type "claim"
[DEBUG] [grpc_conn]: grpc_retry attempt: 1, backoff for 30s
[DEBUG] [grpc_conn]: grpc_retry attempt: 2, backoff for 30s
[DEBUG] [grpc_conn]: grpc_retry attempt: 3, backoff for 30s
[DEBUG] [grpc_conn]: grpc_retry attempt: 4, backoff for 30s
[DEBUG] [grpc_conn]: grpc_retry attempt: 5, backoff for 30s
[DEBUG] [grpc_conn]: grpc_retry attempt: 6, backoff for 30s
...

This is the startup log. I'll need to replenish the liquid wallet to initiate another transfer. I was planning to swapout with Strike but I'm getting a different error from pscli:

rpc error: code = Unknown desc = -13:Error: Please enter the wallet passphrase with walletpassphrase first.

When I attempt that swapout. I sent a message to [email protected] to see what they have on their end but haven't heard back. I'll fill the liquid wallet when I can.

@YusukeShimizu
Copy link
Contributor

The situation inferred from the logs is that retries are being repeated in DecodePayReq.
In peerswap, retries occur for errors listed in defaulGrpcRetryCodesWithMsg.

Since it seems that the connection between peerswap and lnd has been successful, one possibility is that the lnd daemon might be in the process of syncing.
Does executing DecodePayReq using lncli succeed?

@EricPgh
Copy link
Author

EricPgh commented Nov 26, 2024

Yes it does. Also I have two swapins that have been freshly settled if there is anything you want to see in the grpc retries.

$ lncli decodepayreq --pay_req <invoice>
{
"destination": "<pubkey>",
"payment_hash": "<pmthash>",
"num_satoshis": "400000",
"timestamp": "1731983155",
"expiry": "3600",
"description": "peerswap lbtc claim <chan_id> 0c29cb927f2204e4e2cbb2734f0c5e241667de2caf2e1cdf1d0056aef2de8a43",
"description_hash": "",
"fallback_addr": "",
"cltv_expiry": "29",
"route_hints": [],
"payment_addr": "3f7397286157cf00c94bf805f4a72e02656d1da7d4db1a1e35ccf1e28560db57",
"num_msat": "400000000",
"features": {
"8": {
"name": "tlv-onion",
"is_required": true,
"is_known": true
},
"14": {
"name": "payment-addr",
"is_required": true,
"is_known": true
},
"17": {
"name": "multi-path-payments",
"is_required": false,
"is_known": true
},
"25": {
"name": "route-blinding",
"is_required": false,
"is_known": true
}
}
}

@YusukeShimizu
Copy link
Contributor

Does the invoicesrpc package included when installing lnd?
The build is described in Installing lnd from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants