-
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!: use ShardingParams on subscriptions, make Decoder/Encoder auto sharding friendly by default #1958
Conversation
@@ -18,7 +18,7 @@ export interface Waku { | |||
|
|||
connectionManager: IConnectionManager; | |||
|
|||
dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise<Stream>; | |||
dial(peer: PeerId | MultiaddrInput, protocols?: Protocols[]): Promise<Stream>; |
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.
fix for discrepancy in types - this prevents us from doing .dial(multiAddrStr)
in TS
size-limit report 📦
|
… mapping default for decoder / encoder
I might be missing something but I don't fully understand what the PR is solving for. Can you please elaborate, or point to related issues/references? |
This problem is addressed - #1961 |
@@ -29,7 +29,7 @@ export type IBaseProtocolSDK = { | |||
}; | |||
|
|||
export type ContentTopicInfo = { | |||
clusterId: number; | |||
clusterId?: number; |
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.
Important change - assumption is that default choice is TWN cluster ID.
): Promise<SubscriptionManager> { | ||
const pubsubTopic = | ||
typeof pubsubTopicShardInfo == "string" | ||
? pubsubTopicShardInfo | ||
: singleShardInfoToPubsubTopic(pubsubTopicShardInfo); | ||
: shardInfoToPubsubTopics(pubsubTopicShardInfo)?.[0]; |
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.
ShardingParams
can be mapped to many pubsubTopics
- we provide subscription to one.
Any idea how to handle it better? @waku-org/js-waku-developers
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.
@weboko we could forbid passing shard info where shards
length is greater than 1
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.
LGTM, Awesome refactoring of the tests and utils!
Problem
Seems latest fleet update is not allowing to subscribe to
DefaultPubsubTopic
anymore and we should be using shards.Solution
Use pubsub topic for subscription creation from those determined from shards / contentTopics
Though this PR is huge it includes only following changes:
Decoders
/Encoders
that makes use of default cluster ID and maps content topic to pubsubTopic;createSubscription
onFilter
acceptsShardingParams
;subscribe
checks pubsub topics fromDecoders
;Notes
Addresses - #1961
Next PR - #1959