Skip to content

channel update from onion error for private channel is discarded #2066

@SomberNight

Description

@SomberNight

I am paying lnd1 -> lnd2 -> electrum, where the last channel is private.
The invoice contains an r field for this private channel, but the content of this r field is not up-to-date (i.e. fee_base_msat, fee_proportional_millionths, cltv_expiry_delta are incorrect).

lnd1 attempts the payment, gets back the htlc failure/onion error, but then does NOT retry with the new channel update from the onion error payload.

0.5.0-beta commit=v0.5-beta-133-gd52e691d5f051153b4fd07db40309a54ea56ef9a-dirty

$ lncli -n regtest --lnddir=~/.lnd2 --rpcserver localhost:10011 sendpayment --pay_req=lnbcrt5u1pdu324dpp5qjyfmf8f59euhhyn6zctctn737ehu5ppxkz0chfnr9e33srfc33qdqqcqzysrzjqtsxecaeca06399tv9953ae503pufh48j7jzfrmau4xmr2n4sef3cqq89vqqqqsqqqqqqqqqqqqqqqqqqyxhkn45fshhjlwkgqkxjm7huq8kzl6934m4xvjxs2nkwwxkzq2wypxsej4wf30ug8lp4cltg6aqzhq8qzzw0qjlxs5dn8dh3t26mgj3qqwdupkq
Description: 
Amount (in satoshis): 500
Destination: 022cdc2c2c0409cf30c2a524024ae7d6555794612c1722f0e1970bca3337de3c03
Confirm payment (yes/no): yes
{
	"payment_error": "unable to route payment to destination: FeeInsufficient(htlc_amt==500000 mSAT, update=(lnwire.ChannelUpdate) {\n Signature: (lnwire.Sig) (len=64 cap=64) {\n  00000000  5d b0 1f ad 09 d5 44 97  66 54 b4 ea 42 74 cf 5a  |].....D.fT..Bt.Z|\n  00000010  2f 85 a7 9d 2d 30 2a b1  43 eb f7 88 38 fc a1 e2  |/...-0*.C...8...|\n  00000020  58 20 fc 5c 5f f8 66 25  11 d5 38 80 f4 aa 65 23  |X .\\_.f%..8...e#|\n  00000030  cf e7 28 34 cb 87 97 0e  de 37 7c 66 45 63 76 82  |..(4.....7|fEcv.|\n },\n ChainHash: (chainhash.Hash) (len=32 cap=32) 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206,\n ShortChannelID: (lnwire.ShortChannelID) 1835:2:0,\n Timestamp: (uint32) 1539718276,\n Flags: (lnwire.ChanUpdateFlag) 1,\n TimeLockDelta: (uint16) 144,\n HtlcMinimumMsat: (lnwire.MilliSatoshi) 0 mSAT,\n BaseFee: (uint32) 1000,\n FeeRate: (uint32) 1,\n ExtraOpaqueData: ([]uint8) \u003cnil\u003e\n}\n",
	"payment_preimage": "",
	"payment_route": null
}

Background: I am trying to work around this issue #1347 by intentionally filling the r field with incorrect data (specifically, base_fee 0, feerate 0, cltv 1).
The expected behaviour would be for lnd1 to retry the payment with the channel update from the onion payload.

This "workaround" is also mentioned in lightning/bolts#188 (comment) where it is said that

this is already possible today.

(15 months ago :) )

It is worth mentioning that even if #1347 gets fixed, this situation can still arise, if the data in the invoice gets out of date (which is a natural race condition).

Metadata

Metadata

Assignees

Labels

P1MUST be fixed or reviewedenhancementImprovements to existing features / behaviourpaymentsRelated to invoices/paymentsroutingv0.13

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions