cosmos / iavl

Merkleized IAVL+ Tree implementation in Go
Apache License 2.0
420 stars 263 forks source link

nodeDb.DeleteVersionsFrom can leave mutex locked indefinitely hence a deadlock #842

Closed odeke-em closed 11 months ago

odeke-em commented 12 months ago

Noticed in an audit and while preparing a test for P #838 that this code exists https://github.com/cosmos/iavl/blob/3574b99d1cb0f06591c2bd02cba47bef7ebc9312/nodedb.go#L493-L499

but in case the erroring condition matches, it'll be locked forever. Let's fix that by 2 ways

/cc @elias-orijtech