celestiaorg / nmt

Namespaced Merkle Tree
Apache License 2.0
117 stars 42 forks source link

using a sized type i.e., int32 or int64 for leaf index in the foundInRange method of nmt #239

Open staheri14 opened 1 year ago

staheri14 commented 1 year ago

For context please refer to the conversation on this issue https://github.com/celestiaorg/nmt/issues/70

Originally suggested by @elias-orijtech in this comment

If you do settle on a signed type, I suggest being specific about the type (int32 or int64), or make the build fail if compiled on platforms where int is not at least 64 bits wide.

Link to the foundInRange method: https://github.com/celestiaorg/nmt/blob/0e219c88a3471351159db7967a149d06aaa6dd50/nmt.go#L435