36

I'm trying to send Ether using geth 1.3.5, like this:

eth.sendTransaction({
  from: eth.accounts[0], 
  to:'0x[ADDRESS_HERE]', 
  value: web3.toWei(5, "ether"), 
  gas:21000
});`

And I'm getting "Exceeds block gas limit"

When I try:

with gas=5000 I get "Intrinsic gas too low"

Executing eth.getBlock("latest").gasLimit yields 5000.

Any ideas how to execute a transaction? I synced the blockchain using --fast. Any help appreciated!

4

6 Answers 6

17

21,000 gas is the minimum for sending a transaction. If you are sending ether to a contract which has a fallback function then that function will require extra gas to run. Since unspent gas is refunded automatically, change your code to something like the following with a higher gas value.

eth.sendTransaction({from:eth.accounts[0], to:'0x[ADDRESS_HERE]', value: web3.toWei(5, "ether"), gas:100000});

1
  • 3
    Thanks. It ended up working when I set it to 40,000 (before seeing this). Any idea why this doesn't just work automagically? Mar 5, 2016 at 21:30
21

sendTransaction requires min gas = 21000 + [some extra ether as mentioned by Piper]

Also make sure the genesis.json does not limit the gas limit. In my case it was 0x1388 (5000 in Decimal). I changed it to 0xC350 (50000 in decimal) and it worked!!

Solution:

  1. check current block gas limit by running - eth.getBlock("latest"). If you supply more gas than this value, you will face 'Exceeds block gas limit' error

  2. Then check gas value in sendTransaction(). It should be atleast 21000. If it isn't, you will get 'intrinsic value too low'

11
err:  Error: Returned error: exceeds block gas limit

This is also returned when running (trying to run) a full node and it is not in sync with the network yet.

0
1

I get this error when my gas limit was within valid range but was not an integer, rather a float. I had been multiplying it by a ratio that left it with something like 28322.38400000003 and that caused this error. Simply truncating with floor function solved.

1

Check the genesis file. It should be the same on all the nodes if they are running on different servers. If there is discrepancy in this file, the nodes won't be able to sync. You can see the logs in qdata/c1/node.log Also increase the gas. Minimum gas required is > 21000 to send a transaction.

Example of genesis file

{
  "alloc": {},
  "coinbase": "0x0000000000000000000000000000000000000000",
  "config": {
    "homesteadBlock": 0,
    "chainId": 3232424,
    "eip155Block": null,
    "eip158Block": null,
    "isQuorum": true
  },
  "difficulty": "0x0",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0xE0000000",
  "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
  "nonce": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}
1

I has this issue running tests and it resolved by switching from truffle develop to ganache-cli.

Not the answer you're looking for? Browse other questions tagged or ask your own question.