refactor(trie): restructure proof task worker#19060
Conversation
There was a problem hiding this comment.
Pull Request Overview
Refactor to restructure trie proof task workers from function-based loops into dedicated worker structs for improved clarity and reuse.
- Introduces StorageProofWorker and AccountProofWorker structs with run methods.
- Extracts shared transaction/factory logic into ProofTaskTx and centralizes worker pool management in ProofWorkerHandle.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a96d82a to
0af4c5b
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| /// Provided by the user to give the necessary context to retain extra proofs. | ||
| multi_added_removed_keys: Option<Arc<MultiAddedRemovedKeys>>, | ||
| /// Worker responsible for account trie operations. | ||
| struct AccountProofWorker<Factory> { |
There was a problem hiding this comment.
this is the only change - worker struct
| self.task_ctx.state_sorted.as_ref(), | ||
| ); | ||
| /// Worker responsible for storage trie operations. | ||
| struct StorageProofWorker<Factory> { |
There was a problem hiding this comment.
this is the only change with AccountProofWorker
|
Will be letting this run in Reth4 for abit |
Following the pattern from PR #19060, extract common blinded node processing logic into helper methods on ProofTaskTx: - Add process_blinded_storage_node() - handles storage trie node lookups - Add process_blinded_account_node() - handles account trie node lookups Worker methods now delegate to these helpers, keeping them simple and focused on tracing/metrics while the business logic lives in ProofTaskTx. This reduces code duplication and follows established patterns in the codebase.
Following the pattern from PR #19060, extract common blinded node processing logic into helper methods on ProofTaskTx: - Add process_blinded_storage_node() - handles storage trie node lookups - Add process_blinded_account_node() - handles account trie node lookups Worker methods now delegate to these helpers, keeping them simple and focused on tracing/metrics while the business logic lives in ProofTaskTx. This reduces code duplication and follows established patterns in the codebase.
Closes: #19007
Changes:
spawn_account_loop->AccountProofWorker::run()