js-waku icon indicating copy to clipboard operation
js-waku copied to clipboard

feat: Deprecate Named Sharding and Update Lightpush Client API

Open chair28980 opened this issue 1 year ago • 11 comments

In the context of discussions around named sharding and peer management for the Waku network, it is proposed to make the following changes to the Waku Network:

  1. Deprecate Support for Named Sharding:
  • It is recommended to remove support for named sharding.
  • Peer management should ensure that only peers supporting sharded topics are connected.
  1. Lightpush Protocol Updates:
  • The lightpush protocol itself should never be aware of the sharded format of pubsub topics. It is an extension of libp2p's gossipsub.
  • On a protocol level, the lightpush service node needs to handle requests on unsupported pubsub topics by returning a clear error code.
  1. Lightpush Client API Changes:
  • To maintain adherence to the sharded format, the lightpush client API should be updated.
  • New proposed format: lightPublish(WakuMessage, ClusterID, ShardNumber)
  • For legacy requests on named topics, the API could use a trial and error process to send the request to random service nodes. This can be done using the format: lightPublish(WakuMessage, PubsubTopic)
  • A request format that bypasses our peer management/selection: lightPublish(WakuMessage, PubsubTopic, ServiceNodeMultiaddr)

  • Users of custom pubsub topics should select a cluster id.
  • Use static sharding until the launch of The Waku Network.
  • Default Pubsub topic support remains for now, to be phased out as a later step

Acceptance Criteria:

  • [x] Remove support for named sharding (except for default pubsub topic)
  • [ ] Update lightpush protocol to handle unsupported pubsub topics with clear error codes.
  • [ ] Introduce the new lightpush client API as mentioned above.
  • [ ] Update documentation to reflect these changes and guide users accordingly.

chair28980 avatar Oct 26 '23 05:10 chair28980

To maintain adherence to the sharded format, the lightpush client API should be updated. New proposed format: lightPublish(WakuMessage, ClusterID, ShardNumber) For legacy requests on named topics, the API could use a trial and error process to send the request to random service nodes. This can be done using the format: lightPublish(WakuMessage, PubsubTopic) A request format that bypasses our peer management/selection: lightPublish(WakuMessage, PubsubTopic, ServiceNodeMultiaddr)

For js-waku, we use Encoders and Decoders to encapsulate the pubsub topic -- IMO: this change should be added on the createEncoder and createDecoder, and converted to a string for the protocol. All the error handling should be done on the createEncoder/Decoder function. An example of this looks like: https://github.com/waku-org/js-waku/pull/1697/commits/a75a66b3d33aa452f459776e29b900831973bbf9

cc @fryorcraken

danisharora099 avatar Nov 01 '23 16:11 danisharora099

Weekly Update

  • achieved: PR ready and currently in review-iteration phase ( #1697 )
  • next: to be merged

danisharora099 avatar Nov 27 '23 20:11 danisharora099

FYI https://github.com/waku-org/js-waku/issues/1749#issuecomment-1839697359

fryorcraken avatar Dec 04 '23 23:12 fryorcraken

Planning to move this issue to Priority column in week 3 of January 2024.

chair28980 avatar Jan 10 '24 15:01 chair28980

Note that Status is contemplating using named shard so I don't think we can fully deprecate.

fryorcraken avatar Feb 06 '24 03:02 fryorcraken

Note that Status is contemplating using named shard so I don't think we can fully deprecate.

Moving this back to triage. Once we have confirmation in either direction, we can handle this issue as required.

danisharora099 avatar Feb 07 '24 06:02 danisharora099

Moving to icebox, standing by for update from Status to confirm this update is required or not.

@fryorcraken do you know who the appropriate stakeholder on Status team is to verify the necessity of deprecating named sharding?

chair28980 avatar Mar 06 '24 15:03 chair28980

Moving to icebox, standing by for update from Status to confirm this update is required or not.

@fryorcraken do you know who the appropriate stakeholder on Status team is to verify the necessity of deprecating named sharding?

We are stakeholders now.

Status software uses static sharding all across. Even if not custom shards just yet.

Named sharding can be deprecated across the clients.

cc @jm-clius @Ivansete-status @weboko

fryorcraken avatar May 22 '24 03:05 fryorcraken

Indeed. There should be no more use of named sharding in any clients.

jm-clius avatar May 22 '24 08:05 jm-clius

Thanks for the clarification! Sounds great.

Named sharding can be deprecated across the clients.

This does remain blocked on js-waku until we allow js-waku to connect/work with The Waku Network.

cc @weboko keeping this in blocked

danisharora099 avatar May 29 '24 09:05 danisharora099

Up to date checklist:

  • remove usage of DefaultPubsubTopic;

weboko avatar Jun 27 '24 15:06 weboko