Questions tagged [gas-limit]

Question related to either the transaction or block gas limit.

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]

Source

410 questions
5
votes
1 answer

How does miners vote to determine the block gas limit?

In many posts people say "miners periodically vote to determine the block gas limit". But how actually do they vote and change the block limit? Do they vote for every block/or do it every day or for some other fixed period of time? Another related…
Hank Chen
  • 53
  • 2
5
votes
3 answers

Contract exceeds block gas limit

I have a fairly complex contract that inherits from a bunch of other contracts, like the OpenZeppelin ERC20 libs and Oraclize libs. When I go to deploy it onto testnet in Remix or Mist, it says that the gas required is 6.3 million, which exceeds the…
3
votes
1 answer

How Geth and Parity knows the global gas limit?

As said in Péter Szilágyi post DAO Wars: Your voice on the soft-fork dilemma: Miners supporting the DAO soft-fork can do so by starting Geth 1.4.8 with --dao-soft-fork. This will cause the block gas limits to be lowered towards Pi million until…
Nicolas Massart
  • 6,783
  • 2
  • 29
  • 63
2
votes
1 answer

How to Specify Gas Limit and Value in wei or gwei?

Dear Anyone Who Can Help Me, This is my first time posting and asking for help, I'm in the midst of Deploying and Running the Transactions in Remix IDE (as per the picture). I'm stuck at the Gas Limit (as I don't know how much to put) The same goes…
Jsim
  • 61
  • 5
2
votes
1 answer

"Thawing" mechanism to increate Block Gas Limit?

A smarter man than I (@edmund-edgar) recently told me: Th[e Block Gas Limit of 5000 as noted by the gaslimit=0x1388 parameter] represents the current Ethereum main chain, and the initial gas limit for that chain was indeed 5000, which was too low to…
stone.212
  • 1,994
  • 1
  • 19
  • 38
2
votes
0 answers

Ethereum transaction 'Exceeds block gas limit'

Title says it all! More info: Geth 1.3.5 Windows: eth.getBalance(MY_ADDRESS) 70000000000000000000 eth.sendTransaction({from:"MY_ADDRESS", to:"TARGET_ADDRESS", value: web3.toWei(1, "ether"), gas:40000}); Exceeds block gas limit at…
Maas Bello
  • 21
  • 1
1
vote
1 answer

What does "gas limit" of a block limit?

Many people(one example) stated that "gas limit" of a block limited "gas limit" of transactions included in it. To verify, I downloaded a block (block number: 10185031) and added "gas limit" of all included transactions and found that the total sum…
Better
  • 11
  • 3
1
vote
1 answer

divide ethers to current token holders only

My task is to divide the dividend sent by owner to the contract to the current token holders.The token holders can come later and redeem their pending amounts, the important point here is that, when a deposit is made that deposit should not be given…
Fariha Abbasi
  • 299
  • 7
  • 18
1
vote
0 answers

High consumption of gas puzzle

Normal transfer works normally with this erc20 token: https://etherscan.io/address/0xe9e74bae31892b6b1c000e009c93438dbd14d723#code When withdrawing from the Etherdelta contract:…
0
votes
2 answers

handling block gas-limit in a large loop

I have a loop like this: struct User { string name; uint tokens; uint frozenTokens; bool isValid; } mapping(address => User) users; address[] public usersAddresses; function freeTokens() private { uint reciversLength =…
Adrin
  • 199
  • 1
  • 8
0
votes
1 answer

Exceeds Gas Limit even though chain fully synced

I'm attempting to send a transactions via Ethereum Wallet, the latest version, and have run geth --syncmode="light" . On the last 200k blocks or so I just opened Ethereum Wallet and let it sync the rest. When I go to send a transaction, it says…
Patrickka
  • 11
  • 1
0
votes
1 answer

Is the gas-limit as seen on ethstats measured in wei?

Simple question but I can't seem to find the answer online
Daniel Kobe
  • 1,581
  • 2
  • 14
  • 14
0
votes
0 answers

Method call gets reverted when block gas limit setting of ganache is left of default

I deployed a T-REX token (version 3.9.4) to first Sepolia then also to a local ganache instance and my process (Token (and substructures) deployment -> Add Token agent -> Create Identity -> Register Identity -> Mint token) completes with every step…