efsn icon indicating copy to clipboard operation
efsn copied to clipboard

eth/downloader: not fetch older peer

Open zhiqiangxu opened this issue 3 years ago • 5 comments

Seems there's no point trying to fetch a peer whose td is smaller.

zhiqiangxu avatar Oct 13 '22 08:10 zhiqiangxu

Not sure the change is needed or not. Because before fetch the part, the downloader already check the peer's TD, if less than local, it will drop the peers.

BTW, the eth/downloader module was forked from ethereum, I didn't see the same logic on the their side.

fanbsb avatar Oct 14 '22 07:10 fanbsb

Not sure the change is needed or not. Because before fetch the part, the downloader already check the peer's TD, if less than local, it will drop the peers.

BTW, the eth/downloader module was forked from ethereum, I didn't see the same logic on the their side.

Hopefully this PR will fix an issue I met: I set up two nodes, one(call it A) only connects to the other(call it B), while B connects to others via bootstrap nodes. I saw A often disconnected by B when chosen as an idle peer to fetch from.

zhiqiangxu avatar Oct 14 '22 08:10 zhiqiangxu

I will try to reproduce the issue later, see if the issue fixed by this pr or not

fanbsb avatar Oct 14 '22 08:10 fanbsb

Have you tried to add the Node B as a static node in Node A's peer list?

fanbsb avatar Nov 03 '22 07:11 fanbsb

Have you tried to add the Node B as a static node in Node A's peer list?

Yes,A has B in static peer list, and disabled discovery so it only connects B.

zhiqiangxu avatar Nov 03 '22 14:11 zhiqiangxu