-
-
Notifications
You must be signed in to change notification settings - Fork 107
test: add transient cap regressions and gateway identity check #2122
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
|
@claude Please carefully review this PR, both high-level and the details. |
|
Claude finished @sanity's task —— View job PR Review Complete ✅I've conducted a thorough review of this PR, examining both the high-level architecture and implementation details. Here's my assessment: High-Level AssessmentProblem Statement: Clear and well-articulated. The PR addresses two critical regressions:
Solution Approach: Sound. The changes enforce cap checks during transient promotion and add targeted regression tests to prevent recurrence. Detailed Code Review✅ connection_manager.rs - Major Refactoring (163 additions, 273 deletions)Strengths:
Concerns:
✅ p2p_protoc.rs - Transient Promotion GuardsStrengths:
Minor issue:
✅ New Regression Testsconnection_cap.rs:
gateway_inbound_identity.rs:
✅ Instrumentation Changeslive_tx.rs:
ring/mod.rs:
Potential Issues & Questions
Testing AssessmentTesting claimed: "cargo check -p freenet (local)" Concern: cargo test -p freenet-core --test connection_cap
cargo test -p freenet-core --test gateway_inbound_identity
cargo test -p freenet-core # Full suiteRecommendationsBefore Merge:
Post-Merge:
VerdictArchitecturally sound with good test coverage for the regressions. The refactoring simplifies state management and closes the bypass paths. However, there are implementation details (race condition, duplicate code) that should be addressed before merge. The PR description could be slightly improved per AGENTS.md guidelines—it lists what changed but could better explain why the previous approach (separate counters, separate pending map) was inadequate and what insight led to unifying them. Recommendation: Request changes to fix the duplicate cleanup code and race condition, then approve after verification. |
|
Thanks for the review. The concerns you raised (race in add_connection, duplicate reservation cleanup, restoring unit tests) are addressed in the later slices of this stack—trying to keep this PR narrowly scoped so we don’t churn the stack order. If we need the duplicate cleanup fix here too, I can backport, but it’s already covered in the follow-ups. |
70213aa to
7764539
Compare
Problem
Transient caps and inbound identity handling had regressions: promotion paths could exceed caps and gateways could register inbound peers under placeholder identities. We also lacked targeted diagnostics around neighbor selection and a small-cap repro harness.
This change
Testing