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

Improve P2P Stream Handling & Stream Sync Enhancements #4762

Merged
merged 32 commits into from
Oct 24, 2024

Conversation

GheisMohammadi
Copy link
Contributor

@GheisMohammadi GheisMohammadi commented Sep 24, 2024

Issue

This PR introduces several key improvements to the P2P stream handling and Stream Sync mechanisms, focusing on stability, error handling, and code optimization. Key changes include:

  • Enhanced stream error handling for more visibility.
  • Optimized pickAvailableStream to continue searching for other available streams when one fails.
  • Refactored the stream request manager, including a Safe Map to ensure thread-safety.
  • Improved logic for switching between short-range and long-range syncing.
  • Optimized computeLongestHashChain and its whitelist functionality.
  • Improved countHashMaxVote for accurate vote calculations on a specific hash.
  • Added new configurations to better support staged stream sync.
  • Fixed issues with Beacon Node and Epoch Chain detection.
  • Introduced new metrics to monitor stream sync performance.
  • Enhanced lock management and concurrency control.
  • Passing the node roles throughout the stream protocol for better context awareness.
  • Refined stream sync short-range helper functions.
  • Improved the stream shutdown and cool-down processes, ensuring smooth terminations and halting unnecessary discoveries.
  • Comprehensive stream manager refactor for improved readability and maintainability.
  • Added more meaningful logs while removing unnecessary log entries or fields.

@GheisMohammadi GheisMohammadi self-assigned this Sep 24, 2024
@GheisMohammadi GheisMohammadi marked this pull request as draft September 24, 2024 13:42
@GheisMohammadi GheisMohammadi force-pushed the fix/staged_stream_sync_getblock_failure branch from d29a4c4 to 7475e83 Compare September 26, 2024 12:16
@GheisMohammadi GheisMohammadi force-pushed the fix/staged_stream_sync_getblock_failure branch 2 times, most recently from 653d129 to 2bea886 Compare October 4, 2024 09:43
@GheisMohammadi GheisMohammadi changed the title Fix localnet stream connections Improve P2P stream layer Oct 4, 2024
…ochChain config to detect epochcian in stages, add acceptPartially to GetBlockHash to be able to get a part of hashes
@GheisMohammadi GheisMohammadi force-pushed the fix/staged_stream_sync_getblock_failure branch from 2bea886 to 773376a Compare October 9, 2024 09:53
@GheisMohammadi GheisMohammadi changed the title Improve P2P stream layer Improve P2P Stream Handling & Stream Sync Enhancements Oct 11, 2024
@GheisMohammadi GheisMohammadi marked this pull request as ready for review October 11, 2024 04:47
@sophoah
Copy link
Contributor

sophoah commented Oct 23, 2024

@Frozen please review/approve

@sophoah sophoah merged commit 2274c29 into dev Oct 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants