Skip to content

apollo_staking: delete dead code#14299

Merged
asaf-sw merged 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_staking
Jun 7, 2026
Merged

apollo_staking: delete dead code#14299
asaf-sw merged 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_staking

Conversation

@asaf-sw

@asaf-sw asaf-sw commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

Remove two unused items from crates/apollo_staking/src/contract_types.rs. Both carried #[allow(dead_code)] and have zero references anywhere in the workspace.

  • EPOCH_LENGTH — a pub(crate) const u64 = 100. Being pub(crate), it is not reachable outside the crate, and within apollo_staking it is never imported or referenced. The EPOCH_LENGTH names that are used elsewhere are unrelated definitions: MockStakingContract::EPOCH_LENGTH (= 30), the local const EPOCH_LENGTH in mock_staking_contract_test.rs, MIN_EPOCH_LENGTH in staking_manager.rs, and the STAKING_CURRENT_EPOCH_LENGTH metric.
  • ArrayRetdata<T> — a private tuple struct (struct ArrayRetdata<T>(Vec<T>)) with zero references. It was early scaffolding (its TODO read "Remove this when we have a CairoStakingContract implementation"); the actual deserialization path uses CairoArray::try_from(retdata) in ContractStaker::from_retdata_many, so the struct was never adopted.

Evidence

  • Workspace-wide grep for EPOCH_LENGTH and ArrayRetdata: the only hit for the deleted const/struct is its own definition; no use crate::contract_types::EPOCH_LENGTH/ArrayRetdata anywhere, and the test module does not reference either.
  • ArrayRetdata returns 0 results across the entire starkware-industries org as well. EPOCH_LENGTH is pub(crate), so cross-repo use is impossible.
  • Remaining imports in the file (CairoArray, RetdataDeserializationError, TryFromIterator) are still used by the surviving code, so no import becomes unused.

Test plan

  • cargo build -p apollo_staking — passes
  • cargo clippy -p apollo_staking --all-targets — clean
  • SEED=0 cargo test -p apollo_staking — 91 passed, 0 failed

Generated by Claude Code

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@asaf-sw asaf-sw requested a review from dafnamatsry June 2, 2026 18:45

@dafnamatsry dafnamatsry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@dafnamatsry reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on asaf-sw).

@asaf-sw asaf-sw force-pushed the code_slayer/remove_dead_code_in_apollo_staking branch from 2022f5e to 5ddb4fd Compare June 3, 2026 14:17
@asaf-sw asaf-sw added this pull request to the merge queue Jun 3, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
@asaf-sw asaf-sw added this pull request to the merge queue Jun 7, 2026
Merged via the queue into main with commit 360fa75 Jun 7, 2026
18 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.

4 participants