-
Notifications
You must be signed in to change notification settings - Fork 24
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
Remove DEFAULT_GAS once gas estimation is available #39
Comments
Currently the JS and Go compat APIs return a hard-coded amount when asked to estimate gas. See: sapphire-paratime/clients/js/src/compat.ts Line 171 in 2ee5b38
sapphire-paratime/clients/go/compat.go Line 231 in 2ee5b38
However, the implementation of eth_estimateGas in oasis-web3-gateway seems to have a full implementation. Need to double check gas estimation works as expected, then re-enable it. |
Yes, this is now supported, although for gas estimation will currently always zeroize the sender in order to avoid it being used to bypass access control and potentially exposing secret data through a side channel. The problem is that estimate gas queries are not signed, so you cannot authenticate the caller. For this reason, when execution fails during gas estimation, the estimate will currently be artifically inflated to account for the fact that access control checks are usually in the front (as otherwise the estimate would be an underestimate most of the time). This is not ideal and needs some more thought. |
I vote this is an okay present day solution. |
If you're not using signed queries, and passing explicit authentication to the function (e.g. an EIP-712 signature, username/password, WebAuthN attestation) this will not be a problem. |
Description
We would like to use
eth_estimateGas
when possible and return the non-hardcoded amount.The text was updated successfully, but these errors were encountered: