Gas - Reading Assignment

  1. How do we calculate the total gas cost for a transaction?
    We add all the gas price for every single computation required by the transaction.
  2. What is gas limit?
    The max amount of gas that one is willing to pay for the transaction.
  3. What happens if we specify a gas limit that is too low?
    Transaction can be extremely low or even fail.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The unspent gas will be refunded-
  5. What is a gwei?
    Wei is the smallest amount of ETH and Gwei is 1 billion wei.
1 Like
  1. Add up all commands in described in the contract according to the cost table.
  2. The maximum amount of gas you are willing to pay for.
  3. Your transaction may start, but will fail to complete. The gas used has to be payed for, but no actual transactions will take place.
  4. The remaining a gas will not be used.
  5. GigaWei, 1e9 wei or 1e-9 eth.
1 Like

How do we calculate the total gas cost for a transaction?
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.
What is gas limit?
Gas Limit is the maximum amount of gas that you are willing to pay.
What happens if we specify a gas limit that is too low?
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.
What happens if we specify a gas limit that is too high and therefore not consumed fully?
You will not get back ether spend 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.
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

1) How do we calculate the total gas cost for a transaction?
Gas is calculate by the operations need to complete the transaction. Each operation has is associated cost.

2) What is gas limit?
The gas limit is the maximum amount of gas you are willing to use to complete the transaction.

3) What happens if we specify a gas limit that is too low?
If you specify to little gas the transaction will very possibly not complete since there is not enough gas allocate to complete the transaction.

4) What happens if we specify a gas limit that is too high and therefore not consumed fully?
The transaction will also possibly not be competed and the gas amount will be propagated.

5) What is a gwei?
1 wei is the smallest unit of ether measured, 1 gwei is 1 billion wei.

1 Like

1. How do we calculate the total gas cost for a transaction?
With the amount of computation/actions that has to be done when you want to do a transaction.

2. What is gas limit?
This is the minimum gas that is required to be almost sure your transaction gets accepted by the miners. You could pay less but if someone comes in and offers a better fee for sure the miner picks the transaction with the most fees.

3. What happens if we specify a gas limit that is too low?
the transaction will be not executed and eventually, it will run out of gas. You get back your ether tho but the gas you spent on that calculation/transaction is lost to the miner.

4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
Then you end up paying for block space you don’t actually use so it’s pretty wasteful since the miners also get nothing more for the computation work they have done.

5. What is a gwei?
This is the gas price and is almost the smallest unit of ether. One Ether is 1 billion gwei.

1 Like

Reading Assignment: Gas

  1. How do we calculate the total gas cost for a transaction?
    Take the amount of the necessary gas required per transaction and multiply by the price in gwei per gas unit.
  2. What is the 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 to low?
    This will result in a failed transaction, the fees will be kept by the miner, but the main funds will be as if it never left your wallet.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The extra gas fees will be refunded
  5. What is a gwei?
    Wei is the smallest unit of ether and Gwei is simply 1 000 000 000 Wei
1 Like
  1. Add up all the gas for each part of the transaction.
  2. The max you are willing to pay for the execution of a transaction.
  3. The transaction will not be completed.
  4. Will be refunded automatically or if too hight for even what the miner specified, you will not be able to execute the transaction.
  5. it is 1 billion Wei. A unit of measure for gas.
1 Like
  1. By summing up the cost of each operation to execute transaction or smart contract.
  2. Maximum amount of gas allotted to the transaction.
  3. Transaction will fail at point when it runs out of gas.
  4. If will get refunded back.
  5. Measurement unit which is fractional amount of ether.
1 Like
  1. Sum up the cost of each operation to execute a transaction or smart contract.
  2. Gas limit is the amount your willing to spend for a transaction.
  3. The transaction will stop and not execute and the amount of ether will remain in balance. The amount of gas used in that transaction is not rolled back.
  4. The amount of gas that isn’t consumed will be refunded back.
  5. Gwie or 1 billion wei is the smallest unit of 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?
    The gas limit is 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?
    Your transaction will start to be executed, but will eventually run out of gas and be stopped. When this happens, you will not get back ether spend 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. 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.
1 Like
  1. How do we calculate the total gas cost for a transaction?

Total sum of costs for each operation in the transaction.

  1. What is gas limit?

capped amount one is willing to spend

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

the transaction does not go through, ie the blockchain is not updated. gas fees however are spent/ go to the miner.

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

overspent gas will be automaticaly reimbursed

  1. What is a gwei?

smallest unit of gas

