dusk-network / rusk-vm

The Dusk Rust WASM VM implementation
Mozilla Public License 2.0
54 stars 12 forks source link

Change contract hash combination to use summation #382

Closed ureeves closed 1 year ago

ureeves commented 2 years ago

Make use of summation instead of hashing to combine two different contract hashes in the calculation of the root. It entails a trade-off between assuring the ordering/structure of the Hamt and performance.

ureeves commented 2 years ago

For context here's a comparison from the bench:

root calculation (hash): [628.87 ns 629.37 ns 629.89 ns]
root calculation (sums): [38.124 ns 38.145 ns 38.168 ns]
ureeves commented 1 year ago

Totally irrelevant since a long time