Skip to content

Commit 289bcf0

Browse files
authored
feat(weight): add fallible constructors and enhance security documentation (#108)
- Introduced `try_with_capacity` and `try_with_capacity` methods for `WeightStore` and `ConcurrentWeightStore`, allowing for non-panicking allocation when capacity is derived from untrusted input. - Added a comprehensive section on security considerations in the module documentation, addressing risks related to hashers, capacity management, and handling sensitive values. - Updated the `clear` method to attribute removed entries to the `removes` metric, ensuring accurate tracking of bulk operations alongside per-entry removals. - Improved documentation for existing constructors to clarify panic behavior on allocator failure. These changes enhance the robustness and security of the weight store implementations, aligning with best practices for handling untrusted input and sensitive data.
1 parent 96c45d6 commit 289bcf0

1 file changed

Lines changed: 384 additions & 3 deletions

File tree

0 commit comments

Comments
 (0)