Closed Stebalien closed 4 years ago
This patch extracts the bugfix from #30.
Thanks, this is nice and small and a very clear fix.
What will be the impact on chain state of not landing this right away? Are the HAMTs with incorrect height broken, or just inefficient?
Landing the rest of #30 later will require another version bump, since it changes store interactions. Which is fine.
It looks like it works, it just pushes everything out to a deeper height than necessary.
Now that I think about the fix doesn't require a full re-write. All we need to do is explicitly collapse AMTs that either:
Effectively, just apply the delete logic.
We decided to ship everything (#30) all at once instead of landing this bit by bit.
Currently, when we empty an AMT, we wouldn't collapse the height. This change fixes that.