Skip to content

chore(storage-node): remove dead code (TimingStrategyFactory, format_hsts_header)#439

Merged
cryptskii merged 2 commits into
mainfrom
chore/sn-remove-dead-code
Jun 10, 2026
Merged

chore(storage-node): remove dead code (TimingStrategyFactory, format_hsts_header)#439
cryptskii merged 2 commits into
mainfrom
chore/sn-remove-dead-code

Conversation

@dsmfa10

@dsmfa10 dsmfa10 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

Two dead items in the storage-node binary:

  1. TimingStrategyFactory::{production, test} (src/timing.rs) — a factory with
    zero callers anywhere (workspace grep). Production constructs
    ExponentialBackoffTiming::default() directly.
  2. format_hsts_header (src/main.rs) — already tagged #[allow(dead_code)] and
    never called; the HSTS header it would emit is set nowhere.

Fix

  • Remove TimingStrategyFactory (struct + impl). ImmediateTiming is kept
    because it's exercised by a unit test (test_immediate_timing).
  • Remove format_hsts_header and the now-unused HeaderValue import in
    main.rs.

Because dsm_storage_node is a binary crate, these pub items have no external
consumers — removal is safe.

Verification

cargo check clean (no unused-import warnings after dropping HeaderValue).

CI gates & coverage

Full verification for this PR runs in CI — Rust (cargo fmt --check,
clippy -D warnings, workspace tests), Frontend, Android Unit Tests,
Coverage, SPDX headers, CodeQL (see the PR's Checks tab). The local
check noted above is a subset; the broader mandated gates (full workspace test
suite, codegen/scan, Android, Frontend) run in CI, not locally — none is
silently skipped.

…hsts_header)

- `TimingStrategyFactory::{production,test}` (timing.rs) have zero callers
  anywhere; production constructs `ExponentialBackoffTiming::default()`
  directly. Remove the factory.
- `format_hsts_header` (main.rs) was `#[allow(dead_code)]` and never called;
  remove it and the now-unused `HeaderValue` import.

`ImmediateTiming` is retained (exercised by a unit test). Storage node is a
binary crate, so these have no external API surface. `cargo check` clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cryptskii cryptskii merged commit 67c30a2 into main Jun 10, 2026
8 of 9 checks passed
@cryptskii cryptskii deleted the chore/sn-remove-dead-code branch June 10, 2026 08:33
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.

3 participants