lnd icon indicating copy to clipboard operation
lnd copied to clipboard

multi+refactor: persistent peer manager

Open ellemouton opened this issue 3 years ago • 15 comments

This PR adds a PersistentPeerManager to the server and refactors all persistent peer logic to be handled by the PersistentPeerManager. The end result is that persistentPeers, persistentPeersBackoff, persistentConnReqs and persistentRetryCancels are all removed from the server struct and replaced by a PersistentPeerManager.

ellemouton avatar Sep 07 '21 14:09 ellemouton

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

orijbot avatar Sep 07 '21 14:09 orijbot

def involves more work tho

Mind elaborating? Do you mean in general or specifically in this PR?

My question is, since we are already here, can we move all connection management into peer?

Very happy to do so! Do you think it should all be in 1 PR?

ellemouton avatar Sep 09 '21 07:09 ellemouton

Mind elaborating? Do you mean in general or specifically in this PR?

Meant in this PR. Since we are moving the code outside of server.go, it's finally a good chance to patch the missing unit tests and refactor some of them if needed. But yeah, it would involve more work.

Very happy to do so! Do you think it should all be in 1 PR?

It depends. I'd think about how emergent issue #5377 is. If it's a pressing issue, I'd suggest we move to #5538 and land it first, since it's almost done and has been reviewed. If not, we might as well take the chance to refactor the connection manager here, moving it into its own package. This will def take more time as the scale is large, but we should do it imo. Another option is to continue what you have here, that we move out the persistent manager as the first step. Guess it's a judgment call from @Roasbeef .

yyforyongyu avatar Sep 09 '21 18:09 yyforyongyu

If it's a pressing issue, I'd suggest we move to #5538 and land it first, since it's almost done and has been reviewed

I'd argue it is pressing. I still have a handful of TOR peers that refuse to connect back to me even after almost 4 months. Since many nodes have IP address changes once in a while, I assume they have the same issue without ever noticing it.

viaj3ro avatar Sep 27 '21 13:09 viaj3ro

holding off on this PR until 0.15. Working on the solution in #5538 again instead 👍

ellemouton avatar Sep 27 '21 15:09 ellemouton

I'd also argue it's quite pressing, I have several users of my wallet which have encountered this issue.

hsjoberg avatar Sep 29 '21 23:09 hsjoberg

@hsjoberg a simpler version of this was merged in https://github.com/lightningnetwork/lnd/pull/5538

Roasbeef avatar Oct 07 '21 19:10 Roasbeef

@Roasbeef Thanks! I'm aware that the other PR got into master. 💯

hsjoberg avatar Oct 07 '21 19:10 hsjoberg

!lightninglabs-deploy mute 2022-Jan-01

ellemouton avatar Dec 07 '21 12:12 ellemouton

Is this ready for another round?

yyforyongyu avatar Jan 05 '22 01:01 yyforyongyu

@yyforyongyu, yes it is ready :)

ellemouton avatar Jan 05 '22 07:01 ellemouton

Hi @joostjager ! Thanks so much for the review on this! Im gonna mute the bot on this PR for a bit just while 0.15 is top prio & will address your review as soon as i can 👍

ellemouton avatar Mar 25 '22 13:03 ellemouton

I will push an update addressing all the comments after the review club tomorrow (I decided to change the structure quite a bit so I don't want to push it before the review club in case people are already familiar with the old structure)

ellemouton avatar May 11 '22 15:05 ellemouton

Ok, this is finally ready for re-review :) I have restructured the commits significantly which will hopefully make review easier

ellemouton avatar May 24 '22 14:05 ellemouton

@bhandras: review reminder @roasbeef: review reminder @yyforyongyu: review reminder @ellemouton, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Sep 14 '22 19:09 lightninglabs-deploy

@bhandras: review reminder @roasbeef: review reminder @yyforyongyu: review reminder @ellemouton, remember to re-request review from reviewers when ready

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

@bhandras: review reminder @roasbeef: review reminder @yyforyongyu: review reminder @ellemouton, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Jan 25 '23 00:01 lightninglabs-deploy

!lightninglabs-deploy mute

ellemouton avatar Jan 25 '23 05:01 ellemouton

muting for a bit. Will pick this up again when my plate clears up a bit

ellemouton avatar Jan 25 '23 05:01 ellemouton

closing for now. Can re-open once re-prio'd

ellemouton avatar Jul 27 '23 15:07 ellemouton