Skip to content

Conversation

@WilliamNwoke
Copy link
Contributor

@WilliamNwoke WilliamNwoke commented Oct 19, 2025

Resolves #19077

Refactored the implementation to use a streaming iterator approach that processes wiped storage entries directly from the database cursor without intermediate collection. Key changes:

Added StorageWipedEntriesIter: A new iterator that yields wiped storage entries on-demand from the database cursor

Integrated with StorageRevertsIter: Combined with existing reverts processing for efficient merging

@WilliamNwoke
Copy link
Contributor Author

Please review @yongkangc @mattsse

Copy link
Member

@yongkangc yongkangc left a comment

Choose a reason for hiding this comment

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

Think we could simplify this without the abstraction

ref:

fn write_storage_trie_changesets<'a>(
cc @mediocregopher would be great to get ur thoughts as well :)

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Oct 20, 2025
@yongkangc yongkangc requested a review from Copilot October 21, 2025 00:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the collection of wiped storage entries by replacing an intermediate Vec allocation with a streaming iterator that processes entries directly from the database cursor.

Key Changes:

  • Introduces WipedStorageIter for lazy iteration over wiped storage entries
  • Refactors storage revert writing to use the new iterator instead of collecting into a Vec

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/storage/provider/src/changesets_utils/wiped_storage.rs New file implementing WipedStorageIter for streaming wiped storage entries
crates/storage/provider/src/changesets_utils/mod.rs Exports the new WipedStorageIter type
crates/storage/provider/src/providers/database/provider.rs Replaces Vec collection with WipedStorageIter in storage revert writing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yongkangc yongkangc requested a review from Copilot October 28, 2025 08:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@mediocregopher mediocregopher left a comment

Choose a reason for hiding this comment

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

He @WilliamNwoke , sorry it took so long to look at this. I think the code could be simplified a little further, left a comment about that 🙏

@WilliamNwoke
Copy link
Contributor Author

Please review @mediocregopher @yongkangc

@0xKarl98
Copy link
Contributor

0xKarl98 commented Nov 8, 2025

Is this PR still active ?

@WilliamNwoke
Copy link
Contributor Author

Is this PR still active ?

Yeah. Apologies for the late response
Please review @mediocregopher @yongkangc

@WilliamNwoke
Copy link
Contributor Author

@yongkangc @mediocregopher @mattsse Please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

perf(storage): optimize wiped storage entry collection to avoid unnecessary Vec allocation

4 participants