Skip to content

polygon/sync: implement header downloader#9030

Merged
mh0lt merged 20 commits intodevelfrom
astrid-download-blocks
Dec 22, 2023
Merged

polygon/sync: implement header downloader#9030
mh0lt merged 20 commits intodevelfrom
astrid-download-blocks

Conversation

@taratorio
Copy link
Copy Markdown
Member

No description provided.

@taratorio taratorio marked this pull request as draft December 19, 2023 16:27
@taratorio taratorio changed the title polygon/blocksyncer: v1 implementation polygon/blocksync: v1 implementation Dec 19, 2023
}
}

type BlockDownloader struct {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending unit tests: wip

@battlmonstr battlmonstr changed the base branch from devel to pr/astrid_sync December 20, 2023 08:17
Base automatically changed from pr/astrid_sync to devel December 20, 2023 15:48
@taratorio taratorio changed the title polygon/blocksync: v1 implementation polygon/sync: implement header downloader Dec 20, 2023
@taratorio taratorio requested a review from mh0lt December 21, 2023 18:30
@taratorio taratorio marked this pull request as ready for review December 21, 2023 18:31
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),
Copy link
Copy Markdown
Member Author

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?

Copy link
Copy Markdown
Member Author

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
Copy link
Copy Markdown
Member Author

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

@mh0lt mh0lt merged commit 64072ce into devel Dec 22, 2023
@mh0lt mh0lt deleted the astrid-download-blocks branch December 22, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants