Skip to content

Unify Rust SHA-2 dependency version - #1304

Merged
Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/unify_sha2_versions
Oct 1, 2026
Merged

Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/unify_sha2_versions

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

This PR converges the Rust workspace on sha2 0.11 and preserves SHA-256 output while avoiding per-byte String allocations.

Resolves #844

Details

  • Use the workspace SHA-2 version in WSLc's build and update rust-embed-utils to 8.12, eliminating sha2 0.10 and its old hash stack from Cargo.lock.
  • Add wxc_common::hashing::{sha256, sha256_hex} and encoding::lowercase_hex for policy identity, telemetry, learning-mode values, LXC chain names, and Hyperlight OCI digests.
  • Encode the WSLc SDK package checksum in one preallocated buffer, and remove unused direct sha2 dependencies.

Tests

  • cargo fmt --all -- --check — passed.
  • cargo check --workspace --all-targets --all-features --locked --offline — passed.
  • cargo clippy --workspace --all-targets --all-features --offline -- -D warnings — passed.
  • cargo test --workspace --exclude wxc_host_prep --offline -- --skip base_container_helpers::tests::runtime_proxy_preserves_allowed_host_to_container_loopback — passed.
  • cargo tree --workspace --target all --all-features -d --offline — passed; no duplicate sha2 versions.

Copilot AI balanced review requested due to automatic review settings September 27, 2026 05:07
@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 27, 2026 05:07
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new learning-mode digest encoding adds 32 temporary allocations per overlong ETL property.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Unifies the Rust workspace on SHA-2 0.11 while preserving lowercase digest output.

Changes:

  • Upgrades workspace and WSLc build dependencies.
  • Updates digest formatting for SHA-2 0.11.
  • Refreshes transitive dependencies and removes SHA-2 0.10.
File Description
src/​Cargo.toml Upgrades workspace SHA-2.
src/​Cargo.lock Unifies resolved SHA-2 dependencies.
src/​backends/​wslc/​common/​Cargo.toml Uses the workspace SHA-2 version.
src/​core/​mxc_engine/​src/​verbose_telemetry.rs Preserves lowercase telemetry hashes.
src/​core/​learning_mode_platforms/​windows/​src/​extractors.rs Preserves lowercase bounded-property hashes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 27, 2026 21:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Hyperlight retains incompatible LowerHex formatting, and the new encoders lack independent compatibility tests.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Previously missed (2)

In code that hasn't changed since last review

Low severity Add exact-output coverage for manual encoder markers

src/​core/​learning_mode_platforms/​windows/​src/​extractors.rs:514

The new manual encoder has no exact-output coverage: the existing bounding tests only check length and distinctness. Add a known-vector assertion for an overlong value's marker so lowercase output, two-digit zero padding, and the existing marker format are independently preserved.

Low severity Add independent known-vector digest assertion

src/​core/​mxc_engine/​src/​verbose_telemetry.rs:338

This assertion now obtains its expected digest through the same new helper used by production, so it cannot detect a case or zero-padding regression in the compatibility behavior this PR is meant to preserve. Add an independent known-vector assertion such as the standard SHA-256 of b"abc".

Comment thread src/Cargo.toml Resolved
Copilot AI review requested due to automatic review settings September 27, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The learning-mode hash conversion introduces avoidable per-byte allocations in an event-processing path.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The dependency graph is consolidated and existing digest representations remain covered and unchanged.

Review effort: Balanced
Findings: None

Resolved since last review (2)

This PR resolves #844 by using SHA-2 0.11 across the Rust dependency
graph and centralizing lowercase digest encoding without per-byte String
allocations. It preserves existing SHA-256 output across the consumers.

Details

* Use the workspace SHA-2 dependency for the WSLc build and update
  rust-embed-utils to 8.12.
* Add shared SHA-256 and lowercase hexadecimal helpers in wxc_common
  and migrate runtime digest consumers.
* Encode the WSLc package checksum in one preallocated buffer.

Tests

* Rust formatting and locked all-target/all-feature workspace check:
  passed.
* Workspace Clippy with -D warnings: passed.
* Workspace tests excluding the baseline-failing loopback case and
  elevation-only host-prep binary: passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 30b48038-4f23-4754-9b24-b0031e344abf
Generated-with: gpt-6-sol
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/unify_sha2_versions branch from f45ec70 to 665d33b Compare September 29, 2026 20:35
@MGudgin
Gudge (MGudgin) merged commit 64e201c into main Oct 1, 2026
30 checks passed
@MGudgin
Gudge (MGudgin) deleted the user/gudge/unify_sha2_versions branch October 1, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify duplicate sha2 versions in the Rust workspace

4 participants