1

enter image description here

So, first we're told that g' is the "legitimately" remaining gas. But then we're told that g*, where g* >= g', is "the total gas that remains". If g' is the remaining gas, how do we add to it to arrive at the "total gas that remains"? What is the difference between the "legitimately remaining gas" and the "total gas remaining"? Is g* not greater than or equal to the amount of gas actually remaining? And who's meant to make up this potential difference, the miner?

Additionally, what is the significance of the (Tg-g')/2? Is this halving just arbitrary? Quite confused by this equation.

1 Answer 1

1
  • g' is the unspent gas
  • Tg is the gas specified in the transaction
  • Tg - g' is the gas spent by the transaction
  • Ar refundable gas from execution

Let's suppose we have a 1000 gas transaction, 600 gas are spent by the execution and there are 350 gas for refund.

  • g' = 400
  • Tg = 1000
  • Tg - g' = 600
  • Ar = 350

From the formula g* = g' + min((Tg - g') / 2, Ar) = 400 + min(300, 350) = 700.

Those 700 will be returned to the transaction's sender. They will be discounted from the original 1000 that they paid before executing the transaction. The net result is sender has paid 300 for the transaction.

Your Answer

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

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