You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in IAVL, a branch node's key is always the smallest leaf key in it's right branch, the key can be infered during the import process, so no need to include it in the snapshot at all.
Migration process
Step 1, change the import logic to derive the branch node's key on the fly, ignore the one included in the snapshot, this is not a consensus breaking change.
Step 2, change the export logic to skip branch node's key, this should be considered as a breaking change and need a coordinated upgrade, so the snapshots created after the upgrade are updated consistently across the network.
Do we need to update the snapshot format version for this?
Consequences
Positives
Reduce snapshot size, say L is the number of leave nodes, previously we export 2 * L - 1 keys and L values, now we export L keys and L values, if key and value are the same length on average, it reduces 30% size of snapshot.
In the future, can apply delta encoding to the leaf keys to further reduce snapshot size, since the leaf keys are exported in order, apply delta encoding to it should produce very good compression rate.
The text was updated successfully, but these errors were encountered:
yihuang
added a commit
to yihuang/iavl
that referenced
this issue
Feb 22, 2023
in IAVL, a branch node's key is always the smallest leaf key in it's right branch, the key can be infered during the import process, so no need to include it in the snapshot at all.
Migration process
Do we need to update the snapshot format version for this?
Consequences
Positives
L
is the number of leave nodes, previously we export2 * L - 1
keys andL
values, now we exportL
keys andL
values, if key and value are the same length on average, it reduces 30% size of snapshot.The text was updated successfully, but these errors were encountered: