OpenZeppelin / openzeppelin-gsn-provider

Web3 provider for the Gas Station Network
MIT License
39 stars 29 forks source link

Incorrect gas estimations for GSN transactions #2

Closed spalladino closed 5 years ago

spalladino commented 5 years ago

The estimateGas call is not intercepted by the provider. This means that the provider estimates how much would the tx cost if sent outside the GSN. We need to intercept that call (if useGSN=true), rewrite it so it goes through the GSN, and then estimate its gas cost.

The issue is that the GSNRecipient behaves differently when called by rhub. They need to process msg.data to extract the actual sender, and this processing takes extra gas, which is not accounted for.

We need to: