Chia-Network / clvm_rs

Rust implementation of clvm
Apache License 2.0
67 stars 54 forks source link

improve fidelity of check if atom fits in `SmallAtom` #384

Closed arvidn closed 5 months ago

arvidn commented 5 months ago

This factors out some common code and generally simplifies and unifies the behavior. With additional tests and fuzzer checks.

The second commit addresses the use of as_unique_address(), which is used in ObjectCache as a cheap hash map (index into a Vec). However, with the SmallAtom feature, NodePtr indices is no longer dense, and it no longer works to use a Vec instead of a HashMap. It allocates too much memory if you create an atom with value 0x3ffffff.

This commit is included in this PR since the increased fidelity of matching atoms to SmallAtom pushed the fuzzer over the limit and started failing with out-of-memory.

coveralls-official[bot] commented 5 months ago

Pull Request Test Coverage Report for Build 7900735840

Details


Totals Coverage Status
Change from base Build 7888730470: -0.04%
Covered Lines: 5742
Relevant Lines: 6089

💛 - Coveralls