You are viewing a single comment's thread from:

RE: Ethereum "Gas" - How it Works

in #ethereum7 years ago

A quick question arose from "So I should always specify a large gas limit since I'll be refunded?" phrase from your article.

A function takes 40,000 Gas Units to execute. Which one of the following function calls will miner prefer to take?

  1. Call with 100,000 Gas Units.
  2. Call with 50,000 Gas Units.

Provided that the miner is paid for just 40,000 gas unit operations, they will prefer 2nd function call as it takes less total block size limit compared to 1st call.

Does the algorithm for tx selection from txpool work like this?

Sort:  

Preferring the call with 50k is better for the miner since it frees up 50k in the block for additional transactions hat will actually result in fees.

However, I had a conversation with the person behind a lot of the ethgasstation.info site programming and we found that this is not how actual miners are working. Looking at historical transactions, miners are pretty dumb. They almost always prefer higher gas price and don't look at gas limit, regardless of whether it's high or low.

Miners don't usually account for gas limit until it exceeds 1M or so, in which case they simply ignore it regardless of gas price.

For a demographic that thrives on cost optimization, this was a strange result to find. I'd expect it to change in the future, but who knows.

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.029
BTC 65292.16
ETH 2651.21
USDT 1.00
SBD 2.85