Open raulk opened 3 years ago
I wonder if it is possible to create a wireshark plugin+libp2p plugin which would dump all streams from libp2p into wireshark
There was some exploration of that here: https://github.com/mikevoronov/libp2p-dissector, but I'm thinking of something simpler inside Lotus that can be enabled/disabled with lotus log set-level
. We definitely don't want to maintain protocol parsers for go-data-transfer, graphsync, go-fil-markets, etc. elsewhere, at least for now.
I don't believe there's a way in lotus to output logs with a particular prefix / pattern. That would be helpful to be able to trace flow through different parts of the code (eg data transfer / graphsync / markets etc).
There are several protocols in the Filecoin stack that would benefit from message-level tracing. That is, tracing messages in and messages out on a DEBUG level, on dedicated loggers.
Some protocols are very interactive/chatty, and there are several things happening at once, so being able to inspect the actual flow of messages is very useful for debugging races and other conditions.
Such protocols include:
Proposal
Introduce the
msgtrace/
prefix as a convention for these loggers. Logging happens at DEBUG level. For example, enabling the DEBUG level ofmsgtrace/datatransfer
would have Lotus pring statements like this: