dev: Explore how we architect "Contract Account" to store bytecode as 32 or 16 bytes instead of 1-byte / storage #55
Labels
enhancement
New feature or request
Milestone
Describe the Feature Request
On Cairo 0, we are currently storing all bytecodes as 1-byte data. So for a 10Kb contract, we are triggering 10.000 stores(when deploying the contract) and also 10.000 reads(on any contract call), which is expensive as for every storage or read a hash is calculated.
With storage improvement to 32 or 16 bytes, we decrease the amount of store and reads.
Describe Preferred/Possible Solution
Use storage index: Besides storing 32/16 bytes for each storage, once the hash for the storage location is calculated we can access up to 256 more slots by adding to the index.
Use dw(currently not possible). We could use dw to store the code in the contract and just access them as needed.
Related Code
Additional Context
If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)
The text was updated successfully, but these errors were encountered: