turbofish-org / merk

High-performance Merkle key/value store
Apache License 2.0
226 stars 36 forks source link

Node deletion could lead to a stack overflow in certain circumstances. #77

Open QuantumExplorer opened 11 months ago

QuantumExplorer commented 11 months ago

Tree node deletion is currently linearly recursive in Merk. This means that if we were to delete elements in a certain way, it would delete the top node, then have a recursive callback to delete the next tree node and so forth. If we deleted a significant amount of tree nodes all of these calls would stay on the stack and would lead to a stack overflow.