Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#29186 closed enhancement (fixed)

stem remote.py defaults to plain text instead of GZIP

Reported by: starlight Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

remote.py defaults no compression

387:    elif compression is None:
388:      compression = [Compression.PLAINTEXT]

399:      if not compression:
400:        compression = [Compression.PLAINTEXT]

instead the best available compression algorithms should be discovered and attempted

GZIP will almost always be available and is far better than PLAINTEXT

a warning should be written to stderr when compression fall backs

1) default case falls back to PLAINTEXT
2) requested ZSTD or LZMA falls back to GZIP or PLAINTEXT

download_descriptor.py should support a command parameter to choose compression type

Child Tickets

Change History (4)

comment:1 Changed 4 months ago by starlight

if writing warnings to stderr violates stem api conventions or is deemed lacking aesthetically, a set of minimum permissible compressions should be accepted in addition to the request set and an exception thrown when a selected fallback is not present in the minimums

comment:2 Changed 4 months ago by atagar

Resolution: fixed
Status: newclosed

Thanks starlight! I purposefully chose for plaintext to be the default back in the day but it's long past due we toggled it to gzip.

https://gitweb.torproject.org/stem.git/commit/?id=52b1370

Lzma and zstd are useless because relays effectively never support it, but gzip is available everywhere.

comment:3 in reply to:  2 Changed 4 months ago by starlight

Replying to atagar:

Thanks starlight! I purposefully chose for plaintext to be the default back in the day but it's long past due we toggled it to gzip.

https://gitweb.torproject.org/stem.git/commit/?id=52b1370

thanks!

Lzma and zstd are useless because relays effectively never support it, but gzip is available everywhere.

my relay supports both ZSTD and LZMA (built the libraries myself)

if Debian does not typically have libzstd.so.1 installed perhaps the pre-built release binaries should include a statically linked copy

comment:4 Changed 4 months ago by starlight

had to build Python Zstandard suport and try it

three of eight random (though fast) relays support ZSTD compression, not all that rare

Note: See TracTickets for help on using tickets.