graphops / graphcast-sdk

Graphcast SDK allows you to build gossip-powered Radios
https://docs.graphops.xyz/graphcast/intro
Apache License 2.0
17 stars 3 forks source link

[Feat.Req] Enable relay network with pubsub sharding #295

Closed hopeyen closed 1 year ago

hopeyen commented 1 year ago

Problem statement

Currently the radio nodes utilize filter and lightpush gossip protocols and rely on waku nodes hosted by us. The hosted nodes were solely responsible for relaying messages between all the radios nodes, and the traffic is becoming too heavy to handle for them. We need a way for the network to scale without the limitations from our hosted nodes.

Expectation proposal

Currently we have pubsub topic split into Graphcast mainnet and testnet, while utilizing content topics with radio_name/version/identifier where the identifier is usually a subgraph deployment hash.

Required

Expansion (can move to a separate issue focused on sharding)

Alternative considerations

Additional context Network sharding: https://rfc.vac.dev/spec/51/

vpavlin commented 1 year ago

The described approach sounds reasonable! Definitely more scalable than radios only relying on Lightpush&Filter.

Keep in mind that if you ever decide to change number of shards, the contentTopic -> shar mapping will change. I don't think that is a huge problem for you, but just to be aware that during this change being applied to the network there might be some messages travelling to 2 different pubsub topics, so the delivery might be unreliable until the whole network is upgraded.

We are trying to solve it by introducing a generation number in the content topic, so that if we need to add shards, they'll be on the gen+1, so the old topics mapping will still apply