-
-
Notifications
You must be signed in to change notification settings - Fork 107
feat(connectv2): migrate handshake stack and stabilize river harness #2059
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
Conversation
Tested: cargo test --test message_flow river_message_flow_over_freenet -- --ignored --exact --nocapture Tested: cargo test --test message_flow river_message_flow_over_freenet_six_peers_five_rounds -- --ignored --exact --nocapture
Architecture & Design ReviewConnectV2 Migration: Strong Simplification ✅The handshake.rs reduction from ~1567 lines to ~224 lines is impressive and suggests a successful architectural simplification. The move from complex handshake orchestration to a lightweight adapter pattern should improve maintainability. Strengths:
Questions:
Session Actor Race Condition Fix: Critical Improvement ✅The pending_results: HashMap<Transaction, PendingResult>
delivered_clients: HashSet<ClientId>This deferred delivery pattern ensures results reach late-registering clients, which is essential for the Subscribe operation reliability mentioned in the PR description. Observation: The session_actor test suite includes Code QualityPositive Patterns
Areas for Consideration
Testing & VerificationCI Status: Test job still pending - recommend waiting for full green before final review. River Integration Tests: The PR mentions successful runs of:
This is strong evidence the networking fixes work under realistic multi-hop scenarios. Manual Testing Recommendations:
Risk AssessmentHigh Impact Areas:
Mitigation:
Detailed Findingsclient_events/mod.rs:1155-1189The Subscribe operation now generates the transaction ID before registering with the session actor, fixing the race where operations/connect.rsMassive restructuring (892 additions / 1182 deletions). Would benefit from:
operations/update.rs:198 additionsSignificant expansion - what's the main change here? HTL clamping mentioned in PR description? Recommend adding doc comments for the new logic. ring/connection_manager.rs147 additions suggest substantial refactoring. Key question: How does the new "deduplicated concurrent outbound connection attempts" work? This is mentioned in the PR description but the mechanism isn't clear from the diff snippet. RecommendationsBefore merging:
Post-merge:
For future PRs:
SummaryThis is high-quality, necessary work that addresses real network stability issues River was hitting. The session actor race fix is elegant, and the handshake simplification is architecturally sound. Primary concern: The 49-file scope makes comprehensive review challenging. The changes appear well-tested (River integration passes), but thorough soak testing on multi-peer networks is essential before production use. Verdict: Strong foundation once CI completes. The networking fixes appear solid based on the River test results. Main suggestion is considering stacked PRs for future refactors of this magnitude. [AI-assisted - Claude] |
| self.client_transactions.get(&tx).map_or(0, |s| s.len()) | ||
| ); | ||
|
|
||
| if let Some(result_arc) = self.pending_results.get_mut(&tx).and_then(|pending| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we leak this forever? we never remove from this map?
|
This PR has been replaced by subsequent stacked PRs. |
Why
What changed
ConnectV2 migration
Routing, subscription, and update stability
LocalSubscribeComplete, and allow updates/GET fallbacks to walk past local minima.connection_manager.add_connection, maintenance triggers, and warning cleanup to keep topology state accurate.River integration harness
freenet-stdlibso contracts match the CLI, and preserve per-run artifacts under~/code/tmp/freenet-test-networks/withrun_status.txtsummaries.Testing
cargo check -p freenetcargo test --test operationscargo test --test test_macro_exampleFREENET_CORE_PATH=~/code/freenet/freenet-core/fix-handshake-dedupe cargo test --test message_flow river_message_flow_over_freenet -- --ignored --exactFREENET_CORE_PATH=~/code/freenet/freenet-core/fix-handshake-dedupe cargo test --test message_flow river_message_flow_over_freenet_six_peers_five_rounds -- --ignored --exact(most recent rerun passes; prior failure logs are preserved under the harness artifact directory for debugging)