Skip to content

splitting smart contract by toplevel

ChiaChi Tsai requested to merge marigold/tezos:cc@ssc into master

Context

  • Splitting the storage of smart contracts scripts: #1233

Currently, the smart contract includes 3 parts: parameter, storage type, and code. After originating this contract, the entire contract, these 3 parts, will be stored as one record in storage. However, not all the later computing requires getting an entire contract from storage and reparsing again. Therefore, by storing these 3 parts separately in storage, we can get the minimal parts we need and improve the performance.

The views can also benefit from this improvement.

There are several things that can be discussed (as mention in the MR of view before):

  • The line number of a smart contract. In the current process way, we can easily tell the line number. Now, each part will be saved separately, it's hard to tell its original order.
  • Increasing fee while deploying a new contract. while splitting into parts, the additional "root" has to be added on. It increases the fee.
  • Decreasing fee and gas after the first time deploying. Now, we don't have to get the whole contract for parsing, it saves fees and gas.
  • Perhaps using a better data structure to descript parts.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, the Development Version section of CHANGES.md for everything else).
  • Select suitable reviewers using the Reviewers field below.
Edited by ChiaChi Tsai

Merge request reports