refactor(tree): remove unused Factory generic from multiproof system#18933
Merged
yongkangc merged 6 commits intoyk/worker_pool_accfrom Oct 13, 2025
Merged
refactor(tree): remove unused Factory generic from multiproof system#18933yongkangc merged 6 commits intoyk/worker_pool_accfrom
yongkangc merged 6 commits intoyk/worker_pool_accfrom
Conversation
- Removed the Factory type parameter from the ParallelProof struct, streamlining its definition and implementation. - Updated the constructor and related methods to reflect this change, enhancing code clarity and maintainability. - Eliminated unused PhantomData field, reducing complexity in the struct's design.
- Eliminated the Factory type definition from the proof tests, simplifying the code structure. - This change contributes to improved clarity and maintainability of the test implementation.
- Removed the generic Factory type from MultiProofConfig and related structs, streamlining their definitions and improving code clarity. - Updated methods to reflect the removal of the Factory type, enhancing maintainability. - Adjusted the implementation of PendingMultiproofTask and its associated methods to eliminate unnecessary type parameters, simplifying the codebase.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This refactoring removes the unused Factory generic parameter from the multiproof system components. The generic was originally added to carry ConsistentDbView<Factory> but analysis showed it was never actually accessed in production code.
- Removes the
Factorygeneric fromParallelProof,MultiProofConfig,MultiProofTask, and related types - Simplifies the API by eliminating unnecessary generic type parameters
- Updates method signatures and removes phantom data fields that were only used to maintain generic constraints
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/trie/parallel/src/proof.rs | Removes Factory generic from ParallelProof struct and impl blocks, removes phantom data field |
| crates/engine/tree/src/tree/payload_processor/multiproof.rs | Removes Factory generic from all multiproof-related structs and simplifies configuration creation |
| crates/engine/tree/src/tree/payload_processor/mod.rs | Updates method call to use simplified configuration creation without Factory generic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Comment on lines
+81
to
84
| /// Creates a new state root config from the trie input. | ||
| /// | ||
| /// This returns a cleared [`TrieInput`] so that we can reuse any allocated space in the | ||
| /// [`TrieInput`]. |
There was a problem hiding this comment.
The documentation comment is outdated. The method now extracts/splits configuration from input rather than creating 'from' input, and it returns both a cleared TrieInput and the config.
Suggested change
| /// Creates a new state root config from the trie input. | |
| /// | |
| /// This returns a cleared [`TrieInput`] so that we can reuse any allocated space in the | |
| /// [`TrieInput`]. | |
| /// Extracts configuration from the given [`TrieInput`], splitting out the config and returning | |
| /// both a cleared [`TrieInput`] (for reuse of allocated space) and the extracted [`MultiProofConfig`]. | |
| /// | |
| /// This allows for efficient reuse of the input's allocated space and separates the configuration | |
| /// needed for multiproof computation. |
mediocregopher
approved these changes
Oct 10, 2025
shekhirin
approved these changes
Oct 10, 2025
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.
Removes the unused
Factorygeneric parameter fromParallelProof,MultiProofConfig,MultiProofTask, and related types. The generic only existed to carryConsistentDbView<Factory>but was never accessed.Closes #18932