The change adds new replace and take methods into the StorageMutate traits. These new methods work as the old ones. Old methods were changed to not return the value.
Most of all, places that were using insert and remove don't need an old value. This helps to remove unnecessary lookups to the storage. An example is the Sparse Merkle tree. It only inserts new nodes and removes old nodes without handling the old values since it is not important for the tree.
I helped to decrease lookups to the storage in the testnet by 30%.
Checklist
[x] Breaking changes are clearly marked as such in the PR description and changelog
The change adds new
replace
andtake
methods into theStorageMutate
traits. These new methods work as the old ones. Old methods were changed to not return the value.Most of all, places that were using
insert
andremove
don't need an old value. This helps to remove unnecessary lookups to the storage. An example is the Sparse Merkle tree. It only inserts new nodes and removes old nodes without handling the old values since it is not important for the tree.I helped to decrease lookups to the storage in the testnet by 30%.
Checklist
Before requesting review