scilla icon indicating copy to clipboard operation
scilla copied to clipboard

Polymorphic hash tables should be replaced

Open anton-trunov opened this issue 6 years ago • 2 comments

I think it’s reasonable to assume that miners can build Scilla from source code. Different major OCaml versions do not guarantee stability of the Hashtbl’s hash function. I.e. if we want reproducible computations across the whole network, we need that people can take equal Maps and turn those into the same hashes (and raw bytes before that). To achieve that, we need a standard way of traversing a map. This might be achieved with sorting, but that's expensive. Also, if we use OCaml's standard hashtables, then every time we want to change some representation, we would need to release a backwards incompatible Scilla version because of the polymorphic hash function. I believe we could try and solve this issue by switching to Base’s hashtables and write the hash function manually.

anton-trunov avatar Apr 23 '19 16:04 anton-trunov

@anton-trunov does https://github.com/Zilliqa/scilla/pull/764 also fix this Issue?

Related: https://github.com/Zilliqa/scilla/issues/65

vaivaswatha avatar Apr 16 '20 05:04 vaivaswatha

I'm not sure, I guess we would need to run an experiment to have a definite answer.

anton-trunov avatar Apr 16 '20 07:04 anton-trunov