lnd icon indicating copy to clipboard operation
lnd copied to clipboard

Return `FEE_INSUFFICIENT` before checking balance for incoming low-fee HTLCs

Open tvolk131 opened this issue 3 years ago • 5 comments

Change Description

Incoming HTLCs with lower-than-advertised fees are rejected before checking if the channel balance is sufficient to route the payment. This helps to prevent channel probing.

Fixes #5721.

Steps to Test

Undoing the changes in link.go (basically moving the call to canSendHtlc above if incomingHtlcAmt < amtToForward || actualFee < expectedFee ...) should cause the new test in link_test.go to fail.

tvolk131 avatar Apr 15 '22 14:04 tvolk131

I updated the release notes to 0.16.0!

Hmmm that's strange, I feel like that test could be related to this change. I'll dig into that a bit and see what I can find.

tvolk131 avatar May 26 '22 19:05 tvolk131

Circling back to this... I took a look at that test, but I wasn't able to get it to fail using make unit pkg=htlcswitch. @carlaKC could you show me how/where it's failing? I did rebase recently, so maybe that fixed it if it was an unrelated failure.

tvolk131 avatar Jun 19 '22 18:06 tvolk131

could you show me how/where it's failing?

It was failing in the last build when I reviewed (I think CI / run unit tests (btcd unit-cover), but don't remember). Everything green now, so it's probably an unrelated flake.

carlaKC avatar Jun 20 '22 08:06 carlaKC

!lightninglabs-deploy mute 2023-Feb-01

yyforyongyu avatar Sep 29 '22 10:09 yyforyongyu

@tvolk131, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Nov 01 '22 00:11 lightninglabs-deploy

!lightninglabs-deploy mute 2023-Mar-01

yyforyongyu avatar Feb 15 '23 10:02 yyforyongyu

@tvolk131, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Mar 08 '23 00:03 lightninglabs-deploy

Replaced by #7490

yyforyongyu avatar Mar 08 '23 06:03 yyforyongyu