apollo_consensus_manager: delete dead code (unsure, review carefully)#14693
Open
asaf-sw wants to merge 1 commit into
Open
apollo_consensus_manager: delete dead code (unsure, review carefully)#14693asaf-sw wants to merge 1 commit into
asaf-sw wants to merge 1 commit into
Conversation
Removes the unused free function `create_consensus_manager`.
Evidence it is dead:
- `create_consensus_manager` has zero references anywhere in the sequencer
workspace (whole-word grep across `crates/` matches only its definition),
including tests and benches.
- Zero references in the sibling repos `starkware-industries/sequencer-devops`
and `starkware-industries/starkware`.
- It is a thin wrapper that only calls `ConsensusManager::new(ConsensusManagerArgs { .. })`.
The node constructs the manager directly via
`ConsensusManager::new(ConsensusManagerArgs { .. })` in
`apollo_node/src/components.rs`, so this wrapper is superseded and uncalled.
No imports are orphaned: every type in the removed signature
(`ConsensusManagerArgs`, the `Shared*Client` aliases,
`L1GasPriceProviderClient`, `CommitteeProvider`) still has other live uses in
the file. `ConsensusManager::new` and `create_committee_provider` are retained.
Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0):
`cargo build -p apollo_consensus_manager` and `... --tests` build with zero
dead_code/unused warnings; `cargo clippy` clean; `SEED=0 cargo test` passes.
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.
Caution
REVIEW WITH CARE! THIS PR REQUIRES CAREFUL HUMAN REVIEW.
If you find this to be a false positive comment in detail why this code should be kept and close the PR.
This PR removes the unused free function
create_consensus_managerfromapollo_consensus_manager::consensus_manager.Why it appears dead
create_consensus_managerhas zero references anywhere in the sequencer workspace (a whole-word grep acrosscrates/matches only its definition), including tests and benches.starkware-industries/sequencer-devops,starkware-industries/starkware).ConsensusManager::new(ConsensusManagerArgs { .. }). The node builds the manager directly viaConsensusManager::new(ConsensusManagerArgs { .. })inapollo_node/src/components.rs, so this wrapper is superseded and uncalled.What a human must verify
create_consensus_managerispub. Confirm no consumer outside the three repos checked above calls it, and that it is not intended as the canonical construction entry point for planned work (the directConsensusManager::newcall site suggests not).Scope notes
ConsensusManagerArgs, theShared*Clientaliases,L1GasPriceProviderClient,CommitteeProvider) still has other live uses in the file.ConsensusManager::newand the siblingcreate_committee_providerare retained (both live).Verification (env:
RUSTC_WRAPPERunset,CARGO_INCREMENTAL=0)cargo build -p apollo_consensus_managerand... --tests: zerodead_code/unused_*warnings.cargo clippy -p apollo_consensus_manager --all-targets: clean.SEED=0 cargo test -p apollo_consensus_manager: passes (3 tests).Caution
REVIEW WITH CARE! THIS PR REQUIRES CAREFUL HUMAN REVIEW.
If you find this to be a false positive comment in detail why this code should be kept and close the PR.
Generated by Claude Code