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
HashMapDB does not differentiate between leaf and branch nodes during insertion. This is in contrast to RocksDB which stores leaf and branch nodes in different columns (this is handled here using the get_cf method of DatabaseKey). This results in surprising behavior when retrieving keys from HashMapDB for example, since these will also include branch keys.
Expected behavior:
It would be more logical from the user perspective for a difference to be made between leaf and branch nodes in HashMapDB to allow to retrieve only the keys the user themselves inserted into the db.
Steps to reproduce:
Create a new BonsaiStorage with a HashMapDb and initialize a dummy tree.
Insert multiple nodes & commit.
Call get_keys, ignoring the first size byte. You will notice the resulting keys do not only contain those manually inserted.
Related code:
This is what a potential solution to this issue would look like.
Bug Report
Bonsai-trie version: 83b2cab
Current behavior:
HashMapDB
does not differentiate betweenleaf
andbranch
nodes during insertion. This is in contrast toRocksDB
which storesleaf
andbranch
nodes in different columns (this is handled here using theget_cf
method ofDatabaseKey
). This results in surprising behavior when retrieving keys fromHashMapDB
for example, since these will also includebranch
keys.Expected behavior:
It would be more logical from the user perspective for a difference to be made between
leaf
andbranch
nodes inHashMapDB
to allow to retrieve only the keys the user themselves inserted into the db.Steps to reproduce:
BonsaiStorage
with aHashMapDb
and initialize a dummy tree.get_keys
, ignoring the first size byte. You will notice the resulting keys do not only contain those manually inserted.Related code:
This is what a potential solution to this issue would look like.
The text was updated successfully, but these errors were encountered: