I noticed that the Monero chain compresses about 60%, would it be possible to compress blocks before sending them from a remote node to a syncing wallet thus saving a big chunk of bandwidth and time?
Does anyone know if this is already happening during sync, or if not why?
edit: this can be done using ssh tunnels, if you have ssh access to your remote server. The “-C” option enables compression.
ssh -C -NL 18089:localhost:18089 server_username@server_address
Now you can set your wallet to 127.0.0.1:18089 and now your wallet syncing should be faster, enjoy!
Monero uses http(s) for communication, so if/what compression algorithm is used is entirely up to the server sending packets. A random sample of 1 public remote node shows the default is no compression, but you can solve this as a remote node owner by running the node behind a reverse proxy (advisable regardless if your node will be public) that supports compression, or as a remote node user by just finding a node using compression.
The reason why the default is no compression is possible an assumption of the node being on the same machine as wallet, or possibly separation of duties.
As far as bandwidth / performance tradeoff, it is common to use a very time efficient algorithm such as gzip to compress http(s) traffic for moderate gains at negligible costs in a typical web use case.
Thanks for the info. I am sure a check could be put in place to determine if the syncing wallet is local or remote and compression enabled accordingly. If not a manual option can be put in place where the user can specify if they want compression enabled.
As blocks continue to grow due to increasing TX counts this feature will become a huge benefit.