Skip to content

feat: advertise zstd and lz4 compression in protocol negotiation - #2978

Merged
oferchen merged 1 commit into
masterfrom
feat/advertise-zstd-lz4
Mar 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/advertise-zstd-lz4

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Forward zstd and lz4 feature flags to the protocol crate from core, engine, and transfer Cargo.toml files
  • Fixes a gap where supported_compressions() in protocol negotiation never included zstd or lz4 because the feature gates on the protocol crate were never activated
  • Follows the existing pattern used by zlib-ng, which already forwarded correctly to protocol/zlib-ng

Details

The protocol crate's supported_compressions() function uses cfg(feature = zstd) and cfg(feature = lz4) guards to include these algorithms in the advertised list during capability negotiation. However, no upstream crate (core, transfer, engine) was forwarding these features to the protocol crate, so the guards were always false even when the workspace had both features enabled by default.

The CompressionAlgorithm enum variants, parse()/as_str() methods, to_compress_algorithm() conversion, and all negotiation tests were already in place - only the Cargo feature wiring was missing.

Test plan

  • CI passes fmt+clippy, nextest on all platforms
  • Existing negotiation tests now exercise the zstd/lz4 branches (previously dead code behind inactive feature gates)
  • daemon_negotiation integration tests verify zstd/lz4 in advertised compression lists

Forward zstd and lz4 feature flags to the protocol crate from core,
engine, and transfer - matching the existing pattern for zlib-ng. Without
this, supported_compressions() in the protocol negotiation never included
zstd or lz4 because the feature gates were never activated on the
protocol crate, even though the workspace defaults enabled them.
@github-actions github-actions Bot added the enhancement New feature or request label Mar 22, 2026
@oferchen
oferchen merged commit 8dad1e1 into master Mar 22, 2026
12 of 17 checks passed
@oferchen
oferchen deleted the feat/advertise-zstd-lz4 branch March 22, 2026 14:38
oferchen added a commit that referenced this pull request May 1, 2026
Forward zstd and lz4 feature flags to the protocol crate from core,
engine, and transfer - matching the existing pattern for zlib-ng. Without
this, supported_compressions() in the protocol negotiation never included
zstd or lz4 because the feature gates were never activated on the
protocol crate, even though the workspace defaults enabled them.
oferchen added a commit that referenced this pull request May 5, 2026
Forward zstd and lz4 feature flags to the protocol crate from core,
engine, and transfer - matching the existing pattern for zlib-ng. Without
this, supported_compressions() in the protocol negotiation never included
zstd or lz4 because the feature gates were never activated on the
protocol crate, even though the workspace defaults enabled them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant