Skip to content

Conversation

GarmashAlex
Copy link
Contributor

Previously, each file-import chunk created a new StaticFileProducer and passed it into a freshly built pipeline. StaticFileProducer is a lightweight Arc<Mutex<...>> wrapper with no chunk-specific state and is safe to clone and reuse. Creating it per chunk caused unnecessary allocations and event-channel setups without any functional benefit.
This change creates one StaticFileProducer before the import loop and passes static_file_producer.clone() into each pipeline build. It aligns the import path with the node’s engine lifecycle (where a single producer is reused), reduces overhead, and preserves behavior.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

doc nits

.sealed_header(provider_factory.last_block_number()?)?
.expect("should have genesis");

// Reuse a single StaticFileProducer across all chunks
Copy link
Collaborator

Choose a reason for hiding this comment

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

please dont add comments like pr descriptions

these are totally useless without the pr context

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Oct 17, 2025
@mattsse mattsse requested a review from joshieDo October 17, 2025 10:27
@mattsse mattsse added the C-debt A clean up/refactor of existing code label Oct 17, 2025
@mattsse mattsse enabled auto-merge October 17, 2025 15:13
@mattsse mattsse added this pull request to the merge queue Oct 18, 2025
@mattsse mattsse removed this pull request from the merge queue due to a manual request Oct 18, 2025
@mattsse mattsse merged commit 8d91b9e into paradigmxyz:main Oct 18, 2025
40 of 41 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-debt A clean up/refactor of existing code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants