- Added a debug assertion to ensure active_handles does not underflow when dropping a ProofTaskManagerHandle.
- Implemented metrics recording to flush before exit when the last handle is dropped, enhancing monitoring capabilities.
- Added a constant `MIN_WORKER_COUNT` to enforce a minimum number of workers for storage and account proof tasks.
- Updated `default_storage_worker_count` and `default_account_worker_count` functions to utilize the new minimum constraint.
- Enhanced setter methods in `TreeConfig` to ensure worker counts do not fall below the minimum.
- Modified command-line argument parsing to validate worker counts against the minimum requirement.
- Replaced the ProofTaskManager with a new spawn_proof_workers function for better clarity and maintainability.
- Updated related code to utilize the new function, simplifying the worker spawning process.
- Enhanced metrics tracking for storage and account proof requests, ensuring thread-safe operations.
- Improved error handling and code structure across proof task implementations.
- 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.
- 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 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.
- an account worker / loop
- a storage worker / loop
- streamline worker spawning functions in ProofTaskManager
- Consolidated worker spawning logic by renaming and simplifying the `spawn_worker_pool` function to `spawn_storage_workers` and `spawn_account_workers`, enhancing clarity and maintainability.
- Removed the `WorkerType` enum and associated logic, as the worker type is now inferred from the context, reducing complexity.
- Updated comments to better describe the purpose and parameters of the new functions, improving code documentation.
- Introduced `AccountMultiproofParams` struct to encapsulate parameters for building account multiproofs, reducing the number of arguments in the `build_account_multiproof_with_storage_roots` function.
- Updated the `account_worker_loop` to use the new struct, improving code readability and maintainability.
- Introduced `storage_worker_count` and `account_worker_count` fields in `EngineArgs` to allow configuration of the number of workers in the Tokio blocking pool.
- Updated the `tree_config` method to incorporate these new fields, enhancing flexibility in managing proof worker resources.
- Updated CLI documentation to reflect the new configuration options for improved user guidance.
- Updated comments for `proof_task_handle` parameters in the `MultiproofManager` initialization to specify their roles for storage and account proof workers, improving code clarity and maintainability.
- Introduced a new function `default_account_worker_count` to calculate the default number of account worker threads, set to 1.5 times the storage worker count.
- Updated the `TreeConfig` implementation to use the new account worker count function, enhancing performance for I/O-bound tasks related to storage proof collection and account trie traversal.
- Replaced the `storage_proof_handle` parameter with `storage_work_tx` in the `account_worker_loop` function to facilitate direct communication with the storage worker queue.
- Modified the `queue_storage_proofs` function to accept a mutable reference to `storage_prefix_sets`, improving efficiency by avoiding unnecessary clones.
- Enhanced the initialization of `collected_decoded_storages` to use pre-allocated capacity, optimizing memory usage during proof collection.
- Before this change the code did:
StorageRootTargets::new(
prefix_sets.account_prefix_set.iter().map(|n|
B256::from_slice(&nibbles.pack())),
prefix_sets.storage_prefix_sets.clone(),
).len()
StorageRootTargets::new(..) builds a brand-new
B256Map<PrefixSet> by:
- cloning every entry in storage_prefix_sets (each PrefixSet can
hold dozens of nibble prefixes), and
- allocating a fresh B256Map to hold them.
- We only needed the resulting length, so those clones/allocations
were immediately thrown away.
- replace standard mpsc channels with crossbeam channels in `ProofTaskManager`
- Updated `proof_task_rx` and `proof_task_tx` to use `CrossbeamReceiver` and `CrossbeamSender` for improved performance and non-blocking behavior.
- Renamed `collect_storage_proofs` to `queue_storage_proofs` to better reflect its functionality of returning receivers for storage proofs.
- Enhanced documentation to clarify the interleaved parallelism between account trie traversal and storage proof computation.
- Updated comments for `storage_proof_task_handle` and `account_proof_task_handle` to clarify their roles in managing proof tasks.
- Adjusted method calls to use the updated handle references, enhancing code readability and maintainability.
- Removed the generic type parameter `Factory` from the `ProofTaskManager` struct and its implementation, streamlining the code.
- Updated the `new` and `spawn_worker_pool` methods to maintain functionality while simplifying type handling.
- Enhanced clarity and reduced complexity in the proof task management logic.
- Updated the field name from `storage_proof_task_handle` to `proof_task_handle` in the `ParallelProof` struct to better reflect its purpose.
- Adjusted related method signatures and internal references to maintain consistency throughout the codebase.
- Removed the generic type parameter from `ProofTaskManagerHandle` and related structures to streamline the code.
- Updated the `MultiproofManager` and `ProofTaskManager` to use the simplified handle, enhancing clarity and reducing complexity.
- Adjusted method signatures and internal logic to accommodate the changes while maintaining functionality.
- Removed the `send_worker_unavailable_error` method from both `StorageWorkerJob` and `AccountWorkerJob` enums to streamline error handling.
- Updated task dispatching logic in `ProofTaskMessage` to ensure that errors are handled more directly without the need for separate error sending methods.
- Enhanced clarity and maintainability of the code by reducing redundancy in error management.