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

[Epic: nwaku] add nwaku into status-go #3076

Open
9 of 29 tasks
Tracked by #203
Ivansete-status opened this issue Sep 17, 2024 · 1 comment
Open
9 of 29 tasks
Tracked by #203

[Epic: nwaku] add nwaku into status-go #3076

Ivansete-status opened this issue Sep 17, 2024 · 1 comment

Comments

@Ivansete-status
Copy link
Collaborator

Ivansete-status commented Sep 17, 2024

Summary

https://github.com/status-im/status-go should operate with waku through nwaku

We need to add a new nwaku submodule within status-go and adapt the current status-go code base plus nwaku-libwaku so that we can have status-go working with nwaku.

There will be changes in:

  • status-go to integrate nwaku
  • nwaku to extend libwaku with the features needed by status-go

Tasks

The following tasks must be reviewed since it's possible some of these are already implemented in nwaku

  • New
    • Merge Config and WakuConfig
    • Expose bandwidth counters from nwaku and integrate with telemetry
    • Expose a topic health status channel in nwaku and integrate
    • Start filter server and lightpush server
    • Determine is additional work is needed for status-go protectedTopicStore
    • Start peer exchange server
  • Check for connection changes
    • Expose a connections channel in nwaku and integrate
    • Use this channel in
      • func (w *Waku) checkForConnectionChanges()
      • func (w *Waku) handleNetworkChangeFromApp(state connection.State)
      • func (w *Waku) ConnectionChanged(state connection.State)
  • DiscV5
    • In nwaku handle backoff with retry for when DNS Discovery fails to respond. (To obtain the bootnodes)
    • Make sure that when connection is lost, and regained after a while (30m or so), DiscV5 works
  • Static nodes
    • In discoverAndConnectPeers directly connect to nodes from w.cfg.WakuNodes or attempt to use DNS Discovery if an enrtree is found
  • Peer exchange
    • Use nwaku in runPeerExchangeLoop. Might not be necessary if nwaku already handles this?
  • Relay
    • Subscribe/Unsubscribe from PubsubTopic
    • Receive messages
  • Peers
    • Implement PeerCount (Currently in go-waku it returns the number of connected peers)
    • Implement func (w *Waku) DialPeer(address multiaddr.Multiaddr)
    • Implement func (w *Waku) DropPeer(peerID peer.ID) error
    • Implement func (w *Waku) PeerID() peer.ID
@gabrielmer
Copy link
Contributor

Discv5 works after being disconnected for a long time - the bootstrap nodes are never removed from the routing tables. We can see the code here

However, after being online again, we don't attempt to connect to the nodes we already found because we have them in backoff period. When we are disconnected, our node thinks the other nodes are faulty because it can't connect to them, but in fact the faulty node is ours. When online again, because of this issue, our node doesn't attempt to connect to them.

We should create a mechanism to recognize when our node is offline and avoid attempting to connect to other nodes whenever that's the case, or at least avoid mischaracterizing well-behaved peers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

3 participants