Crate fvm_ipld_kamt

source ·
Expand description

KAMT crate for use as rust IPLD data structure, which stands for “fixed size Keyed AMT” and is basically a copy of the HAMT with some extra features that were deemed to be too complex to add there.

The original purpose of the features that gave birth to the KAMT was to optimize the HAMT for the EVM/Solidity storage layout, which uses hashing+offset for keys to co-locate array items in a contiguous address space. While the HAMT allowed the hashing strategy to work this way, it resulted in very deep parts of the tree where only the leaves contained key-value pairs. The main feature of this data structure then is to skip the empty levels and point straight to the next data bearing node.

The other difference is that to emphasize this the KAMT doesn’t do any hashing on its own, it works with fixed size byte arrays as keys.

Data structure reference

Modules

Structs

  • Configuration options for a KAMT instance.
  • Implementation of the KAMT data structure for IPLD.

Enums

Traits

Type Definitions

  • Keys in the tree have a fixed length.