morpho-data-structures
morpho-data-structures copied to clipboard
Data structures tested and used by the Morpho Protocol.
We can also implement: - #38 - #36 _Originally posted by @QGarchery in https://github.com/morpho-dao/morpho-data-structures/issues/23#issuecomment-1195113603_
POC here: https://github.com/morpho-dao/morpho-v1/pull/1255
When doing the `_shiftUp` and `_shiftDown` operations, the path from the account to shift up to the root is potentially completely changed. This requires many storage writes which is gas...
Found by @MathisGD. Currently the heap size is changing at each `insert`, `remove`, and `decrease` operation. When it reaches `_maxSortedUsers`, it is divided by 2. The informal goal is to...
This PR: - completes #85 - simplifies the loop in insertSorted - simplifies the munging, notably extracting out MockDll