Skip to content

apollo_consensus_manager: delete dead code (unsure, review carefully)#14693

Open
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_consensus_manager
Open

apollo_consensus_manager: delete dead code (unsure, review carefully)#14693
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_consensus_manager

Conversation

@asaf-sw

@asaf-sw asaf-sw commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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_manager from apollo_consensus_manager::consensus_manager.

Why it appears dead

  • create_consensus_manager has zero references anywhere in the sequencer workspace (a whole-word grep across crates/ matches only its definition), including tests and benches.
  • Zero references in either sibling repo (starkware-industries/sequencer-devops, starkware-industries/starkware).
  • It is a thin convenience wrapper whose entire body is ConsensusManager::new(ConsensusManagerArgs { .. }). The node builds the manager directly via ConsensusManager::new(ConsensusManagerArgs { .. }) in apollo_node/src/components.rs, so this wrapper is superseded and uncalled.

What a human must verify

  • create_consensus_manager is pub. 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 direct ConsensusManager::new call site suggests not).

Scope notes

  • 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 the sibling create_committee_provider are retained (both live).

Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0)

  • cargo build -p apollo_consensus_manager and ... --tests: zero dead_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

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.
@asaf-sw asaf-sw requested a review from ShahakShama July 4, 2026 06:16
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

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