Gas - Reading Assignment


#21
  1. Gas is priced by individual parts contained within the contract. Total is the sum of the parts.
  2. Gas limit is the maximum the user is willing to pay.
  3. If the gas limit is too low, the transaction will fail and spent gas will be lost.
  4. If the gas limit is too high, any unused gas will not be spent. However if it exceeds the upper limit specified in the contract, the transaction will fail.
  5. Gwei is 10^9 wei.

#22

1.How do we calculate the total gas cost for a transaction? A: adding all instructions to be executed by the EVM by the request to process a transfer-tx or a tx to execute a call to a smart-contract

2.What is gas limit? A: is the maximum the user is willing to pay the miners to process the tx.

3.What happens if we specify a gas limit that is too low? A: All gas up to gas-limit will be used/spend but the tx will not proceed and will not be added to a mined block.

4.What happens if we specify a gas limit that is too high and therefore not consumed fully? A: only the amount of gas that was consumed will be paid by the wallet available ether.

5.What is a gwei? A: a little amount of ether, 1 gwei = 1 giga wei = 1 nanoether.


#23
  1. How do we calculate the total gas cost for a transaction?
    Sum of all gas costs per each operation within a transaction.

  2. What is gas limit?
    A top limit of GAS that you can/want to spend to execute a transaction. Each operation has different limit. Whatever does not execute or is left over is auto-refunded.

  3. What happens if we specify a gas limit that is too low?
    Too little GAS provided makes transaction likely to fail, execute but not in entirety. Main funds of the failed transaction do not move. Fees will be kept by miners.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Unspent GAS from the Limit is refunded automatically after transaction completes. You can discourage the miner from adding to block since it is not what it seems. Blocks also have a GAS limit, if yours is too high, adding such the transaction could make the block not computationally dense enough.

  5. What is a gwei?
    Is 10,000,000,000 wei, which in turn is the smallest unit of Ethereum. It is used as currency symbol for GAS when observing price of operations.


#24

How do we calculate the total gas cost for a transaction?

  • Is the cumulative sum of all the operations involved in a transaction.

What is gas limit?

  • The maximum amount of gas you are willing to spend on a transaction.

What happens if we specify a gas limit that is too low?

  • A low gas limit will result in a failed transaction and the fees are kept by the miner. Since, it will start executing line by line the different operations on the transaction, and when you run out of money the transaction will stop.

What happens if we specify a gas limit that is too high and therefore not consumed fully?

  • Extra, unspent gas is refunded automatically.

What is a gwei?

  • Is one of the units of ether used, usually, to specify the gas price for a transaction.

#25
  1. How do we calculate the total gas cost for a transaction?

It depends on the function and complexity of the task/code you want to run.

  1. What is gas limit?

A gas limit is the maximum amount of GAS you’re willing to pay for a transaction.

  1. What happens if we specify a gas limit that is too low?

Your transaction will get started but will then stop when it runs out of GAS.

  1. What happens if we specify a gas limit that is too high and therefore not consumed fully?

It will fill up the block even though the miners don’t get the extra gas. This is not recommmended since it will make your transaction less appealing to miners and fill up the blocks prematurely.

  1. What is a gwei?

Gwei is a unit of Ether. It is generally used to calculate the gas price which fluctuates based on market conditions.