GithubHelp home page GithubHelp logo

Comments (4)

kostko avatar kostko commented on August 23, 2024 1

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.

from sapphire-paratime.

CedarMist avatar CedarMist commented on August 23, 2024

Currently the JS and Go compat APIs return a hard-coded amount when asked to estimate gas.

See:

estimateGas: () => DEFAULT_GAS,

// EstimateGas implements ContractTransactor.

However, the implementation of eth_estimateGas in oasis-web3-gateway seems to have a full implementation.

See:
https://github.com/oasisprotocol/oasis-web3-gateway/blob/2fa2ad9f5170260324db51daca4638d346e43c91/rpc/eth/api.go#L483

Need to double check gas estimation works as expected, then re-enable it.

from sapphire-paratime.

aefhm avatar aefhm commented on August 23, 2024

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.

from sapphire-paratime.

CedarMist avatar CedarMist commented on August 23, 2024

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.

from sapphire-paratime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.