-
Notifications
You must be signed in to change notification settings - Fork 45
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: Changes to Store protocol APIs for Autosharding #786
Comments
The protocol doesn't have to change because it already allow content topics without pubsub topics. I did not change anything in nwaku for STORE yet, but the implementation could be improved. |
Ok, was not aware of that. And also on the StoreNode side, wouldn't we need to derive the pubSubTopic for the contentTopic using autosharding (if pubSubTopic is not specified) to retrieve messages? Looks like there will be some work related to Store and Autosharding. |
Yes that part I'm working on right now. waku-org/nwaku#2092 but that just about finding a Store peer using discv5. Otherwise use the peer that come with the request.
If the request don't specify pubsub topic we can ignore sharding and only filter messages by content topic. The only problem is when the request has both pubsub and content topics. Now that's complicated. All content topic could fall on the same shard, each have their own shard or a mix. May require protocol changes, I haven't dived deep yet. |
Hmm, To simplify this...maybe we can take an approach similar to what was done for Filter to handle autosharding. |
@SionoiS , I was going through Store rfc and noticed that pubsubTopic is mandatory in store queries ref:https://rfc.vac.dev/spec/13/#historyquery. If so, this makes it simpler right. Only on store-client side we can translate contentTopics to pubsubTopics and generated Store-Queries towards Store node. No changes would be required on Store node then. |
On going through Store code in go-waku and the rfc again , it looks like pubsubTopic can be empty. |
@SionoiS Have been thinking about the changes to Store futher wrt sharding and have following queries.
|
If there's no pubsub topic in the store query, the pubsub topic doesn't matter. You can disregard sharding. https://rfc.vac.dev/spec/13/#historyquery As for the peer selection, either the caller provide the peer, the client node has a service peer set OR discv5 is used to find one.
The store client should not know about sharding at all. It should only take a query and a peer. Higher in the stack sharding is handled. Information Flow: rest -> sharding -> peer selection -> client -> service |
How can we find if we don't know the shard? |
Discv5 always returns random peers. We then filter and try again if needed. We could just use the first Store peer found regardless of shard. |
Yeah, thought of that..but in that case does the store peer respond that it doesn't support that shard? Otherwise the client doesn't know if there are no messages or to contact another node. |
🤔 We could populate the pubsub topic field of the query before trying to find a store peer on that shard? |
Yup, which brings back my original point as to should we allow queries without pubsubTopic/shardInfo? I propose following changes to handle such scenarios:
|
Started implementing this in #885 and noticed that each Query is responded with a cursor, which means splitting requests like this may not be a good idea. |
I totally missed your original point. Reread my answers and IDK what I was saying sorry about that... I see 4 cases here;
|
One more question that comes to me is how do we support default-pubsubTopic then? Maybe we will have to ask users to explicitly specify it. |
@richard-ramos , How does status use store protocol? Does it always specify store node to be used even with static sharding or is it expected to be discovered? |
Feels a bit arbitrary to remove this use case but 🤷
Yes, let's not try to be smarter than the user. If the user meant to use autosharding they should just use content topics anyway.
I don't think it needs special treatment, it's just a topic like any other. The user would do; pubsub (default topic) and content for filtering. |
Weekly Update
|
Feature
Store API to be updated to take only contentTopics and derive pubSubTopic based on autosharding.
Probably reuse contentFilter which is extracted from Filter protocol for the same.
TBD - More analysis to be done to see what other changes are required apart from StoreClient API.
@SionoiS , Doesn't store API also require change to work with only contentTopics for autosharding? Did not see this being tracked.
The text was updated successfully, but these errors were encountered: