Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce 'FWD_GAS_LIMIT' to decrease the gas needed to interact with aragonOS' apps #556

Open
izqui opened this issue Sep 9, 2019 · 0 comments
Labels
Milestone

Comments

@izqui
Copy link
Contributor

izqui commented Sep 9, 2019

At the moment, every time that we forward a call using DelegateProxy, 10k gas are not forwarded. When multiple DelegateProxy.delegatedFwd are executed in one transaction (in an aragonOS call with an auth modifier there are at least 4 delegatedFwd), the amount of gas that the transaction needs can be up to ~10k gas * number of DelegateProxy.delegatedFwd gas that won't be used in the transaction, but that needs to be sent or the transaction will fail.

The reason for not sending all the gas when performing a delegatecall is to be able to gracefully error in case that the underlying call fails consuming all the gas (because of an invalid jump or an OOG). In our case, after the proxy's delegatecall returns we just forward the return data, which can be done with less than 10k gas in most cases.

Reducing the FWD_GAS_LIMIT to a lower number (maybe to 2,300 gas as that's the gas stipend amount that contract ETH transfers have) will reduce the amount of gas that needs to be sent to aragonOS contracts that won't be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants