refactor(trie): reorder proof_task.rs for better code organization#19313
Closed
refactor(trie): reorder proof_task.rs for better code organization#19313
Conversation
yongkangc
added a commit
that referenced
this pull request
Oct 27, 2025
Reorganizes multiproof.rs to follow Rust file organization conventions: 1. Public types first (SparseTrieUpdate, MultiproofInput) 2. MultiproofManager and its implementation 3. MultiProofTask and its implementation 4. Helper functions No logic changes - pure code organization for improved readability. Main public types are now at the top, making it easier to understand the module's interface at a glance. Part of #19182 Depends on: #19313
Introduces a new ProofResult enum that can represent either: - Account multiproofs with statistics - Storage proofs for specific accounts This eliminates unnecessary wrapping/unwrapping of storage proofs and removes the redundant PendingMultiproofTask/StorageMultiproofInput abstractions. Changes: - Introduced ProofResult enum with AccountMultiproof and StorageProof variants - Added into_multiproof() helper method for conversion when needed - Updated ProofResultMessage to use Result<ProofResult, ParallelStateRootError> - Updated all producers (storage/account workers) to return appropriate variants - Updated all consumers to match on the enum variants - Removed unused AccountMultiproofResult type alias - Used unreachable!() for impossible code paths (type safety guarantees) - Used debug_assert_eq!() for address validation (checked in debug builds) - Removed PendingMultiproofTask enum (unnecessary wrapper) - Removed StorageMultiproofInput struct (never constructed in practice) - Simplified dispatch() to always take MultiproofInput directly - Removed dispatch_storage_proof() method Part of #19182
Reorganizes proof_task.rs to follow Rust file organization conventions: 1. Type aliases at top 2. Public enums and structs (ProofResult, ProofWorkerHandle, etc.) 3. Public functions 4. Private/internal types (StorageWorkerJob, AccountWorkerJob) 5. Private functions (worker loops, helpers) No logic changes - pure code organization for improved readability. Files are now structured with main public API at the top, making it easier to understand the module's interface. Part of #19182 Depends on: #19311
yongkangc
added a commit
that referenced
this pull request
Oct 27, 2025
Reorganizes multiproof.rs to follow Rust file organization conventions: 1. Public types first (SparseTrieUpdate, MultiproofInput) 2. MultiproofManager and its implementation 3. MultiProofTask and its implementation 4. Helper functions No logic changes - pure code organization for improved readability. Main public types are now at the top, making it easier to understand the module's interface at a glance. Part of #19182 Depends on: #19313
a20d521 to
2ad0725
Compare
ad1cb0a to
68c6079
Compare
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.
Part of #19182 - Stack of PRs for easier review
Depends on: #19311
Reorganizes
proof_task.rsto follow better flow. This module is organized in the order: