native_blockifier: delete dead code (unsure, review carefully) - #14882
native_blockifier: delete dead code (unsure, review carefully)#14882asaf-sw wants to merge 1 commit into
Conversation
Removes an entirely-unused test-only module and an unused generic helper: - `src/py_test_utils.rs` (whole file) and its `#[cfg(any(feature = "testing", test))] pub mod py_test_utils;` declaration in lib.rs. The module's only items (`create_py_test_state`, `TOKEN_FOR_TESTING_CLASS_HASH`, `TOKEN_FOR_TESTING_CONTRACT_PATH`) are referenced nowhere -- not in `native_blockifier`'s own test files, any other workspace crate, or the sibling repos. Note `native_blockifier` declares no `testing` feature, so the module only ever compiled under `cfg(test)`; it is not part of the compiled Python extension and cannot be reached from the Python side. - `to_py_vec` in `py_utils.rs`: a `pub` generic helper with no callers anywhere. It is a plain Rust `pub fn` (not a `#[pyfunction]`/pyo3 export), so it is not reachable from Python either. Evidence: a workspace-wide grep for each identifier (`create_py_test_state`, `TOKEN_FOR_TESTING_*`, `to_py_vec`) across all crates and the sibling repos `starkware-industries/sequencer-devops` and `starkware-industries/starkware` finds only the definition sites. Verification (env workarounds: `RUSTC_WRAPPER=`, `CARGO_INCREMENTAL=0`): - `cargo build -p native_blockifier` -- clean, zero warnings. - `cargo build -p native_blockifier --tests` -- clean, zero warnings (this is the cfg that compiles `py_test_utils`). - `cargo clippy -p native_blockifier --all-targets` -- clean. - `SEED=0 cargo test -p native_blockifier` -- passes. Filed as low-confidence: `native_blockifier` is the (legacy) Python-binding crate and `py_test_utils.rs` historically referenced a path in the StarkWare repo build directory. These items have no in-workspace or sibling-repo callers and are not pyo3-exposed, but a human owner should confirm no external build/test harness depends on them before merging.
|
Artifacts upload workflows: |
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on asaf-sw).
a discussion (no related file):
did you bump the py-side commit to point to this change? if it passes, then this PR seems fine to me
|
Thanks for looking. I'm an automated routine and can't bump the py-side pin or trigger the py-side CI myself, so that final gate is yours to run — but here's the evidence that the py-side can't be affected by this diff:
So bumping the py-side commit to this change should be a no-op for the build. If you'd still like the py-side CI run as the safety check before merging, that step is on your side — please go ahead, and I'll adjust if anything unexpected turns up. Generated by Claude Code |
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.
What
Removes an entirely-unused test-only module and an unused generic helper:
src/py_test_utils.rs(whole file) and its#[cfg(any(feature = "testing", test))] pub mod py_test_utils;declaration inlib.rs. The module's only items —create_py_test_state,TOKEN_FOR_TESTING_CLASS_HASH,TOKEN_FOR_TESTING_CONTRACT_PATH— are referenced nowhere: not innative_blockifier's own test files, any other workspace crate, or the sibling repos.native_blockifierdeclares notestingfeature, so the module only ever compiled undercfg(test)— it is not part of the compiled Python extension and cannot be reached from Python.to_py_vecinpy_utils.rs: apubgeneric helper with no callers anywhere. It is a plain Rustpub fn(not a#[pyfunction]pyo3 export), so it is not reachable from Python either.Why these look dead
A workspace-wide grep for each identifier (
create_py_test_state,TOKEN_FOR_TESTING_*,to_py_vec) across all crates and the sibling reposstarkware-industries/sequencer-devopsandstarkware-industries/starkwarefinds only the definition sites.What a human must verify
native_blockifieris the (legacy) Python-binding crate, andpy_test_utils.rshistorically referenced a path inside the StarkWare repo build directory. These items have no in-workspace or sibling-repo callers and are not pyo3-exposed, but the owner should confirm no external build/test harness depends on them before merging.Verification (local)
Env workarounds applied (
RUSTC_WRAPPER=,CARGO_INCREMENTAL=0):cargo build -p native_blockifier— clean, zero warnings.cargo build -p native_blockifier --tests— clean, zero warnings (this is the cfg that compilespy_test_utils).cargo clippy -p native_blockifier --all-targets— clean.SEED=0 cargo test -p native_blockifier— 3 passed.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