ape
ape copied to clipboard
Gas report anomaly: identical code delivers multiple gas numbers
Environment information
- OS: Ubuntu Linux
- Python Version: 3.10.12
apeand 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:
if_greater1()has the same logic asif_greater2()but the gas report results are different- The gas report for
uninitialize()shows 4084 gas with adefault_providerof foundry but only 304 gas with adefault_providerof 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?