Add mention of initialisation cost of storage

This commit is contained in:
Chris Ward 2019-03-18 14:37:47 +01:00
parent 61be78b42a
commit 855555e941

View File

@ -387,8 +387,8 @@ paragraphs.
Each account has a data area called **storage**, which is persistent between function calls Each account has a data area called **storage**, which is persistent between function calls
and transactions. and transactions.
Storage is a key-value store that maps 256-bit words to 256-bit words. Storage is a key-value store that maps 256-bit words to 256-bit words.
It is not possible to enumerate storage from within a contract and it is It is not possible to enumerate storage from within a contract, it is
comparatively costly to read, and even more to modify storage. Because of this cost, comparatively costly to read, and even more to initialise and modify storage. Because of this cost,
you should minimise what you store in persistent storage to what the contract needs to run. you should minimise what you store in persistent storage to what the contract needs to run.
Store data like derived calculations, caching, and aggregates outside of the contract. Store data like derived calculations, caching, and aggregates outside of the contract.
A contract can neither read nor write to any storage apart from its own. A contract can neither read nor write to any storage apart from its own.