Closed 2color closed 3 weeks ago
As you've found it's the block brokers that are making the routing calls. This is because each block broker does it's own thing to fetch blocks and there's no coordination between them.
One router will be faster than the other, and the outstanding request is cancelled when the other resolves.
We could have the delegated http routing implementation guard on parallel concurrent requests to the same URL with the same query parameters and also store the response in the browser's cache if available?
It's also worth noting that you probably don't need to configure delegatedHTTPRouting
as a router with createHelia
as above since an instance of DelegatedRoutingV1HttpApiClient
is already configured as a libp2p service, which the trustless gateway block broker will invoke via the helia routing (since it invokes the libp2p routing).
We could have the delegated http routing implementation guard on parallel concurrent requests to the same URL with the same query parameters and also store the response in the browser's cache if available?
As discussed in person, we will probably take this approach.
What's the problem
Helia makes a content routing call per block broker.
For example, given the following (see running example):
Helia will make two HTTP calls to the delegated routing endpoint and one will be cancelled.
Reproductions
How it happens
In trying to understand how this happens, I've been able to establish the following (from a Verified Fetch example with creates a session):
NetworkedStroage.get()
(blockstore) get is initially called byunixFsResolver
and calls `raceBlockRetrieversNetworkedStroage.raceBlockRetrievers()
callsretrieve
for eachblockBroker
routing
passed in and make a delegated routing call.routing
passed in and make a delegated routing call.In other words, each block broker makes the same routing call.
Open questions