Closed xgreenx closed 1 year ago
Our current approach is based on the idea that we can implement a new algorithm that takes advantage of having all the leaves of the Sparse Merkle tree up front. Theoretically, this knowledge can be used to reduce or eliminate redundant calculations when compared to sequentially updating the SMT for each leaf, where we recalculate the root at each update operation.
This means:
If the user provided a vast number of storage slots(in the
Create
transaction) during the contract creation, it takes a lot of time to calculate thestate_root
.We currently use a default value
255
for theConsensusParameters::max_storage_slots
, so it is not critical. But if we want to support duplication of the contract with their state, we need to speed up this process and increase the defaultmax_storage_slots
.