1 Like
  1. How do we calculate the total gas cost for a transaction?
    You add up all the gas costs for executing each part of a transaction and use of a smart contract. 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.

  • Providing too little gas will result in a failed transaction, the fees are kept by the miner.
  • Extra, unspent gas is refunded automatically
  1. What happens if we specify a gas limit that is too low?
    Your transaction will start to be executed, but will eventually run out of gas and be stopped. When this happens, you will not get back ether spend 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.

  2. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    the actual blocks have a gas limit that specifies the maximum amount of gas all transactions in the block can consume.You cannot exceed this amount if you wish for your transaction to be processed.

  3. What is a gwei?
    Gas price is the amount of ether you are willing to spend on every unit of gas. Gas price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. Each operation cost a certain amount of gas, the total cost is the sum of these costs.
  2. The maximum amount of gas you’re willing to pay.
  3. It will stop the execution midway, not refunding the operations already executed.
  4. If its under the max limit the excess will be refunded.
  5. A unnit of ether.
1 Like
  1. How do we calculate the total gas cost for a transaction? All Ethereum transactions, from transfers to larger smart contract applications, require a number of operations to complete. Each operation has an associated gas fee. A simple transfer with fewer operations requires less gas than more complex smart contracts.

An example from the reading: “For example, a simple operation like if(var > 1) may cost 1 gas, but a more complex operation to store a variable could cost 100 gas. **The cumulative sum of all the operations is the total gas cost for the transaction.”

  1. What is gas limit? The gas limit is the amount that an actor is willing to pay for a transaction (in gas fees).

  2. What happens if we specify a gas limit that is too low? If too low a gas limit is proposed, the transaction will fail because no miner will choose to process the transaction.

  3. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    If the gas limit specified is too high and not fully consumed, the remainder will be returned to the actor.

  4. What is a gwei? A gwei is a unit of ETH that equals 1,000,000,000 times the smallest unit of 1 ETH, which is called wei. Ethereum gas is transacted in GWEI units.

1 Like

Gas – Questions

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

The total gas cost for a transaction is equal to the cumulative sum of all the operations that need to be executed within it.

2. What is a gas limit?

This corresponds to the maximum amount of gas a wallet holder is willing to spend on a transaction.

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

Providing too little gas in fees might result in a failed transaction, in which case the fees would still be kept by the miner.

The reason is: once a transaction has been submitted, it will execute until it eventually runs out of gas and is forced to stop. If this happens, users do not get back the ether they spent on their transaction’s gas fees, and since the transaction was not completed the blockchain will not reflect any transfers, meaning the funds that were meant to be transacted on essentially never left the wallet of origin.

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

Any unspent gas is refunded automatically to a user’s wallet.

5. What is a gwei?

1 gwei = 109 wei = 1 billion wei

1 Like
  1. Total gas for an eth transaction depends on all tasks to be performed. It also depends on the current market price and saturation of the transaction pool.

  2. Gas limit is the maximum of gas units required for a specific transaction to be carried out (using the fastest option).

  3. If we specify a gas limit that is too low the gas will be used, but tre transaction will not be executred and get stuck.

  4. A gas limit specified too high will not be used up totally, as there is a maximum defined for a specific set of tasks. The rest however does not do anything useful and the miner cannot use it. It is not spent from the owners wallet.

  5. Gwei is eth’s gas price unit.

1 Like
  1. You calculate the cost by the sum of all operations that are executed within a smart contract.

  2. The maximum amount of gas you are willing to spend on the transaction.

  3. The transaction will start to be executed, but will eventually run out of gas and be stopped. Ether spent on the gas can’t be refunded but you keep the main funds since the transaction was never appended to the blockchain.

  4. Block have a gas limit that specifies the maximum amount of gas all transactions in the block can consume. Also, miners only get paid for the actual gas consumed by a transaction, so putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want.

  5. 1 gwei = 1,000,000,000 wei, with wei being the smallest unit of ether.

1 Like
  • How do we calculate the total gas cost for a transaction?
    The total gas cost for a transaction is the sum of the cost of all operations executed in the transaction on the EVM (adding up the toal cost of each transaction in the contract).

  • What is gas limit?
    The Gas Limit is the maximum amount of gas willing to be paid for the transaction fees.

  • What happens if we specify a gas limit that is too low?
    The transaction will eventually fail and the gas fees will be kept and the program will not execute.

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

  • What is a gwei?
    A unit of Ether with 1 billion qwei = 1 wei, the smallest unit of Ether which indicates gas prices on the Ethereum network.

1 Like
  1. We add the operations in the smart contract together to get the gas cost.
  2. Gas limit is the amount of gas you are willing to spend on a transaction.
  3. Your transaction may not go through due to insufficient gas and you will lose the gas you had paid to that point.
  4. It cannot be used by the miner and will be refunded.
  5. Gwei is the denomination of Ether we use for gas.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    A: We sum up the costs of all operations needed for the transaction.

  2. What is gas limit?
    A: 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?
    A: Transaction will not be executed and we will lose the gas amount we specified as it got burned in the attempt to process the transaction.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Extra unspent gas is returned to owner.

  5. What is a gwei?
    Wei is the smallest unit of ether, and gwei is simply 1000000000 wei. gweis are usually used to level the gas price.

1 Like