-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat!: deprecate named pubsub topics and use static/auto sharding #2097
Conversation
simplify network config type, all protocols use pubsub topic internally
size-limit report 📦
|
@@ -45,7 +41,9 @@ class Metadata extends BaseProtocol implements IMetadata { | |||
* Make a metadata query to a peer | |||
*/ | |||
public async query(peerId: PeerId): Promise<MetadataQueryResult> { | |||
const request = proto_metadata.WakuMetadataRequest.encode(this.shardInfo); | |||
const request = proto_metadata.WakuMetadataRequest.encode( | |||
pubsubTopicsToShardInfo(this.pubsubTopics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if this.pubsubTopics
is not expected to change, then we can probably just create the shard info during construction and store it as another class variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like where you're coming from; however apart from this place, shard info is not passed anywhere else so why introduce another variable? 🤔
Problem
To configure pubsub topics on a Waku node, there have been three ways:
Based on #1690, we want to deprecate support for named pubsub topics, and only allow configuration using Static Sharding and Auto Sharding.
Solution
NetworkConfig: StaticSharding | AutoSharding
NetworkConfig
to The Waku Network:clusterId: 1, shards: [0,1,2,3,4,5,6,7]
Notes
ApplicationInfo
as a type, and only relies onContentTopicInfo
andShardInfo
ApplicationInfo
should be specified as astring
to be used as a param inNetworkConfig
ContentTopicInfo
andShardInfo
are also represented asAutoSharding
andStaticSharding
respectivelyNetworkConfig
is only used as a type for consumer-facing API,NetworkConfig
is thus translated into relevant pubsub topics, based on the type, and thereafter used as astring[]
representing pubsub topics throughout the codebase as planned.Contribution checklist:
!
in title if breaks public API;