apollo_staking: delete dead code#14299
Merged
Merged
Conversation
dafnamatsry
approved these changes
Jun 3, 2026
dafnamatsry
left a comment
Collaborator
There was a problem hiding this comment.
@dafnamatsry reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on asaf-sw).
2022f5e to
5ddb4fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— apub(crate) const u64 = 100. Beingpub(crate), it is not reachable outside the crate, and withinapollo_stakingit is never imported or referenced. TheEPOCH_LENGTHnames that are used elsewhere are unrelated definitions:MockStakingContract::EPOCH_LENGTH(= 30), the localconst EPOCH_LENGTHinmock_staking_contract_test.rs,MIN_EPOCH_LENGTHinstaking_manager.rs, and theSTAKING_CURRENT_EPOCH_LENGTHmetric.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 aCairoStakingContractimplementation"); the actual deserialization path usesCairoArray::try_from(retdata)inContractStaker::from_retdata_many, so the struct was never adopted.Evidence
EPOCH_LENGTHandArrayRetdata: the only hit for the deleted const/struct is its own definition; nouse crate::contract_types::EPOCH_LENGTH/ArrayRetdataanywhere, and the test module does not reference either.ArrayRetdatareturns 0 results across the entirestarkware-industriesorg as well.EPOCH_LENGTHispub(crate), so cross-repo use is impossible.CairoArray,RetdataDeserializationError,TryFromIterator) are still used by the surviving code, so no import becomes unused.Test plan
cargo build -p apollo_staking— passescargo clippy -p apollo_staking --all-targets— cleanSEED=0 cargo test -p apollo_staking— 91 passed, 0 failedGenerated by Claude Code