celestiaorg / smt

A Go library that implements a Sparse Merkle tree for a key-value map.
https://godoc.org/github.com/celestiaorg/smt
MIT License
138 stars 53 forks source link

replace mapstore with tm-db #6

Closed tac0turtle closed 4 years ago

tac0turtle commented 4 years ago

Proposal:

Replace the mapstore with tm-db. tm-db supports 5 different key value stores. This change is trivial and I can pick it up if its accepted.

tm-db

musalbas commented 4 years ago

Would this be simply a matter of replacing MapStore with this DB interface? https://github.com/tendermint/tm-db/blob/v0.6.1/types.go#L21

tac0turtle commented 4 years ago

Would this be simply a matter of replacing MapStore with this DB interface? https://github.com/tendermint/tm-db/blob/v0.6.1/types.go#L21

yes

musalbas commented 4 years ago

Sounds good to me. I assume there is an in-memory/dummy key value-store that can be used for tests?

tac0turtle commented 4 years ago

Sounds good to me. I assume there is an in-memory/dummy key value-store that can be used for tests?

yes it uses https://github.com/google/btree under the hood

musalbas commented 4 years ago

What about simply renaming Put to Set, and Del to Delete in the MapStore interface? This should make the MapStore interface a subset of the DB interface, and so you should be able to plug a DB instead of a MapStore?

tac0turtle commented 4 years ago

What about simply renaming Put to Set, and Del to Delete in the MapStore interface? This should make the MapStore interface a subset of the DB interface, and so you should be able to plug a DB instead of a MapStore?

that is an option. I can look at making this change later today.

musalbas commented 4 years ago

Ok, sounds good

On 24 August 2020 12:06:21 Marko notifications@github.com wrote:

What about simply renaming Put to Set, and Del to Delete in the MapStore interface? This should make the MapStore interface a subset of the DB interface, and so you should be able to plug a DB instead of a MapStore? that is an option. I can look at making this change later today. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.