When resources are given back to a resource pool (e.g. Merkle maps in the Cardano transaction prover), they need to be reset properly (e.g. the Merkle map should be compressed so that all its values are represented by their root). This will guarantee that pooled resources are consistent and do not depend from previous computations. (e.g. this will avoid the risk of memory overflow and provide a consistent proving time).
What
Design a reset behavior for pooled resources, and implement it for Merkle maps.
How
[x] Make the pooled resources of ResourcePool implement a Reset trait
[x] Implement the Reset trait for the Merkle map with its compression
Why
When resources are given back to a resource pool (e.g. Merkle maps in the Cardano transaction prover), they need to be reset properly (e.g. the Merkle map should be compressed so that all its values are represented by their root). This will guarantee that pooled resources are consistent and do not depend from previous computations. (e.g. this will avoid the risk of memory overflow and provide a consistent proving time).
What
Design a reset behavior for pooled resources, and implement it for Merkle maps.
How
ResourcePool
implement aReset
traitReset
trait for the Merkle map with its compression