apollo_l1_events_types: delete dead code (unsure, review carefully)#14692
Open
asaf-sw wants to merge 1 commit into
Open
apollo_l1_events_types: delete dead code (unsure, review carefully)#14692asaf-sw wants to merge 1 commit into
asaf-sw wants to merge 1 commit into
Conversation
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.
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
L1EventsProviderError::UnexpectedProviderStateTransitionvariant and its sole constructorL1EventsProviderError::unexpected_transition.Why it appears dead
unexpected_transitionandUnexpectedProviderStateTransitioneach have zero references anywhere in the sequencer workspace (whole-word grep acrosscrates/matches only their definitions), including tests and benches.starkware-industries/sequencer-devops,starkware-industries/starkware).unexpected_transition, so with that method removed the variant can never be produced.What a human must verify
L1EventsProviderErroris apuberror enum. Confirm no consumer outside the three repos checked above matches on or constructsUnexpectedProviderStateTransition, 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_WRAPPERunset,CARGO_INCREMENTAL=0)cargo build -p apollo_l1_events_typesand... --tests: zerodead_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