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!

Dan Sandberg
  • 463
  • 1
  • 4
  • 5
  • Related, but still unsolved: https://www.reddit.com/r/ethereum/comments/48qdl1/exceeds_block_gas/ & https://www.reddit.com/r/ethereum/comments/3g3i2b/why_am_i_getting_an_exceeds_block_gas_limit/ – tayvano Mar 05 '16 at 04:27
  • 1
    Related, and may be solved: https://www.reddit.com/r/ethereum/comments/3g3cx2/question_on_how_to_assign_gasprice_for_a/ – tayvano Mar 05 '16 at 04:27
  • 1
    can you actually post the output of eth.getBlock("latest")? – Piper Merriam Mar 05 '16 at 04:59
  • https://github.com/ethereum/mist/issues/1660 – xquizts Mar 28 '17 at 12:27

6 Answers6

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'

Ankush
  • 311
  • 2
  • 2
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});

Piper Merriam
  • 3,592
  • 3
  • 22
  • 34
  • 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? – Dan Sandberg Mar 05 '16 at 21:30
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.

bitsanity
  • 645
  • 7
  • 10
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.

Albert Renshaw
  • 239
  • 1
  • 10
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"
}
bitsabhi
  • 131
  • 4
1

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

Onshop
  • 136
  • 3