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.
Context
We cannot assume the
leftNodeKey
andrigthNodeKey
is finalized at the hash calculation stage, they will be re-assigned insaveNewNodes
. 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.