-
-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
A-developer-xpArea: developer experienceArea: developer experienceA-networkingArea: Networking, ring protocol, peer discoveryArea: Networking, ring protocol, peer discoveryE-hardExperience needed to fix/implement: Hard / a lotExperience needed to fix/implement: Hard / a lotP-highHigh priorityHigh priorityT-featureType: New functionality requestType: New functionality request
Description
Problem
Current test coverage focuses on small networks (2-3 peers). The recent #2164 refactor series (PRs #2167-2172) changes core routing and connection handling, but we lack tests that verify behavior at scale.
What Needs Testing
-
Network Topology Formation
- Peers should form a mesh topology, not a star (all connected to gateway only)
- Each peer should have multiple connections (min_connections target)
- Connection acquisition should complete in reasonable time
-
Subscription Tree Formation
- When multiple peers subscribe to a contract, proper tree structure should form
- Updates should propagate through the tree efficiently
- Unsubscribe should prune branches correctly
-
Seeding Mechanism
- Contract state should be retrievable from any peer in the network
- Put operations should seed to appropriate locations
- Get operations should find seeded state
-
NAT Traversal at Scale
- Multiple NAT peers should successfully join
- Peers behind NAT should be reachable for subscriptions
- Connection handoff between peers should work
Current Best Test
The 6-peer River message flow test with Docker NAT simulation (docker-nat-sim work) is our most comprehensive test. We should expand on this pattern.
Proposed Tests
Phase 1: 50-Peer Network
-
Topology Health Test
- Start 50-peer network, wait for stabilization
- Verify each peer has >= min_connections
- Verify no star topology (peers connected to more than just gateway)
- Measure time to reach stable state
-
Subscription Propagation Test
- Put contract at one peer
- Subscribe from ~20 peers at different network locations
- Update contract and verify all subscribers receive update
- Measure propagation latency
-
Seeding Distribution Test
- Put contracts targeting different ring locations
- Verify state is retrievable from peers that didn't originate the put
- Test get from peers far from contract location
Phase 2: 200-Peer Network
-
Scale Topology Test
- Verify topology formation at 200 peers
- Measure connection acquisition time distribution
- Identify bottlenecks
-
Subscription Tree Depth Test
- With 200 peers, subscription trees should have meaningful depth
- Verify update propagation through deep trees
- Test branch pruning behavior
-
Mixed NAT Network Test (100 public, 100 NAT peers)
- Verify NAT peers can subscribe and receive updates
- Verify operations route correctly through NAT peers
Implementation Notes
- Use
freenet_testmacro framework or standalone harness - May need Docker/container orchestration for 200 peers
- Should run as separate CI job (not blocking normal CI)
- Consider metrics collection for performance analysis
Related
- Issue fix: Star topology formation due to serialized connection acquisition #2173 (star topology due to serial connection acquisition)
- PR refactor: Restructure peer identity and address handling #2164 series (connection-based routing refactor)
- Existing
six-peer-regressiontest
[AI-assisted - Claude]
Metadata
Metadata
Assignees
Labels
A-developer-xpArea: developer experienceArea: developer experienceA-networkingArea: Networking, ring protocol, peer discoveryArea: Networking, ring protocol, peer discoveryE-hardExperience needed to fix/implement: Hard / a lotExperience needed to fix/implement: Hard / a lotP-highHigh priorityHigh priorityT-featureType: New functionality requestType: New functionality request
Type
Projects
Status
Triage