neo icon indicating copy to clipboard operation
neo copied to clipboard

Make Message compression negotiable by the client

Open ixje opened this issue 4 years ago • 1 comments

Summary or problem description The network Message class selectively applies compression to its payloads

https://github.com/neo-project/neo/blob/d092510d0b416f30d5dca7be9913193443bebb96/src/neo/Network/P2P/Message.cs#L69-L80

While this is beneficial for performance in general, it can be problematic when trying to analyse network traffic/node syncing behaviour (etc). For example; my Wireshark dissector cannot process compressed payloads because Wiresharks scripting language does not expose its LZ4 lib and you cannot load external libraries to add support.

Do you have any solution you want to propose? Add a NodeCapability that indicates whether the client supports message compression. This is very similar to what Erik suggested a long time ago https://github.com/neo-project/proposals/pull/31#issuecomment-387392463. I don't know why it never ended up in the code.

By making it optional you can turn off compression when you want to do network analysis.

Neo Version

  • Neo 3

Where in the software does this update applies to?

  • P2P (TCP)

ixje avatar Nov 09 '21 10:11 ixje

We can add a compression flag in protocol settings.

ZhangTao1596 avatar Nov 29 '21 09:11 ZhangTao1596