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
When you want to send data to another peer, two methods can be used: Send (link) and SendEnvelope (link). Note that SendEnvelope actually uses Send internally.
If we look at the code, we see that Send is used directly in two places: in the CAT mempool and in the Broadcast method (link) of switch. However, it seems like switch's Broadcast isn't used anywhere else, and instead, the code prefers to use BroadcastEnvelope everywhere else. Considering this, it appears that SendEnvelope is the preferred choice in most cases.
Sticking to the usage of one method, e.g., SendEnvelope could enhance the clarity of monitoring outgoing traffic (note that it is preferred to monitor the message type as well which is available in the SendEnvelope side, before marshalling the message to bytes).
Problem
With the current state of the celestia-core, we lack observability into the messages (and message types) exchanged via the CAT mempool Reactor, using P2P Prometheus metrics (MessageReceiveBytesTotal and MessageSendBytesTotal). To provide that visibility, we need to utilize use SendEnvelope in that reactor instead of Send. This change should also be applied to other parts of the code that might be using Send.
The text was updated successfully, but these errors were encountered:
staheri14
changed the title
Enhance traffic observability by using SendEnvelope in CAT mempool reactor
Enhance traffic observability by using SendEnvelope instead of Send
Sep 27, 2023
Context
When you want to send data to another peer, two methods can be used:
Send
(link) andSendEnvelope
(link). Note thatSendEnvelope
actually usesSend
internally.If we look at the code, we see that
Send
is used directly in two places: in the CAT mempool and in theBroadcast
method (link) ofswitch
. However, it seems likeswitch
's Broadcast isn't used anywhere else, and instead, the code prefers to useBroadcastEnvelope
everywhere else. Considering this, it appears thatSendEnvelope
is the preferred choice in most cases.Sticking to the usage of one method, e.g.,
SendEnvelope
could enhance the clarity of monitoring outgoing traffic (note that it is preferred to monitor the message type as well which is available in theSendEnvelope
side, before marshalling the message to bytes).Problem
With the current state of the celestia-core, we lack observability into the messages (and message types) exchanged via the CAT mempool Reactor, using P2P Prometheus metrics (
MessageReceiveBytesTotal
andMessageSendBytesTotal
). To provide that visibility, we need to utilize useSendEnvelope
in that reactor instead ofSend
. This change should also be applied to other parts of the code that might be usingSend
.The text was updated successfully, but these errors were encountered: