cosmos / iavl

Merkleized IAVL+ Tree implementation in Go
Apache License 2.0
409 stars 256 forks source link

fix: revert the children node key refer #903

Closed cool-develope closed 4 months ago

cool-develope commented 4 months ago

Context

We cannot assume the leftNodeKey and rigthNodeKey is finalized at the hash calculation stage, they will be re-assigned in saveNewNodes. IAVL V1 doesn’t ensure leftNodeKey and rightNodeKey updates when rotating, only update leftNode and rightNode relations in-memory, and children nodeKey will be resolved at the commit stage.