ape icon indicating copy to clipboard operation
ape copied to clipboard

Gas report anomaly: identical code delivers multiple gas numbers

Open engn33r opened this issue 2 years ago • 0 comments

Environment information

  • OS: Ubuntu Linux
  • Python Version: 3.10.12
  • ape and plugin versions:
$ ape --version
0.6.26

$ ape plugins list
Installed Plugins
  foundry    0.6.18
  hardhat    0.6.13
  vyper      0.6.13

  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
name: vyper-gas-experiments

ethereum:
  local:
    default_provider: hardhat

What went wrong?

Use this public repo to replicate the issue: https://github.com/engn33r/ape-gas-anomalies

Unexpected gas report results:

  1. if_greater1() has the same logic as if_greater2() but the gas report results are different
  2. The gas report for uninitialize() shows 4084 gas with a default_provider of foundry but only 304 gas with a default_provider of hardhat.

The result for scenarios 1 and 2 should be that there is no difference in gas report results.

How can it be fixed?

Is this an issue with the plugins or code external to ape?

engn33r avatar Nov 27 '23 06:11 engn33r