To enable this feature to be more broadly useful, I want a mechanism where you could assert a ceiling for gas usage via the ABI, leveraging a to-be-standardized feature of the ABI that includes max gas estimates for additional utility. It would basically be implemented like this:
# Function caller
...
# If gas estimate is available, check it
if 'gas' in func_abi:
assert function.gasEstimate < func_abi.gas, "Function execution exceeds estimate!"
...
Vyper has a built-in gas estimator. I would like to allow this in my plugin, for the simple fact that Vyper could leverage this plugin if it had this functionality. For reference, here it is: https://github.com/ethereum/vyper/blob/248c723288e84899908048efff4c3e0b12f0b3dc/tests/conftest.py#L178-L182
To enable this feature to be more broadly useful, I want a mechanism where you could assert a ceiling for gas usage via the ABI, leveraging a to-be-standardized feature of the ABI that includes max gas estimates for additional utility. It would basically be implemented like this: