-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
polygon/sync: implement header downloader #9030
Conversation
} | ||
} | ||
|
||
type BlockDownloader struct { |
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.
pending unit tests: wip
d7a1d18
to
0463fca
Compare
…strid-download-blocks
peers := hd.choosePeers(allPeers, statePoints) | ||
if len(peers) == 0 { | ||
hd.logger.Warn( | ||
fmt.Sprintf("[%s] can't use any peers to sync, will try again", headerDownloaderLogPrefix), |
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.
@battlmonstr if this ever happens, ie we have all 100 max peers but all are not synced enough (highly unlikely I suppose but possible) we can add a sentry function to temporarily disconnect them for some time interval so we can connect to others that may be synced further ahead - what do you think? would a disconnect be the same as penalize in this case or penalized means we will never connect to the penalized peer again in the future?
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.
work for a future PR regardless
|
||
import "github.com/ledgerwatch/erigon/core/types" | ||
|
||
type HeaderVerifier func(statePoint *statePoint, headers []*types.Header) error |
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.
will implement in subsequent PR
No description provided.