Skip to content

Reproduce Update Propagation Issues with Peer Blocking Tests #1592

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

Merged
merged 36 commits into from
May 16, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Reproduce Update Propagation Issues with Peer Blocking Tests

Overview

This PR implements tests that successfully reproduce the update propagation issues seen in the live Freenet network. Using the peer blocking functionality from PR #1581, we've created tests that simulate a network where peers are connected through a gateway but not directly to each other, which better represents the topology of the live network.

Findings

Our tests confirm the hypothesis that updates and subscriptions are unreliable when peers are not directly connected:

  1. In the standard test network, every peer connects to every other peer (densely connected)
  2. In the live network, peers are often only indirectly connected through gateways
  3. When using peer blocking to prevent direct connections, we observe the same update propagation failures seen in production

Specifically, we found that:

  • Updates from Node1 often fail to reach Node2 through the Gateway
  • The issue is intermittent, matching the behavior seen in the live network
  • Multiple update attempts with increasing delays improve reliability but don't fully solve the issue

Implementation Details

This PR includes several test implementations:

  1. run_app_blocked_peers.rs - Basic implementation of peer blocking test
  2. run_app_blocked_peers_optimized.rs - Optimized version with reduced timeouts
  3. run_app_blocked_peers_debug.rs - Enhanced logging for subscription operations
  4. run_app_blocked_peers_reliable.rs - Multiple update rounds with increasing delays

Test Results

The debug test clearly shows the issue:

Node1 did not see Node2's update through Gateway

This matches the behavior reported in the live network where users cannot join rooms about 2/3 of the time.

Next Steps

Potential solutions to investigate:

  1. Implement retry mechanisms for update propagation
  2. Add explicit acknowledgment of updates between peers
  3. Increase timeouts for update propagation in the gateway
  4. Improve the subscription mechanism to be more resilient to network topology changes

Related Issues

This PR is related to the subscription reliability issues in the Freenet network, particularly in applications like River where users cannot join rooms reliably.

Link to Devin run

https://app.devin.ai/sessions/d77861025c92420e8806849f463924ef

Requested by: Ian Clarke (ian.clarke@gmail.com)

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@sanity sanity marked this pull request as draft May 13, 2025 04:27
@iduartgomez
Copy link
Collaborator

This seems good first glancve, but there is a lot of new code here which seems redundant?:
would be nice to have a summary of what each test is testing and refactor common code where possible

Copy link
Collaborator

@iduartgomez iduartgomez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanity This seems good first glance, but there is a lot of new code here which seems redundant?

would be nice to have a summary of what each test is testing and refactor common code where possible

devin-ai-integration bot added a commit that referenced this pull request May 13, 2025
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
devin-ai-integration bot added a commit that referenced this pull request May 13, 2025
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
devin-ai-integration bot and others added 20 commits May 15, 2025 19:46
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
… logging

Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
devin-ai-integration bot and others added 14 commits May 15, 2025 19:46
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
…tion

Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
…sing TTL and wait times

Co-Authored-By: Ian Clarke <github@ian.33mail.com>
…ving current state before updates

Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
Co-Authored-By: Ian Clarke <github@ian.33mail.com>
@iduartgomez iduartgomez force-pushed the devin/1747086420-optimized-peer-blocking-test branch from e036c59 to 2e278d8 Compare May 15, 2025 19:16
@iduartgomez iduartgomez marked this pull request as ready for review May 16, 2025 11:05
@iduartgomez iduartgomez enabled auto-merge (squash) May 16, 2025 11:06
@iduartgomez iduartgomez disabled auto-merge May 16, 2025 11:06
@iduartgomez iduartgomez merged commit 82451d7 into main May 16, 2025
6 checks passed
@iduartgomez iduartgomez deleted the devin/1747086420-optimized-peer-blocking-test branch May 16, 2025 11:07
@iduartgomez
Copy link
Collaborator

I cleaned up quite a lot all this stuff and got it working, added the tests are ignored for now cause they are NOT passing and we need to fix em, but are useful for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant