nervosnetwork / sparse-merkle-tree

46 stars 37 forks source link

feat: Optimize SMT implementation #8

Closed xxuejie closed 3 years ago

xxuejie commented 3 years ago

This change reduces the number of zero-related hashes performed. Multiple consecutive hashes against zero will be reduced to one. The verification cost is thus significantly reduced, initial benchmark shows that verifying a single key in SMT, consumes roughly 130k cycles using current CKB's cost model.