-
Notifications
You must be signed in to change notification settings - Fork 316
Closed
Description
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
Lis the number of leave nodes, previously we export2 * L - 1keys andLvalues, now we exportLkeys andLvalues, 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels