Skip to content

apollo_storage: delete dead code#14107

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

apollo_storage: delete dead code#14107
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_storage

Conversation

@asaf-sw
Copy link
Copy Markdown
Contributor

@asaf-sw asaf-sw commented May 19, 2026

Description

Remove begin_persistent_rw_txn() and OwnedDbWriteTransaction from crates/apollo_storage/src/db/mod.rs.

Both were annotated with #[allow(dead_code)] and have zero callers anywhere in the codebase:

  • begin_persistent_rw_txn(): a method on DbWriter that used unsafe { std::mem::transmute(...) } to extend a transaction's lifetime to 'static. It was written for a "persistent transaction" pattern in batching mode, but was never wired up.
  • OwnedDbWriteTransaction: the struct returned by begin_persistent_rw_txn(), which held an Arc<Environment> to keep the environment alive. Deleting the constructor makes the struct unreachable, so both are removed together.

Generated by Claude Code

Remove begin_persistent_rw_txn() and OwnedDbWriteTransaction from
db/mod.rs. Both were annotated with #[allow(dead_code)] and have zero
callers across the entire codebase. The struct used unsafe transmute to
extend a transaction lifetime, and the method was the only way to
construct it.
@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@github-actions
Copy link
Copy Markdown

Artifacts upload workflows:

Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on dan-starkware).

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.

4 participants