You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow duplicate registration of protobuf services and interface implementations.
Problem Definition
GRPCQueryRouter, MsgServiceRouter and InterfaceRegistry currently do not error or panic on duplicate registration.
Especially for service registration (GRPCQueryRouter or MsgServiceRouter) we should only allow a single registration because a duplicate registration means there are two modules trying to register the same service and that is either a configuration error or something malicious.
Registering an interface implementation twice is maybe not so bad but could also be problematic. At least we should verify that the exact same concrete type is registered for the same type URL.
Proposal
Either panic or return an error (requires a method signature change) on duplicate service registration.
For duplicate interface implementation registration (InterfaceRegistry.RegisterImplementations), either:
panic or error always on duplicate registrations,
or only panic or error when the same type URL is registered with a different concrete type (this is probably preferable)
The text was updated successfully, but these errors were encountered:
Summary
Disallow duplicate registration of protobuf services and interface implementations.
Problem Definition
GRPCQueryRouter
,MsgServiceRouter
andInterfaceRegistry
currently do not error or panic on duplicate registration.Especially for service registration (
GRPCQueryRouter
orMsgServiceRouter
) we should only allow a single registration because a duplicate registration means there are two modules trying to register the same service and that is either a configuration error or something malicious.Registering an interface implementation twice is maybe not so bad but could also be problematic. At least we should verify that the exact same concrete type is registered for the same type URL.
Proposal
Either panic or return an error (requires a method signature change) on duplicate service registration.
For duplicate interface implementation registration (
InterfaceRegistry.RegisterImplementations
), either:The text was updated successfully, but these errors were encountered: