Skip to content

apollo_integration_tests: delete dead code (unsure, review carefully) - #15190

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

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

Conversation

@asaf-sw

@asaf-sw asaf-sw commented Oct 10, 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.

Description

Deletes two unused pub convenience methods from IntegrationTestManager in
crates/apollo_integration_tests/src/integration_test_manager.rs:

  • await_txs_accepted_on_all_running_nodes(&mut self, target_n_txs: usize)
  • get_num_accepted_txs_on_all_running_nodes(&self) -> HashMap<usize, usize>

Both are _on_all_running_nodes convenience wrappers over existing, still-used
methods/helpers:

  • await_txs_accepted_on_all_running_nodes wrapped perform_action_on_all_running_nodes + the
    monitoring_utils::await_txs_accepted helper (which keeps other callers, e.g.
    sequencer_simulator_utils.rs, bin/sequencer_simulator.rs).
  • get_num_accepted_txs_on_all_running_nodes wrapped
    get_num_accepted_txs_on_running_nodes(&self.get_running_node_indices()); the inner
    get_num_accepted_txs_on_running_nodes keeps other callers in this same file.

The PR also drops the now-unused monitoring_utils::await_txs_accepted import from
integration_test_manager.rs (its only use in this file was the deleted method; the helper
itself is kept, as it is used elsewhere).

Why this may be dead

  • Neither method has any caller anywhere in the starkware-libs/sequencer workspace (including
    every tests/, benches/, and src/bin/* target), confirmed by a whole-workspace
    word-boundary grep.
  • Neither name appears anywhere in the sibling repos starkware-industries/sequencer-devops or
    starkware-industries/starkware (scripts/config/code).
  • Both methods predate this repo's (shallow) history window, i.e. they have been unused for at
    least ~2 months — they are not freshly-added scaffolding.
  • Removing them is self-contained: every helper they called retains other live callers, so no
    transitive dead code is introduced.

What a human must verify

This crate is a test-harness library whose pub API is intended as a reusable toolbox for
integration-test authors. These two _on_all_running_nodes wrappers may be deliberately kept as
convenience building blocks for future or out-of-tree test scenarios, even though nothing calls
them today. A maintainer should confirm these wrappers are not intended as kept public
test-API
(e.g. for an upcoming test, or for consumers outside the three repos checked above)
before merging. If they are intended to be kept, this is a false positive — please comment why
and close the PR.

Verification

  • scripts/rust_fmt.sh — clean.
  • cargo build -p apollo_integration_tests (default/lib) — Finished, zero
    dead_code/unused/never read warnings. (CI runs with RUSTFLAGS="-D warnings", so the
    now-unused await_txs_accepted import had to be removed too.)
  • cargo clippy -p apollo_integration_tests --all-targets — Finished, zero warnings. This
    type-checks the lib, all bins, and all test targets (i.e. both the default and cfg(test)
    configurations), confirming the deletion introduces no dead-code/unused warnings in either cfg.
  • cargo build -p apollo_integration_tests --tests (full link) and the integration-test run
    could not be completed in this sandbox: linking the crate's ~15 integration-test binaries (each
    statically links the whole node stack) exhausts the session's fixed disk allowance and fails
    with error: linking with 'cc' failed (ENOSPC), and the tests themselves require a live
    multi-node network. This is an environmental limit, not a property of this change — and since the
    deletion only removes methods that have no callers, it cannot affect any test's behavior.

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 with Claude Code

https://claude.ai/code/session_01AHduHDPL9JJPafP1GJxHWL


Generated by Claude Code

Delete two unused `pub` convenience methods from `IntegrationTestManager`:
`await_txs_accepted_on_all_running_nodes` and
`get_num_accepted_txs_on_all_running_nodes`, plus the now-unused
`monitoring_utils::await_txs_accepted` import they left behind.

Both are `_on_all_running_nodes` wrappers over still-used methods/helpers
(`perform_action_on_all_running_nodes` + `await_txs_accepted`, and
`get_num_accepted_txs_on_running_nodes(get_running_node_indices())`
respectively); the wrapped items retain other live callers, so removal is
self-contained. Neither method has any caller anywhere in the sequencer
workspace (all `tests/`/`benches/`/`src/bin/*` included) or in the sibling
repos sequencer-devops and starkware, and both predate the repo's shallow
history window (unused for >2 months, not fresh scaffolding).

Marked "unsure, review carefully": this is a test-harness library whose `pub`
API is a reusable toolbox, so these wrappers may be intentionally kept for
future or out-of-tree test authors even without current callers. A maintainer
should confirm they are not intended as kept public test-API before merging.

Verified: rust_fmt clean; `cargo build -p apollo_integration_tests` and
`cargo clippy -p apollo_integration_tests --all-targets` both finish with zero
dead_code/unused warnings (clippy covers lib + bins + tests, i.e. both cfgs).
The `--tests` full link and the test run are environmentally infeasible here
(linking ~15 full-node-stack test binaries exhausts the session disk; tests
need a live multi-node network); removing uncalled methods cannot change test
behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AHduHDPL9JJPafP1GJxHWL
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

This branch has not been deployed

No deployments
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