Refactor Stream Protocol ID, Add New Protocol for Epoch Sync to P2P Host #4873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, only shard nodes had an epoch chain, and epoch sync relied on a separate protocol ID while attempting to discover beacon peers based on the last part of the protocol ID. This approach was flawed because stream connections were later rejected due to protocol ID mismatches.
This PR resolves the issue by introducing a dedicated protocol for beacon validators to handle the epoch sync. As a result, the P2P host for beacon validators now supports multiple protocols:
Each protocol operates independently, with its own stream manager and set of discovered nodes, ensuring proper synchronization and preventing connection rejections due to protocol mismatches.