Skip to content

starknet_patricia_storage: delete dead code (unsure, review carefully)#14696

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

starknet_patricia_storage: delete dead code (unsure, review carefully)#14696
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_starknet_patricia_storage

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 struct BorrowedStorage<'a, S: Storage> from starknet_patricia_storage::map_storage.

Why it appears dead

  • BorrowedStorage has zero references anywhere in the sequencer workspace (a whole-word grep across crates/ matches only its definition), including tests and benches. It has no impl blocks and is never constructed.
  • Zero references in either sibling repo (starkware-industries/sequencer-devops, starkware-industries/starkware).
  • It is a #[derive(Serialize)] wrapper around &mut S: Storage that was never wired up (contrast MapStorage, the used type in the same module).

What a human must verify

  • The struct is pub. Confirm no consumer outside the three repos checked above uses it, and that it is not scaffolding for a planned "serialize a borrowed storage" path.

Scope notes

  • No imports are orphaned: Storage and Serialize remain used by other items in the module (MapStorage and the storage-trait impls).

Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0)

  • cargo build -p starknet_patricia_storage and cargo build -p starknet_patricia_storage --tests: zero dead_code/unused_* warnings.
  • cargo clippy -p starknet_patricia_storage --all-targets: clean.
  • SEED=0 cargo test -p starknet_patricia_storage: passes (8 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 struct `BorrowedStorage<'a, S: Storage>` from
`starknet_patricia_storage::map_storage`.

Evidence it is dead:
- `BorrowedStorage` has zero references anywhere in the sequencer workspace
  (whole-word grep across `crates/` matches only its definition), including
  tests and benches. It has no `impl` blocks and is never constructed.
- Zero references in the sibling repos `starkware-industries/sequencer-devops`
  and `starkware-industries/starkware`.

It is a `#[derive(Serialize)]` wrapper around `&mut S: Storage` that was never
wired up. Removing it orphans no imports: `Storage` and `Serialize` remain used
by other items in the module (e.g. `MapStorage` and the storage-trait impls).

Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0):
`cargo build -p starknet_patricia_storage` 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 nimrod-starkware July 4, 2026 07:04
@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