You are reading content from Scuttlebutt
@aljoscha %aaNbXI0ltSc5bG86S9NS7wEjxvtGUXuq89W8VuIqetA=.sha256
Re: %eOgrGRIfP

Ok, I think the symmetric approach is a pretty bad idea. It results in two bidirectional protocols simultaneously running over the same channel, which leads to conflicts. It is possible two design cooperative protocols that can handle that, but you can't rely on that (and it would violate the principle that plugins can talk to each however they like). So scratch that.

What remains is the decision whether a plugin receiving a connection should be given the name (and version) of the initiating plugin. Not sending the name results in a strictly less powerful protocol, so why am I even considering it?

I think relying on the name of the initiator leads to tightly coupled plugins and should be considered an anti-pattern. The whole point of the plugin architecture is to decouple different aspects of application logic. If two plugins rely on each other, then they really are one plugin (note that this is different from one plugin relying on the other but not the other way around). And if plugins really want to treat certain other plugins in a special way, they can still encode this in the protocol they use for communication. But in my opinion, the framework should not encourage this bad practice.

There's a performance impact of not using a single logical channel between the two plugins, but two. Plugins that only use one channel are more efficient, but plugins can only negotiate that if they know their names. But the cost and performance impact of not having an additional channel is negligible, not really justifying the tricky shared-channel negotiation and the necessary compromises for the communication protocol they use over that shared channel.

So I'm leaning towards plugins not knowing who or what initiated a connection to them, even though this is the less general approach. I'd love to hear other people's opinion on this (CC e.g. @keks, @cryptix).

Note that this post only dealt with min-bus, not with a p2p-aware framework. For cross-server communication, there will always be the need to include some information about who initiated a connection (at the very least the public key). But the same core decision needs to be made.

Join Scuttlebutt now