2

When I tried to send ether to my contract, I get this error. Even if try to change the value of Gas Limit and Gas Price the transaction still fails. What could be the possible reason?

What I speculate is that the fallback payable method is a little complex and that it requires huge gas to fuel that transaction.

Gas limit dangerously high

2
  • No way of knowing why the estimated gas limit is so high without seeing your pyae function code. Actual gas price is irrelevant.
    – Strelok
    Commented Sep 29, 2017 at 8:54
  • interestingly, This error comes only when I do a method call from the fallback payable method Commented Sep 29, 2017 at 19:28

2 Answers 2

2

See https://bitcoin.stackexchange.com/questions/39132/what-is-gas-limit-in-ethereum

Additionally, blocks, too, have a field called gas limit. It defines the maximum amount of gas all transactions in the whole block combined are allowed to consume.

So as you assume, the transaction might be too complex.

1
  • wow thanks a lot. Since it was on the bitcoin stack exchange, I was not able to find answer to that here. Commented Sep 29, 2017 at 19:31
1

Reposting an answer from bitcoin stackexchange. Thanks to Lukasz Zuchowski

In Ethereum, gas is a measure of computational effort. To each operation, a fixed amount of gas is assigned (e.g. adding two numbers costs 3 gas, calculating a hash costs 30 gas, sending a transaction costs 21000 gas [1]).

Since computation is expensive (mind that it has to be done by every full node in the network), excessive consumption of gas needs to be discouraged. Therefore, each unit of gas must be paid for (in Ether) by the sender of the transaction that triggered the computation.

Unfortunately, it is often not easy and in general even impossible to know in advance how much gas a transaction will need eventually. Therefore, transactions have a gas limit field to specify the maximum amount of gas the sender is willing to buy. If the gas used exceeds this limit during execution, processing is stopped. The sender still has to pay for the performed computation, but they are protected from running completely out of funds.

The transaction gas limit also protects full nodes from attackers, who could, without a gas limit, make them execute effective infinity loops. If such a transaction would take longer than one block to process, it could never be included in a block, and, thus, the attacker wouldn't need to pay for it. [2]

Additionally, blocks, too, have a field called gas limit. It defines the maximum amount of gas all transactions in the whole block combined are allowed to consume. Similar to the maximum block size in Bitcoin (measured in bytes), its purpose is to keep block propagation and processing time low, thereby allowing for a sufficiently decentralized network. In contrast to Bitcoin, it is however not a constant. Instead, miners have the option to increase or decrease it every block by a certain factor. [3]

[1] See the Yellow Paper for a breakdown of operations and the respective gas costs (Appendices G and H)

[2] https://github.com/ethereum/wiki/wiki/Design-Rationale#gas-and-fees

[3] See the Yellow Paper Equations 40 to 42 for the exact rules

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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