-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIP-550: P2P message snappy compression #550
Comments
wow, this will basically slash the disk space needed in half. When will this release? |
This may not decrease the disk occupation, What I understand is that it is only compressed the message when the message is transmitted which reduced the bandwidth usage. Will this speed up the block synchronization? |
Yes, you are right. From a global perspective, reducing bandwidth usage will speed up block synchronization. |
It will be released in the next version, the exact date is not yet confirmed, but soon. |
Good job, just that why you suggest using Snappy compression sdk, have you compared with other similar compression method such as Zstd? I just wonder the process you decide to choose Snappy, I mean if we want to optimize it, it's better to use the best one right? |
When choosing a compression method, we compared the performance of various compression methods, and in the end we decided to choose the same compression method used by Ethereum. Of course, we will continue to test different compression methods. If the advantages are obvious, we will consider supporting multiple compression methods later. |
I would say thank you for the test stats, they seem convincible. Catching up Eth with the same method would shovel loads of work. |
Cutting off 51% of the redundant message size, a surprisingly good one, this should be a mandatory update. |
Close this issue as it is implemented by GreatVoyage-v4.7.2. |
Simple Summary
This TIP proposes a small extension to the TRON protocol to enable Snappy compression on all message payloads after the initial handshake.
Abstract
The base networking protocol used by TRON currently does not employ any form of compression. This results in a massive amount of bandwidth wasted in the entire network, making both initial sync and regular operation slower and laggier. This situation can be improved by compressing network messages. After extensive benchmarks, the results show that data traffic is decreased by 40-60% for block synchronization.
Motivation
Currently, the block size of the TRON network is around 80k bytes. And as the TRON network continues to grow, the block size may continue to increase, the network load will also increase, and the bandwidth requirements of nodes will also increase. However, most data (blocks, transactions) are highly compressible. By enabling compression at the message payload level, we can reduce the amount of data transmitted by the message, reducing bandwidth usage and data synchronization latency.
Rationale
Enable Snappy compression on all TCP channel message payloads after the initial handshake. Compress the message before sending it through the channel. When receiving a compressed message, decompress it first and then continue the subsequent business processing. The handshake message is never compressed, since it is needed to negotiate the common version.
Specification
Pack the compressed message into
CompressMessage
for network transmission. The structure ofCompressMessage
is as follows:Implementation
Snappy dependency
Compression implementation when sending messages:
Decompression implementation when receiving a compressed message:
Backward Compatibility
This proposal is fully backward compatible. Clients upgrading to the proposed new version protocol should still support skipping the compression step for older version protocol connections.
Test
Download blocks with block heights from
46314350
to46314360
, and perform a compression and decompression test. The compression rate is about 51%. The specific test results are as follows:The text was updated successfully, but these errors were encountered: