-
Notifications
You must be signed in to change notification settings - Fork 144
feat(parachain): Auto-detect V2 peers from AdvertiseCollationV2 (#4711) #4805
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
Open
Yuri0405
wants to merge
9
commits into
ChainSafe:feat/parachain
Choose a base branch
from
Yuri0405:feat/parachain-collation-fetching-v2
base: feat/parachain
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(parachain): Auto-detect V2 peers from AdvertiseCollationV2 (#4711) #4805
Yuri0405
wants to merge
9
commits into
ChainSafe:feat/parachain
from
Yuri0405:feat/parachain-collation-fetching-v2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74ff9d9
to
6e2c20c
Compare
…ng requests (ChainSafe#4711) Implement timeout handling in requestCollation to prevent hanging on unresponsive peers. Includes comprehensive test coverage for timeout and success scenarios.
…re for collation requests (ChainSafe#4711) - Add CollationRequestInfo struct to track request metadata - Implement channel-based communication between request initiation and timeout detection - Add periodic cleanup ticker (10ms) to detect expired requests (100ms timeout) - Track active requests in Run() loop with proper cleanup - Foundation for actual network request cancellation in future commits Related to Polkadot timeout behavior implementation
…llation (ChainSafe#4711) - Use unified maxUnsharedDownloadTime (100ms) for both tracking and network timeouts - Actually cancel network requests when timeout detected in cleanup ticker - Add requestCompletions channel for proper request lifecycle management - Prevents resource leakage from expired requests
…upport for V1/V2 collation request formats with dynamic peer version detection: - Add CollationFetchingRequestV1/V2 with proper SCALE encoding - Add AdvertiseCollationV2 message support - Implement peer version tracking with auto-upgrade capability - Add version-aware request selection logic - Maintain full backward compatibility (default V1) - Handle proper peer lifecycle and cleanup
…ainSafe#4711) - Test V1/V2 peer protocol version management - Validate V2 candidate hash requirement - Add network timeout/success/error scenarios - Fix segfault by removing problematic goroutine calls - Use proper mocking for isolated unit tests Validates that V1 peers use RequestV1 format and V2 peers require candidate hash with RequestV2 format.
…nSafe#4711) - Upgrade peer to ProtocolV2 when receiving V2 advertisement - Remove redundant V1 default in PeerConnected handler - Complete automatic version detection for collation requests
6e2c20c
to
97aaecc
Compare
- Remove validateCollatorHandshake (unused stub) - Remove getCollatorHandshake (unused stub) - Remove decodeCollationMessage (unused stub) - Remove unused pkg/scale import Fixes DeepSource SCC-U1000 issues.
- Update all ValueAt methods to use pointer receivers - Fix CollationFetchingResponse methods - Fix CollationProtocol methods - Fix CollatorProtocolMessage methods Resolves DeepSource RVV-B0013 issue.
- convert all CollatorProtocolMessage methods to pointer receivers - convert all CollationFetchingResponse methods to pointer receivers - convert all CollationProtocol methods to pointer receivers - remove unused receiver variable names Resolves DeepSource issue GO-W1029
1c27c96
to
22b97d4
Compare
Hi @EclesioMeloJunior! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements automatic peer protocol version detection for collation request versioning as described in issue #4711.
Problem
The collator validator-side subsystem needed to support versioned collation requests to accommodate both V1 and V2 protocols, but lacked automatic peer version detection.
Solution
Automatic Version Detection
Version-Aware Request Formatting
Implementation Details
Testing
Verification
Peers now automatically use the correct request format (V1/V2) based on their advertisement capabilities without manual intervention.
Fixes #4711
Files Changed