-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: block sync hangs on initial node start #1314
Conversation
@@ -81,14 +111,10 @@ defmodule LambdaEthereumConsensus.P2P.Peerbook do | |||
defp prune() do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do something similar to the peer selection in the pruning and just prune the lower score ones but is probably something to tackle in a PR that focus on the peer-scoring algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Motivation
This PR tries to fix the hanging that happens often in Sepolia, specially at the first Sync.
Description
The issue was related to peer scoring/penalizing, right now we had a naive implementation where penalization immediatly removed a peer. I made some small changes to have a better scenario, specially on Sepolia where this issue happen the most. Ultimately what made the node hang was getting out of peers and ending in a sleep cycle that never released LibP2P to handle incoming new peers. The points tackled are:
This PR is enough for most situations, it will be rare to end up with an empty peerbook, and in case it happens we'll see an error quickly, failing instead of leaving us waiting. There are some follow-ups but are lower in priority than for example #1309:
Resolves #1308