Open Longarithm opened 1 year ago
For flat storage, could we keep using the non-hashed keys? Or are long keys also problematic there?
Keeping plain keys would presumably be better for data locality. But admittedly, I don't think we have much data to back up this claim.
Yes, for flat storage we should keep long keys.
Eth model assumes that key length is always 32 bytes (Zulip). We don't, but it complicates things for us.
Most contract devs use short keys, as they benefit from low costs, but it's possible to create a key of 2 KB size, which trie depth can be unpleasantly big. We should consider replacing these keys in trie with their hashes, so that trie depth will be always limited by 64 (nibbles).
If we proceed with other tree structure like AVL (discussion), then it won't be needed because tree depth will depend only on number of keys.