js-waku
js-waku copied to clipboard
feat: Deprecate Named Sharding and Update Lightpush Client API
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:
- 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.
- 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.
- 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.
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
Weekly Update
- achieved: PR ready and currently in review-iteration phase ( #1697 )
- next: to be merged
FYI https://github.com/waku-org/js-waku/issues/1749#issuecomment-1839697359
Planning to move this issue to Priority column in week 3 of January 2024.
Note that Status is contemplating using named shard so I don't think we can fully deprecate.
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.
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?
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
Indeed. There should be no more use of named sharding in any clients.
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
Up to date checklist:
- remove usage of
DefaultPubsubTopic
;