Repository navigation
refactor: remove dead code, duplication and needless allocations - #448
Merged
Merged
Conversation
Collapse the transaction execution wrappers into one sanitize and one check-and-process path, share program ELF extraction in AccountsDb, and drop clones that only existed to read account metadata.
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.
Summary
Behavior-preserving cleanup across
litesvm,persistence,token,loaderandcpi-tree(−333 lines). The main change is the transaction pipeline:Also:
AccountsDb::load_programandtry_program_elf_bytesshare one ELF-extraction helper, the clock sysvar reuseshandle_sysvar, and clones made only to read account metadata are now borrows.Evidence
After: 167 tests pass,
cargo clippy --all-features --all-targetsandcargo +nightly fmt --checkclean, and the crate builds with default features.simple_bench,max_perf,set_clock) show no difference beyond run-to-run noise. Two runs of the same code drifted by up to 5.5%.Merge Danger
Door: two-way
Pure refactor, reverting is trivial.
Blast Radius: low
Things you might notice:
log::error!messages inaccounts_dbare worded differently.persistence::save_to_filenow serializes before it opens the file, so a failed serialization no longer leaves an empty file behind.