lnd icon indicating copy to clipboard operation
lnd copied to clipboard

Enforce channel disable at the link level

Open arshbot opened this issue 4 years ago • 13 comments
trafficstars

This PR tackles https://github.com/lightningnetwork/lnd/issues/5088

To check for disabled channel status, we append the disabled info to ForwardingPolicy on the ChannelLink config and perform a check when performing an HTLC forward.

Known Bugs To Fix

  • [x] rpcServer.UpdateChannelPolicy will reset all ForwardingPolicy for specified channels (including all channels if so set) to Disabled = false
  • [x] UpdatePolicy changes occasionally are not recognized by htlc.Switch, allowing for disabled channels to accept HTLC forwards
  • [x] Proper failure codes are not adequately returned to peers

Pull Request Checklist

  • [X] All changes are Go version 1.15 compliant
  • [x] Your PR passes all CI checks. If a check cannot be passed for a justifiable reason, that reason must be stated in the commit message and PR description.
  • [X] If this is your first time contributing, we recommend you read the Code Contribution Guidelines
  • [X] For new code: Code is accompanied by tests which exercise both the positive and negative (error paths) conditions (if applicable)
  • [X] For bug fixes: If possible, code is accompanied by new tests which trigger the bug being fixed to prevent regressions
  • [X] Any new logging statements use an appropriate subsystem and logging level
  • [X] For code and documentation: lines are wrapped at 80 characters (the tab character should be counted as 8 characters, not 4, as some IDEs do per default)

arshbot avatar Jul 24 '21 00:07 arshbot

Visit https://dashboard.github.orijtech.com?back=0&pr=5565&remote=true&repo=arshbot%2Flnd to see benchmark details.

orijbot avatar Sep 03 '21 01:09 orijbot

@arshbot just chiming in here to let you know that after you merge to master, you'll have the baseline for benchmarks to start appearing :-) If you add it for this repository you'll have all PRs automatically. Currently you won't see results for https://dashboard.github.orijtech.com/benchmark/f1a052eb498a46ccb963655f2c28a360. We plan on actually doing this automatically but that'll be added next week, thanks for trying bencher :-)

@arshbot here is an exhibit of the performance of this repo after the ~latest code at 449f207217bb9d04229c71be5ef7665549f96cd3, changed from https://github.com/lightningnetwork/lnd/commit/031d7b1d556a65d7efc993f194f624216d9f59b3

https://dashboard.github.orijtech.com/benchmark/f599c2cf80b945ef9c2444e0c866c954 Screen Shot 2021-09-02 at 7 14 45 PM

I'll actually file a bug.

odeke-em avatar Sep 03 '21 01:09 odeke-em

Wrapped all the known bugs listed initially, and addressed all PR comments. Ready for another pass!

arshbot avatar Sep 04 '21 04:09 arshbot

Did another pass, couldn't find the merge commit you mentioned (maybe I unintentionally undid it? I've been rebasing like crazy) -- please confirm. In any case, I did rebase to tip.

arshbot avatar Sep 14 '21 20:09 arshbot

At the point the only lingering bit is the addition of FetchOutgoingChannelEdge for unit testing purposes

arshbot avatar Sep 14 '21 20:09 arshbot

Did another pass, couldn't find the merge commit you mentioned

Yeah, a rebase gets rid of such merge commits, so it's gone now :+1:

guggero avatar Sep 14 '21 20:09 guggero

Addressed all comments, redid the commits to work itests into their proper commit messages! Anything left at this point?

arshbot avatar Sep 16 '21 23:09 arshbot

Just did another pass! Was unable to get my docker setup up and running locally, so I'm relying on CI tests atm

arshbot avatar Oct 22 '21 19:10 arshbot

The new itest seems to fail at the moment.

guggero avatar Oct 26 '21 07:10 guggero

Can you re-request review once the itests are fixed please?

guggero avatar Nov 29 '21 12:11 guggero

Sorry, wrong button.

guggero avatar Nov 29 '21 12:11 guggero

Finally came back to this one, PTAL!

arshbot avatar Jan 21 '22 15:01 arshbot

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

lightninglabs-deploy avatar Sep 13 '22 06:09 lightninglabs-deploy

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

lightninglabs-deploy avatar Nov 15 '22 11:11 lightninglabs-deploy

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

lightninglabs-deploy avatar Jul 25 '23 11:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 13:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 14:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 15:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 16:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 17:07 lightninglabs-deploy