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
Oh interesting, could you check the metrics to see if there were many invalid messages during the time that the CPU profile was taken? How could it be that we get sent so many invalid messages? Or the consumer code of this library is doing something strange and passing bad data to the decoder?
@dapplion it's by design, after decoding a chunk's header successfully, the buffer is consumed the whole length, and it has 0 length, and varint.decode() will just throw RangeError in that case. This happens 50% of the time libp2p-mplex uses varint.decode() in that function
this could be a simple fix, will create a PR for it
As noted in ChainSafe/lodestar#3467, 80%-90% of the `varint.decode()` function time is used to handle `varint.decode()` RangeError because the buffer length is 0
Describe the bug
subscribeToAllSubnets()
flag, it takes 5% of cpu time to decode libp2p-mplex chunks1130_lodestar_subscribeAllSubnets_local.cpuprofile.zip
The text was updated successfully, but these errors were encountered: