Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Consider switching to a consistent levelup key type #15

Closed
mhhf opened this issue Dec 23, 2016 · 2 comments
Closed

Consider switching to a consistent levelup key type #15

mhhf opened this issue Dec 23, 2016 · 2 comments

Comments

@mhhf
Copy link

mhhf commented Dec 23, 2016

Currently different key types are used:

  • number for accessing block numbers
  • strings for meta-information such as 'meta', 'detail:' + ,
  • buffers in merkle-patricia-tree

I've noticed weird behavior while working with on the persistency feature for ethereumjs-testrpc with leveldown - the persistent storage adapter for levelup: levelup uses red-black-trees to store data with a custom comparison function, if now different key types are used (I could observe this with Buffer and non Buffer keys) data is saved to a different location from where it is looked up for which results in saving data to a key and don't be able to get it again, leading to errors like this: trufflesuite/ganache-cli-archive#81 .
This is (temporary?) resolved by switching to a consistent key type (I refactored ethereumjs-blockchain to work with Buffer keys only).

Should I create a PR for this?

@wanderer
Copy link
Member

@mhhf yeah pr would be great!

@vpulim
Copy link
Contributor

vpulim commented Aug 8, 2018

This issue has been fixed in #52 by converting all key encodings to type 'binary'. We should close this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants