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/sync,p2p: chain tip block fetch improvements #12224

Merged
merged 14 commits into from
Oct 8, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Oct 4, 2024

relates to #12182

improves p2p block fetching performance at tip by:

  • fetching blocks corresponding to new block hashes event using a new method FetchBlocksBackwardsByHash instead of by number because when fetching by number the peer responds with the canonical block which in some cases may not be the same block as the hash in the new block hashes event causing us to miss adding a block to our canonical chain builder
  • adds an option to override default fetcher configs related to p2p request retries, timeout, etc - at tip we want 1 sec timeout (instead of 5) when calling FetchBlockByHash and 0 retries (there will be more block events in the queue after it) to maximise performance
  • adds some additional helpful logging for debugging purposes

After PR things look much better
Screenshot 2024-10-08 at 10 21 22

@taratorio taratorio marked this pull request as ready for review October 8, 2024 08:46
@taratorio taratorio enabled auto-merge (squash) October 8, 2024 09:06
@taratorio taratorio merged commit 4d3b905 into main Oct 8, 2024
11 checks passed
@taratorio taratorio deleted the astrid-fetch-blocks-options-on-tip branch October 8, 2024 09:26
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.

2 participants