There are two major problems in ICON1 that must be solved at the launch of ICON 2.0.
- Runtime step costing
- Deployment step costing
We propose to apply the following modification in the step costing calculation. Those changes are still a work in progress, but we want to the developer community feedback on this as soon as possible.
Please let us know you thoughts about those changes. We would like to submit a network proposal by August 2nd.
Introduce Step cost for ‘get’ along with the concept of ‘defaultGet’.
- Costget() = DEFAULT_GET + sizeof() * GET
- GET should be non-zero value (we need to decide the proper number of this)
DEFAULT_GET is needed as many MPT node traversals (i.e. Disk I/O) should be involved to reach the leaf node that contains .
Also introduce the ‘defaultSet’ concept.
- Costset(, ) = DEFAULT_SET + sizeof() * SET
- Adding a new key/value entry is more expensive operation than updating an already existing key/value entry because the former increases overall indexing data size.
Also introduce the ‘defaultReplace’ concept.
Costreplace(, , )
= DEFAULT_REPLACE + sizeof() * SET + sizeof() * DELETE
DEFAULT_REPLACE = (DEFAULT_SET + DEFAULT_DELETE) / 2
Apply different Step costing for and values in order to prevent illegal Step earning
Also introduce the ‘defaultDelete’ concept.
- Costdelete() = DEFAULT_DELETE + sizeof() * DELETE
Also introduce the ‘defaultEvent’ concept.
Costevent(,) = DEFAULT_EVENTLOG + sizeof(<indexed|data>) * EVENTLOG
Adjust to have the same value as ‘contractInstall’. There is no longer need to differentiate between install and update. Rather, updating the existing SCOREs are preferable on ICON2 since it does not increase a leaf node of account MPT.
Reduce the value to 23,000 from 30,000. Together with the change ‘contractUpdate’ above, this will make the maximum code size around 64 KB for both Install and Update.