Skip to content

chore: remove dead storage-challenge and health-check Hash helpers#300

Merged
j-rafique merged 1 commit into
masterfrom
cleanup/sc-hc-deadcode
Jun 19, 2026
Merged

chore: remove dead storage-challenge and health-check Hash helpers#300
j-rafique merged 1 commit into
masterfrom
cleanup/sc-hc-deadcode

Conversation

@j-rafique

Copy link
Copy Markdown
Contributor

Drops 7 unreachable functions flagged by deadcode -test ./...:

pkg/types/storage_challenge.go
- MessageTypeFromString
- (StorageChallengeMessages).Hash + the orphan slice type
- (AggregatedScoreList).Hash + the orphan slice type pkg/types/healthcheck_challenge.go
- (HealthCheckChallengeMessages).Hash + the orphan slice type
pkg/utils/storagechallenge/storage_challenge.go (whole pkg, orphan)
pkg/utils/healthcheckchallenge/health_check_challenge.go (whole pkg, orphan)
pkg/storagechallenge/deterministic/deterministic.go
- EpochStartHeight

Verified via deadcode diff on origin/master @ 82cebf7: baseline 147 ->
after 140 (exactly the 7 above removed, no new findings). MessageType, HealthCheckMessage and the consumed deterministic helpers stay.

go build ./..., go vet ./..., and go test ./... -short -count=1 pass in the supernode module; sn-manager, cmd/sncli, and tests/system also build clean.

Drops 7 unreachable functions flagged by `deadcode -test ./...`:

  pkg/types/storage_challenge.go
    - MessageTypeFromString
    - (StorageChallengeMessages).Hash + the orphan slice type
    - (AggregatedScoreList).Hash + the orphan slice type
  pkg/types/healthcheck_challenge.go
    - (HealthCheckChallengeMessages).Hash + the orphan slice type
  pkg/utils/storagechallenge/storage_challenge.go    (whole pkg, orphan)
  pkg/utils/healthcheckchallenge/health_check_challenge.go (whole pkg, orphan)
  pkg/storagechallenge/deterministic/deterministic.go
    - EpochStartHeight

Verified via deadcode diff on origin/master @ 82cebf7: baseline 147 ->
after 140 (exactly the 7 above removed, no new findings). MessageType,
HealthCheckMessage and the consumed deterministic helpers stay.

go build ./..., go vet ./..., and go test ./... -short -count=1 pass
in the supernode module; sn-manager, cmd/sncli, and tests/system also
build clean.

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.

Pull request overview

This PR removes dead/unreachable storage-challenge and health-check hashing/helper code paths that were flagged by deadcode -test ./..., reducing maintenance surface without changing live behavior.

Changes:

  • Deleted orphaned pkg/utils/storagechallenge and pkg/utils/healthcheckchallenge summary-hash helpers.
  • Removed unused hashing slice-types and MessageTypeFromString from pkg/types/*_challenge.go.
  • Removed unused deterministic helper EpochStartHeight from pkg/storagechallenge/deterministic.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/utils/storagechallenge/storage_challenge.go Removes unused summary stats hashing helper (entire file deleted).
pkg/utils/healthcheckchallenge/health_check_challenge.go Removes unused summary stats hashing helper (entire file deleted).
pkg/types/storage_challenge.go Drops unused message parsing + hash helper slice types and related imports.
pkg/types/healthcheck_challenge.go Drops unused hash helper slice type and related imports.
pkg/storagechallenge/deterministic/deterministic.go Removes unused EpochStartHeight helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@a-ok123 a-ok123 self-requested a review June 19, 2026 15:57
@j-rafique j-rafique merged commit 095b2f2 into master Jun 19, 2026
9 checks passed
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