Gas - Reading Assignment

  1. Gas price is moving with the market, every function that are done by the network has a price.
  2. maximum price that you are willing to pay.
  3. transaction will fail
  4. unused gas will be refunded, but too much gas and block gas limit will kick in and the transaction will not be executed
  5. Gwei is fractional part of Ether
1 Like
  1. How do we calculate the total gas cost for a transaction? It depends on what the exact operation being performed is. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. What is gas limit? the MAXIMUM amount of gas you are willing to spend on the transaction
  3. What happens if we specify a gas limit that is too low? Providing too little gas will result in a failed transaction, the fees are kept by the miner
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully? Extra, unspent gas is refunded automatically
  5. What is a gwei? gwei is 1000000000 wei and wei is the smallest unit of ether
1 Like
  1. The overall gas cost for the transaction is calculated by adding all of the operations together.

  2. This is the most gas you’re willing to pay on the transaction.

  3. The transaction will execute, but after some time, the transaction will revert (cancel) because it ran out of gas. The fees spent on this low gas tx will be collected by miners and your funds stay within your wallet.

  4. Any unconsumed gas will be refunded. However, it isn’t good practise to always specify a high gas limit since it is not computationally-dense for miners to want, meaning that it may exceed the gas limit for blocks, thus making your transactions revert.

  5. Gwei is a measurement of gas price. Wei is the smallest unit of ether (being 1x10^-18) and Gwei is 1x10^-9 (as written in code).

1 Like
  1. Every operation inside a transaction on the Ethereum network requires gas to be performed and every operation has a gas price. All of the operations required has a gas price and everything adds up to the total gas cost of the transaction. If you are willing to pay a higher gas price then your transaction will most likely be prioritized and go faster.

  2. Gas limit is the total amount of gas you are willing to pay for a transaction.

  3. If the limit is set to low then the transaction will not go thru the network and the fee is kept by the miner.

  4. The excess gas is refunded.

  5. gwei is the unit that gas is measured in. It is 1000000000wei which is the smalest unit of ether or 0,000000001ether.

1 Like
  1. Total gas cost is a sum of all costs of operations taking part in that transaction.

  2. It’s a maximum amount of gas that user want to spent on transaction.

  3. When limit is too low, then transaction will not be ran fully, so not completed. But gas offered will be used during that proces. Basicly U loose money and have 0 result.

4.When limit is slightly too high and not fully consumed the extra part of it will be refunded automatically, but the blocks in ethereum have max capacity of gas, so overloading makes an empty block filled only with gas fee.

  1. gwei is a giga wei, so 1 billion of wei, which is smallest unit of ETH,
1 Like
  • How do we calculate the total gas cost for a transaction?

The total gas is a product of the computation necessary t complete the transaction.

  • What is gas limit?

Gas limit is the maximum amount of gas you are willing to spend on a given operation/transaction.

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

The transaction does not complete (ie. runs out of gas) and the gas that has been spent is kept by the miner

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

You get back the unused portion however there is also a maximum gas size for all the transactions in an individual block which you cannot exceed if you want your transaction to be processed.

  • What is a gwei?

A “gwei” is a unit of ether equating to ‘1000000000’ wei.

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.

  2. The minimum gas limit for transaction is 21000 + the amount to execute any fallback functions if it’s sent to a contract.

  3. Your transaction will start to be executed, but will eventually run out of gas and be stopped.

  4. Extra, unspent gas is refunded automatically.

  5. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. You can calculate the gas fees for a transaction by summing up the costs for all the operations.
  2. Gas limit is the maximum amount of gas you are allowed to pay for a transaction.
  3. Your transaction will not be executed as it will eventually run out of gas. You will not get back the ether spent on the gas used, but since the transaction did not complete, the blockchain does not reflect a transfer, so the main funds essentially never left the wallet.
  4. The excess gas will be refunded.
  5. gwei is a franctional part of an ether.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    –> “The cumulative sum of all the operations is the total gas cost for the transaction.”

  2. What is gas limit?
    –> “This corresponds the the MAXIMUM amount of gas you are willing to spend on the transaction.”

  3. What happens if we specify a gas limit that is too low?
    –> "Providing too little gas will result in a failed transaction, Your transaction will start to be executed, but will eventually run out of gas and be stopped. "

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    –> The gas not consumed by the operation will be refunded back because the miners are paid only for the real consumed gas.

  5. What is a gwei?
    –> “gwei is simply 1000000000 wei”, where “Wei is the smallest unit of ether”.

1 Like
  1. The total gas cost for a tx is the cumulative sum of all operation for it

  2. Gas limit is the max gas we are willing to pay for a tx

  3. If gas limit too low specified: tx fails, gas fees are kept by miners

  4. If gas limit too high specified and not fully consumed: the unspend gas automatically fills up the block gas limit (not refunded)

  5. Gwei is a unit of in Ether gas price measure. 1wei is the smallest unit of Ether
    1gwei is 1M kwei or 1B wei

