Network.js GSN Error unknown field `gas_price`

Hi, I’m unable to send transactions at the moment using GSN

My config

// package.json
"@openzeppelin/network": "0.4.1",



       let relayClientConfig = {
          txfee: process.env.VUE_APP_GSN_TX_FEE,
          gasLimit: 500000, // override requested gas limit.
          verbose: VERBOSE
        }
        const signKey = {
          address: signKeyPair.address,
          privateKey: Buffer.from(signKeyPair.privateKey.substring(2), 'hex')
        }
        return fromConnection(
          process.env.VUE_APP_ETHEREUM_NODE_URL, {
            pollInterval: POLL_INTERVAL,
            gsn: {
              signKey: signKey,
              ...relayClientConfig
            }
          })

//....
this.depositManager = new this.web3.eth.Contract(depositManagerContractInfo.abi, depositManagerContractAddress)
let action = this.depositManager.methods.contribute(smartContractAddress, contributorAddress, amountToSend)
    action.send({
      from: contributorAddress,
      gasPrice: await getGasPrice()
    }).on('transactionHash', hash => {
      EventBus.$emit('contract-manager-hash', hash)
    }).on('receipt', receipt => {
      EventBus.$emit('congstract-manager-receipt', receipt)
    }).on('error', error => {
      EventBus.$emit('contract-manager-error', error)
    })


Console output:

RR:  10 {
from: "0xcd5840c07bc9598defc1993ff2845740c77ce635", 
to: "0x9a261a14d0f50f3dd58e7f232fea3b702cdd7ef1", 
txfee: "90", 
gas_limit: undefined, 
gas_price: 10000000000, …}

SendContribution.vue:144 Error: Error: Error estimating gas usage for transaction (Returned error: Invalid params: unknown field `gas_price`, expected one of `from`, `to`, `gasPrice`, `gas`, `value`, `data`, `nonce`.). Make sure the transaction is valid, or set a fixed gas value.
    at Object._fireError (index.js:57)
    at sendTxCallback (index.js:614)
    at index.js:136
    at utils.js:23  ----> webpack:///./node_modules/@openzeppelin/gsn-provider/src/utils.js

I do not have gas_priceanyway in my code, the only place is spelled like that is in RelayClient.js in GSNProvider

Thanks for your time

1 Like

Hi @ethicraul

I’m sorry that you had this issue. We would need more information so that we can reproduce it.

Can you provide the public network that you are using, as well as the operating system, node and npm versions? Any other details that might help us reproduce it would be appreciated!

I am running a non-upgradeable (regular) contract version of Building a GSN-powered DApp on Rinkeby with @openzeppelin/network@0.4.1 (dependency:@openzeppelin/gsn-provider@0.1.9) and am not seeing any errors.

I assume the error is thrown from OpenZeppelin GSN Provider

Sure: @abcoathup

Framework Vue: “@vue/cli-service”: “3.9.3”,
Network: Kovan
OS: MacOS Catalina 10.15.2
Node: v12.13.1
Npm: 6.12.1

1 Like

Hi @ethicraul,

I get the same issue on Kovan. I assume there may be an issue with the Relayer.

Uncaught (in promise) Error: Error: Error estimating gas usage for transaction (Returned error: Invalid params: unknown field `gas_price`, expected one of `from`, `to`, `gasPrice`, `gas`, `value`, `data`, `nonce`.). Make sure the transaction is valid, or set a fixed gas value.

I don’t get the issue on Rinkeby. Can you try changing to Rinkeby network and let me know how you get on?

I have the same error in production, so I assume the error is then related to the use of Parity client.
A change of client is overdue :angry:… but that is going to take a while.

Suggestions are welcomed

Thanks

1 Like

Confirmed. Deployed with an Infura node and works again. Parity Client RIP

1 Like

Hi @ethicraul,

There is a PR with a fix for this: https://github.com/OpenZeppelin/openzeppelin-gsn-provider/pull/47

I will let you know when there is a release.

Hi @ethicraul,

This is now fixed.

The following releases include the fix:
OpenZeppelin Network.js v0.4.2
OpenZeppelin gsn-provider v0.1.10

1 Like