mintlayer-core
mintlayer-core copied to clipboard
Get rid of confusing naming in p2p
(Created on Aug 25, 2023 by @ImplOfAnImpl)
-
[ ] The module name
default_backendsuggests that the module can be replaced with some other "non-default" implementation, but this is not true, because its current implementation basically defines the protocol. So it's more likethe_backend. On the other hand, there is no obvious good name for it right now; e.g. naming it simply "backend" is not very good because it has a submodule calledbackendas well as theBackendstruct, so this will lead to extra confusion. -
[ ]
MessagingServiceis too generic a name for a trait that can only sendSyncMessages. Additionally, the generic parameters that must implementMessagingServiceare usually namedMessagingHandle, which is also too generic and makes it hard to understand what exactly they are for. (but note that implementations ofMessagingServiceare also calledMessagingHandles, and they should probably be named differently than the aforementioned generic parameters).