1 Like
  1. The cumulative sum of all operations equals the total gas of a a transaction.

  2. Gas limit is the maximum amount of gas you are willing to spend on the transaction.

  3. If gas limit is too low, the transaction will fail and gas fees are kept by the miners.

  4. If gas fee is too high extra unspent gas will be returned.

  5. gwei is 10000000000 wei, wei is the lowest unit of ether.

1 Like
  1. Gas price is calculated by the complexity of an operation.
  2. The max amount of gas you want to spend on a transaction.
  3. Then the transaction will be rejected, transaction fee will be lost as it’s paid to the miner.
  4. Unspent gas will be refunded.
  5. One gwei is a billion wei, a small unit of ether.
1 Like
  1. The total gas cost for a transaction is the cumulative sum of the cost of all operations in that transaction.

  2. Gas limit is the maximum amount of gas an entity is willing to spend on a said transaction.

  3. Transaction starts to execute but stops abruptly when it run out of gas, and expended gas fee is lost while the transaction value is still intact as the blockchain does not update.

  4. If gas limit is too high, only the actual gas consumed is spent on the transaction, the extra is automatically refunded.

  5. Gwei is the equivalent of 1000000000 Wei; the smallest unit of Ether. Gas price is measured in Gwei.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    Buy summing the cost of all operations in transaction.
  2. What is gas limit?
    Gas limit is the amount of gas you are willing to pay for a transaction to execute.
  3. What happens if we specify a gas limit that is too low?
    The transaction will start but stop midway, meaning you will lose that gas and not have a completed transaction.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Unspent gas will be refunded.
  5. What is a gwei?
    Gwei is 1000000000 wei, which is the the lowest unit of ether.
1 Like

1). A collective sum of all the operations is the total gas cost.

2). The maximum amount you are willing to spend on a transaction.

3). The transaction will be executed and as the gas fee runs out the transaction fails.

4). The ether miners are allowed to manipulate the size of the blocks to get paid faster.
If the gas fee exceeds the size that the miner set in that block, then the transaction will not go through.

  1. A Billion wei. Wei is the smallest unit of ether.
1 Like
  1. The total Gas cost is calculated by adding up all the predetermined costs per operation, but the transaction cost is subject to a minimum of 21000 Gas plus the cost of any fall back functions.

  2. Gas Limit is the maximum amount of gas that you are willing to pay.

  3. The transaction will start but then fail and any Ether spent on used gas will not be returned, although no transfer of Ether will take place because the transaction failed and was not added to the block.

  4. Because Ethereum blocks have a gas limit size, it is probable that the transaction will stay in the Mempool as Miners will not want to deal with the transaction because it is not computationally dense enough. This is because the miners only get paid for the actual gas consumed to perform a transaction.

  5. A Gwei is a fractional part of Ether in that is represents 1000000000 wei. Wei is the smallest unit of Ether.

1 Like

1)How do we calculate the total gas cost for a transaction?
Total gas for a transaction is calculated as a sum of all operation costs.
2)What is gas limit?
The maximum amount of gas you are willing to spend on the transaction.
3)What happens if we specify a gas limit that is too low?
If we set a gas limit that is too low, then the transaction will be not executed - it will stop. Gas will be assigned to miner. Object of the transaction (for example Ether sent) stays where it is, since it never left the wallet.
4)What happens if we specify a gas limit that is too high and therefore not consumed fully?
Extra, unspent gas is refunded.
5)What is a gwei?
A Gwei is a fractional part of Ether in that is represents 1000000000 wei. Wei is the smallest unit of Ether.

1 Like
  • How do we calculate the total gas cost for a transaction?
    You add up the costs for each operation according to the price list.
  • What is gas limit?
    You set the maximum amount of gas you are willing to pay for a transaction.
  • What happens if we specify a gas limit that is too low?
    The transaction will not go through and you will lose the gas fees to the miner.
  • What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The unspent gas fees will be refunded automatically.
  • What is a gwei?
    Gas price is measured in Ether and Wei is the smallest unit of Ether. Gwei is 1000000000 wei.
1 Like
  1. It depends on each operation. Every line of code in Solidity requires a certain amount of Gas. EVM check all those lines of codes and depend on the command of that line it will determine a gas.
  2. Gas Limit represents the amount of gas you are ready to pay for completing a transaction.
  3. Your tx will stuck. It cannot be executed because it runs out of gas. Usually your wallet calculate it automatically.
  4. You are refunded for unused gas, accounted for the price you paid for it, but you are not refunded for setting the gas price too high.
  5. Gwei is a small unit of the Ethereum network’s Ether (ETH) cryptocurrency.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    The sum of gas fee incurred by all the operations needed in a transaction.

  2. What is gas limit?
    The maximum gas one is wiling to pay for a transaction

  3. What happens if we specify a gas limit that is too low?
    The transaction would start to be executed but would eventually failed as gas is running out. Any paid amount will not be refunded.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The unspent amount will be refunded.

  5. What is a gwei?
    1 gwei = 1000000000 wei (smallest unit of ETH)

1 Like