Receiver closing a connection abruptly results in an obscure ECONNRESET

Looking at go-libp2p, I encountered an example (potentially one of many) in which the receiver closes a connection abruptly without notifying the sender why the connection was closed. This results in ECONNRESET at the sender without any way for the receiver to understand the cause for the ECONNRESET.

ECONNRESET is a general error which can be caused by many different reasons, many of them are not related to the receiver code. IMHO when feasible, it is not a good practice to close a connection abruptly without the receiver sending an error response detailing why the connection is being closed.

DefaultResourceManager monitors incoming connections.
If a IP address/subnet cross the limit, it closes the connection abruptly. Consequently, ECONNRESET is experienced by the connecting peer without any way to understand the cause for the ECONNRESET. On the receiver side, no log is present unless you are in debug. Systems in production are normally not in debug, making it impossible to figure out why ECONNRESET was received.