-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Labels
L1Ethereum clientEthereum clientrustPull requests that update rust codePull requests that update rust codetech debtRefactors, cleanups, etcRefactors, cleanups, etc
Description
Campaign: Remove/justify clone() across the codebase
We want to reduce unnecessary clones in hot paths and make intentional clones explicit.
Goals
- Every
clone()must be reviewed. - If a clone is removed → commit the change and check it off here.
- If a clone is kept → add a comment above the line with
// ok-clone: <reason>.
Sub-issues
- VM & execution (
crates/vm/**) - Sequencer / L2 core (
crates/l2/**) - Networking P2P (
crates/networking/p2p/**) - Networking RPC (
crates/networking/rpc/**) - Blockchain core (
crates/blockchain/**) - Storage & trie (
crates/storage/**,crates/common/trie/**) - Common types/serde (
crates/common/types/**,crates/common/serde_utils.rs) - CLI/tooling/docs (
cmd/**,tooling/**,docs/**)
Process
- Locate all
clone()calls. - Classify:
- Unnecessary → refactor to avoid copying (
&T,Arc<T>,Cow,copied(), etc). - Required → keep and mark with
// ok-clone: <reason>.
- Unnecessary → refactor to avoid copying (
- Submit small PRs per subsystem.
Examples
// ok-clone: needed to increment Arc refcount
let x = arc_value.clone();
// ok-clone: async move requires owned value
tokio::spawn(do_work(config.clone()));
// ok-clone: serde requires owned String
let json = serde_json::to_string(&data.clone())?;Metadata
Metadata
Assignees
Labels
L1Ethereum clientEthereum clientrustPull requests that update rust codePull requests that update rust codetech debtRefactors, cleanups, etcRefactors, cleanups, etc
Type
Projects
Status
Blocked