Skip to content
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/p2p: fix issues found during testing #9872

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

taratorio
Copy link
Contributor

Fixes problems found during bor-mainnet sync tests:

  • FetchHeaders: paging-like fetching of headers from a peer - assumption was that a peer response will contain all e.g. 1024 headers since they can fit in < 2 MB however despite that some peers respond with only 16 headers so we need to send further requests until we get all e.g. 1024 headers
  • It looks like another assumption didn't hold - when we penalize a peer sentry doesn't generate a disconnect even. For that this PR creates a tracking penalizer that updates the peer tracker with a disconnect.
  • Removes another wrong incorrect - ErrEmptyBody validation because there are blocks which are empty, e.g. first 100,000k blocks
  • Sentry SentMessageById was disallowing GetBlockBodiesMsg, this PR fixes this

@@ -262,3 +264,7 @@ func notifyObservers[TMessage any](observers map[uint64]MessageObserver[TMessage
go observer(message)
}
}

func messageListenerLogPrefix(message string) string {
return fmt.Sprintf("[p2p.message.listener] %s", message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could this be solved by a new logger?

@battlmonstr battlmonstr merged commit dd53519 into devel Apr 8, 2024
7 checks passed
@battlmonstr battlmonstr deleted the astrid-p2p-testing-fixes branch April 8, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants