Skip to content

apollo_l1_events_types: delete dead code (unsure, review carefully)#14692

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

apollo_l1_events_types: delete dead code (unsure, review carefully)#14692
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_l1_events_types

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 L1EventsProviderError::UnexpectedProviderStateTransition variant and its sole constructor L1EventsProviderError::unexpected_transition.

Why it appears dead

  • unexpected_transition and UnexpectedProviderStateTransition each have zero references anywhere in the sequencer workspace (whole-word grep across crates/ matches only their definitions), including tests and benches.
  • Both have zero references in either sibling repo (starkware-industries/sequencer-devops, starkware-industries/starkware).
  • The variant is constructed exclusively by unexpected_transition, so with that method removed the variant can never be produced.

What a human must verify

  • L1EventsProviderError is a pub error enum. Confirm no consumer outside the three repos checked above matches on or constructs UnexpectedProviderStateTransition, and that this state-transition error is not scaffolding for imminent work.

The other variants (Uninitialized, UnexpectedHeight, UnexpectedProviderState) are retained and still used.

Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0)

  • cargo build -p apollo_l1_events_types and ... --tests: zero dead_code/unused_* warnings.
  • cargo clippy -p apollo_l1_events_types --all-targets: clean.
  • SEED=0 cargo test -p apollo_l1_events_types: passes.

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 `L1EventsProviderError::UnexpectedProviderStateTransition`
variant and its sole constructor `L1EventsProviderError::unexpected_transition`.

Evidence it is dead:
- `unexpected_transition` and `UnexpectedProviderStateTransition` each have
  zero references anywhere in the sequencer workspace (whole-word grep across
  `crates/` matches only their definitions), including tests and benches.
- Both have zero references in the sibling repos
  `starkware-industries/sequencer-devops` and `starkware-industries/starkware`.
- The variant is constructed exclusively by `unexpected_transition`, so with
  that method removed the variant can never be produced.

The other `L1EventsProviderError` variants (`Uninitialized`,
`UnexpectedHeight`, `UnexpectedProviderState`) are retained and still used.

Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0):
`cargo build -p apollo_l1_events_types` and
`cargo build -p apollo_l1_events_types --tests` build with zero
dead_code/unused warnings; `cargo clippy` clean; `cargo test` passes.
@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