-
Notifications
You must be signed in to change notification settings - Fork 47
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
bug: Strange "not subscribed to pubsubTopic" errors for filter/v2/messages GET requests #960
Comments
Looking at the URL used to obtain the messages: go-waku has the following endpoints for obtaining messages in filter:
In this regard go-waku and nwaku differ in how the REST API works. If we wanted to make go-waku match nwaku behavior, the solution is as simple as:
What do you think, @chaitanyaprem? / |
I think the REST API should be updated to supported both types, because waku code/node can be used for static sharding scenarios like Status or TheGraph and autosharding is used in case of Waku Network. It would be better to have both kinds of API's rather than only autosharding. |
@NagyZoltanPeter nwaku filter REST API also should be updated to support both static and autosharding as indicated here. Is this already being tracked as an issue? |
I had to take a closer look in nwaku, but still I have doubts on it. As being handled while registering the subscriptions, it is handled by having a non empty pubsub topic specified in the subscription... than it is static sharding otherwise auto shard is calculated and subscription is registered for that way. https://github.com/waku-org/nwaku/blob/master/waku/node/waku_node.nim#L547 On the getMessage side in either case you must only specify content topic to get the relevant messages, never the pubsubTopic. @SionoiS WDYT? |
Couple of points;
Knowing this, I would only change the test to cluster id 1 and not change anything else. |
When using getMessage REST API, you should use it in context of your subscriptions, so I see no point to add an explicit path param of pubsubTopic for getMessage.
Well among nodes it is a push protocol definitely but from the client perspective, I though it is a doable config to run up a node for your app and use it through the API. Hence my question about the use case of Status app and/or TheGraph!
|
Yes your right, NVM. We have to change this, it's not very ergonomic. |
Interesting, I am wondering if this also can be provided as a feature in case someone wants to use static-sharded network. |
@waku-org/nwaku-developers please create a ticket in the nwaku repo to update the REST api on the nwaku side per the above discussion. |
@chaitanyaprem, @SionoiS , CC: @chair28980, @waku-org/nwaku-developers: I still feel the endpoing GET /filter/v2/messages/{pubsubTopic}/{contentTopic} missleading and overkill. Please 'convince' me to introduce such an endpoint "GET /filter/v2/messages/{pubsubTopic}/{contentTopic}". |
The message cache works as follow; you can get a message by either content topic OR pubsub topic and it is removed only if too old or unsubscribed from both content and pubsub topics. |
If a client is using a static sharded network, the client would have to specify both pubsub and contentTopic in order to retrieve a message isn't it? Or is the messageCache global and not specific to a pubsubTopic? Because in go-waku the messageCache is for specific contentFilter (which can be either only pubsubTopic or pubsub and list of contentTopics) which means a query to fetch messages can be made either with:
Is the messageCache a single queue for all subscribed pubsubTopics and inturn contentTopics? |
Also note that In case of static-sharding, same contentTopic can be present or used in multiple pubsubTopics . i.e C1 contentTopic can be used in P1 and P2 which are different pubsubTopics/shards. So, without having an ability of specifing pubsubTopic how can a user retrieve messages for a contentTopic C1 under P1 via the REST API? In case of autosharding, contentTopic automatically maps to a pubsubTopic which would avoid this situation. |
It is per protocol, e.g. one cache for relay one for filter.
Not possible in Nwaku AFAIK
ATM, they can't because content topic are always autosharded. They can get ALL the msgs from a pubsub topic and filter at the app lvl. |
Steps to reproduce the behavior:
"pubsubTopic": "/waku/2/rs/18/1"
"contentFilters": ["/test/1/waku-filter/proto"], "pubsubTopic": "/waku/2/rs/18/1"
{"payload": "RmlsdGVyIHdvcmtzISE=", "contentTopic": "/test/1/waku-filter/proto", "timestamp": 1702470394471216640}
=> Very strange error:
'not subscribed to pubsubTopic:/waku/2/rs/1/4 contentTopic: /test/1/waku-filter/proto'
Strange because
/waku/2/rs/1/4
is not used anywhereHere's the test logs:
go-waku version/commit hash
harbor.status.im/wakuorg/go-waku:latest
Additional context
If I use harbor.status.im/wakuorg/nwaku:latest instead of go-waku the test passes.
Here's the docker log
node2_2023-12-13_14-26-09__2e5a7b17-7a3a-4811-b3a6-11406583d9a1__harbor.status.im_wakuorg_go-wakulatest.log
node1_2023-12-13_14-26-09__2e5a7b17-7a3a-4811-b3a6-11406583d9a1__harbor.status.im_wakuorg_go-wakulatest.log
The text was updated successfully, but these errors were encountered: