quorum icon indicating copy to clipboard operation
quorum copied to clipboard

Incorrect "Insufficient funds error" when signing transaction using private key

Open maksymilian-majer opened this issue 8 years ago • 5 comments

System information

Geth version: (in docker container) Geth Version: 1.7.2-stable Git Commit: ee498061b5a74bf1f3290139a53840345fa038cb Quorum Version: 2.0.1 Architecture: amd64 Network Id: 1 Go Version: go1.7.3 Operating System: linux GOPATH= GOROOT=/usr/local/go

OS & Version: ubuntu:16.04 in docker

Branch, Commit Hash or Release: https://github.com/jpmorganchase/constellation/releases/download/v0.0.1-alpha/ubuntu1604.zip

Expected behaviour

When signing a transaction using private key it should be written to the blockchain. (see code: https://github.com/maksymilian-majer/quorum-signing-error/blob/master/test-minimum-repro.js)

Actual behaviour

Quorum JSON RPC returns error: Returned error: insufficient funds for gas * price + value

Steps to reproduce the behaviour

  1. Clone [email protected]:maksymilian-majer/quorum-signing-error.git (https://github.com/maksymilian-majer/quorum-signing-error.git)
  2. Follow the steps in the README.md to run docker-compose cluster with 3 quorum nodes and run the code to attempt a simple transaction of sending ETH from one node to another

maksymilian-majer avatar Apr 10 '18 20:04 maksymilian-majer

Thought this may have something to do with old constellation version in the Dockerfile, but the issue persists with the newest constellation and quorum releases.

Here's a log entry from geth: screen shot 2018-04-24 at 15 10 37

maksymilian-majer avatar Apr 24 '18 13:04 maksymilian-majer

@maksymilian-majer please try it with latest quorum examples(genesis has been updated to pre-fund accounts) and master.

jpmsam avatar May 29 '18 18:05 jpmsam

@maksymilian-majer please reopen if it's still an issue with master.

jpmsam avatar Jul 09 '18 20:07 jpmsam

@jpmsam Same issue for me after taking latest release. eth.sendTransaction() is working fine but eth.sendRawTransaction() with private key is failing by complaining about insufficient funds.

rajeshsubhankar avatar Aug 02 '18 15:08 rajeshsubhankar

Resolved

For me

const rawTx = {

nonce: nonceHex,

gasPrice: gasPriceHex,

gasLimit: config.Ethereum.gasLimit,

to: receiver,

value: web3.toHex(amount),

data: '0x00',

chainId: web3.toHex(web3.version.network)

};

(chain_id of raw transaction) was creating problem as web3.version.network was returning 1 instead of 10 (chain_id in genesis.json).

By restarting the nodes after setting NETWORK_ID equal to CHAIN_ID solved the issue.

rajeshsubhankar avatar Aug 06 '18 16:08 rajeshsubhankar