Skip to content

Get_contracts: Report gas consumption for parsing and unparsing

Context

This MR extends !5733 (merged). In !5733 (merged) the get_contracts script was extended to report gas for serializing and deserializing all scripts and storages. This MR adds gas reporting for:

  • parsing the script using parse_toplevel,
  • parsing the type of the storage using parse_ty,
  • parsing the storage using parse_data, and
  • unparsing the storage using unparse_data.

So basically we report the part of gas consumption for calling a smart contracts which does not depend on the input.

I have used this script to check that this part of gas consumption represents at worse a few percents of the operation gas limit for all contracts currently (level 2765034) on mainnet.

Manually testing the MR

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, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports