Skip to content

Delegated HTTP routers not used for pubsub publish/subscribe #926

@Rinse12

Description

@Rinse12

When Helia is configured to use delegated routing HTTP routers, pubsub publish/subscribe does not trigger any delegated router provider lookups. Publish fails with PublishError.NoPeersSubscribedToTopic, and subscribe silently succeeds but never connects to providers that are actually subscribed.

The delegated router in this repro only implements /routing/v1/providers/*, and is pre-seeded with a provider record for the pubsub topic routing CID. Despite that, Helia never calls getProviders, and no peers are dialed.

Reproduction

git clone https://github.com/Rinse12/delegated-routing-pubsub-provider-repro
npm install
npm run start

Observed output

[router] listening on http://127.0.0.1:25150/
[provider] peerId 12D3KooWRnAH1aYz4e89x2ZVKB61Hug5VTiM98D3P8ymaUukwL7L
[provider] addrs
[provider] pubsub topic /plebbit/pubsub-repro/1
[provider] routing cid bafkreia36n7k4rrs2wndyn4enw7ttsfajplrrdczaktuvvrebtpmcf6rwa

[resolver] attempting publish without manual discovery
[resolver] subscribers before publish: 0
[resolver] publish error: Error PublishError.NoPeersSubscribedToTopic

[resolver] attempting subscribe without manual discovery
[resolver] subscribers before subscribe: 0
[resolver] subscribers after subscribe: 0
[resolver] connections after pubsub attempt: 0
[router] provider queries handled: 0

The router logs no /routing/v1/providers/* requests, and the resolver never
connects to the provider.

Expected behavior

  • Helia should query delegated routing for providers of the pubsub routing CID
    (floodsub:${topic}) before publishing/subscribing.
  • The delegated router should receive /routing/v1/providers/* requests.
  • The resolver should dial the provider from the delegated routing response.
  • Publish should succeed and/or subscribe should connect to at least one peer who's subscribed to the topic.

Actual behavior

  • No delegated routing provider lookups occur (provider query count stays 0).
  • Publish fails with PublishError.NoPeersSubscribedToTopic.
  • Subscribe returns without error but no peer connections are made.

Environment

  • Node.js: 20.18.0
  • helia: 6.0.14
  • @libp2p/gossipsub: 15.0.11
  • @helia/delegated-routing-v1-http-api-client: 5.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upneed/analysisNeeds further analysis before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions