Substrate: Allow registering custom request-response protocols

Created on 6 Apr 2020  路  7Comments  路  Source: paritytech/substrate

Just like one can register notifications protocols, one should be able to register targeted request-response protocols.

I'm opening this issue to keep track of that feature.

cc'ing @mxinden @rphmeier as we discussed this in a meeting a couple of weeks ago (when the world was not on lockdown)

I8-enhancement 馃巵

Most helpful comment

Note-keeping: the reason for being able to perform requests to nodes we're not connected to is because we are not necessarily guaranteed a peer slot on the target node.

If, instead, there exists a system that guarantees a peer slot, then this isn't needed.

All 7 comments

For what it's worth, this issue is low-priority to me, but if there's an urgent need I can probably open a properly-tested PR in a day or two.

We haven't had issues so far emulating request/response over notifications-based protocols, so I also don't view this as high-priority.

Can now be done after #6559
The major obstacle to this now is to design an API.

I briefly wanted to highlight that request-response protocols would show up in Grafana similar to this:

Screenshot from 2020-07-14 13-09-57

(one section like that per protocol)

Which is going to be very useful to figure out if things are working as expected.

In #6634, starting a request to a node we're not connected to immediately fails. However, after chatting with Rob, there is a need for a function that tries to dial the node if we happen to not be connected to it.

Reopening to address this comment:

In #6634, starting a request to a node we're not connected to immediately fails. However, after chatting with Rob, there is a need for a function that tries to dial the node if we happen to not be connected to it.

Note-keeping: the reason for being able to perform requests to nodes we're not connected to is because we are not necessarily guaranteed a peer slot on the target node.

If, instead, there exists a system that guarantees a peer slot, then this isn't needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pepyakin picture pepyakin  路  5Comments

xlc picture xlc  路  5Comments

tomaka picture tomaka  路  5Comments

jiangfuyao picture jiangfuyao  路  5Comments

drozdziak1 picture drozdziak1  路  5Comments