Skip to content
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

12/WAKU2-FILTER: Handle Client failure #68

Open
jimstir opened this issue Jun 14, 2024 · 0 comments
Open

12/WAKU2-FILTER: Handle Client failure #68

jimstir opened this issue Jun 14, 2024 · 0 comments

Comments

@jimstir
Copy link
Collaborator

jimstir commented Jun 14, 2024

Reference issue: vacp2p/rfc#475
Author: rshiv
Currently a filter node attempts to push messages indefinitely even if the peer client node is offline. A node should be able to drop the peer once it’s determined that a client node is unreachable.

The issue was introduced here #469 .

Acceptance criteria

  • Consensus on how to solve the issue amongst the solutions presented.
  • Update RFC in 12/WAKU2-FILTER

Possible Solutions

The solution of the problem needs to be with the existing libp2p connection between server and client, rather than new connection for heartbeat.

As the waku message handler handles the message push during init , we check for dial failure at that point, which is already implemented to maintain a map as, <peer, offtimestart>, where offtimestart is the first failure epoch. We remove it from peer list if failure persist ,given it exceeds a certain time limit and clear the peer from the map as well.
Time to remove can be configured by the filter node to provide the flexibility of adaptive server node.

Notes

There are 2 more approaches to solve the problem however they have their tradeoffs.

  1. The existing libp2p connection has a callback for connection failure and can be used as a fallback point to stop the message push service and drop the peer. The solution will clean the memory organically as the connections drop, however, as adaptive nodes are expected to be resource restrictive, if we forbid the push request after first failure , it will cause repetitive filter calls.

  2. Adding a heartbeat mechanism using libp2p ping protocol between the peers, which tries the connection every x minutes, failure for 5 times cause the server to drop the peer. This approach will rely on continuous polling which will effect the network bandwith.

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

No branches or pull requests

1 participant