Gas - Reading Assignment

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

Depends on the tx we can check the price list.

2.What is gas limit?

The price of upper gas limit you’re willing to pay for tx.

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

Tx error.

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

We get it refunded.

1.What is a gwei?

It’s one billion of wei that is one ethereum unit.

1 Like
  1. Total gas cost = amount of gas spent on the transaction * gas cost
  2. Gas limit can be defined by the user as the maximum amount of gas he or she is willing to spend on the transaction.
  3. If the gas limit is too low, the transaction will most probably fail. The operation will revert.
  4. gwei is “giga” wei = 1 billion of wei = the smallest unit of ether.
1 Like
  1. All transactions, from simple transfers to ICO smart contracts, require some amount of operations to perform. Each of these operations has an associated cost in gas. Thus, simple transactions like transfers will require less gas to perform than more intense smart contracts. The cumulative sum of all the operations is the total gas cost for the transaction.

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

  3. 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. Blocks have a gas limit that specifies the maximum amount of gas all transactions in the block can consume. 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. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like

Gas

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? Gas Limit 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, 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? Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    We multiple the gas limit by the gaz price. Both are given by the user, with the network defining minimum and maximum values.

  2. What is gas limit?
    It is the maximum amount og gaz unit we are willling to spend on a given transaction.

  3. What happens if we specify a gas limit that is too low?
    The gaz is burnt and the operation is cancelled.

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

  5. What is a gwei?
    1 billion wei. It is a fraction 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.
    Important to note:
  • Different types of transactions will require different amounts of gas to complete
  • 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?
    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, high probability the transaction is rejected.
  3. What is a gwei?
    It is the amount of ether measured in the gas price.
1 Like

How do we calculate the total gas cost for a transaction?
Different transactions require different gas fees, but the gas price is the amount of ether you are willing to spend on every unit of gas.
What is gas limit?
The maximum amount of gas a user is willing to pay when sending a transaction, or performing a smart contract function
What happens if we specify a gas limit that is too low?
Your gas fee will go to the miners, your transaction won’t be executed and your funds don’t leave your wallet.
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?
Gwei is short for gigawei, or 1,000,000,000 wei. … 1 ether = 1,000,000,000 gwei its like a satoshi. A unit of messure.

1 Like

How do we calculate the total gas cost for a transaction?
The cumulative sum of all the operations = the total gas cost for the transaction.

What is gas limit?
The maximum amount of gas allotted to a transaction.

What happens if we specify a gas limit that is too low?
The transaction will appear as not going through, but the fees that are allotted will be taken.

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

What is a gwei?
A measurement of gas price equivalent to 1,000,000,000 wei, which is in turn the smallest division of an Ether.

1 Like
  1. All transactions, from simple transfers to ICO smart contracts, require some amount of operations to perform. Each of these operations has an associated cost in gas . Thus, simple transactions like transfers will require less gas to perform than more intense smart contracts.
  2. this corresponds the the MAXIMUM amount of gas you are willing to spend on the transaction.
  3. Providing too little gas will result in a failed transaction…
  4. he actual blocks also have a gas limit that specifies the maximum amount of gas all transactions in the block can consume. This is comparable to Bitcoin’s block size in bytes, but ether miners have the option to increase or decrease the gas limit of blocks so that they are propagated quickly. You cannot exceed this amount if you wish for your transaction to be processed.
    5.As price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.
1 Like
  1. How do we calculate the total gas cost for a transaction? Add up each transaction cost to perform the operation.
  2. What is gas limit? 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? Then the transaction will not process and the gas is not refunded.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully? Any excess will be refunded.
  5. What is a gwei? 1000000000 Wei
1 Like
  1. There are specified fees for executing each part of the smart contract.
  2. A gas limit is the maximum amount of gas a user is willing to pay for a transaction
  3. The transaction does not go through
  4. The extra funds are returned.
  5. 1000000000 wei
1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. The maximum amount of gas you are willing to spend on a transaction.
  3. It will result in a failed transaction. Monies that were spent on functions within the transaction will be kept by miner. Remaining funds for the transaction are refunded.
  4. 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. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.
1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.

  2. The minimum are 21000 gas for simple transfers and the maximum 4700000 gas or the limit on what your willing to spend.

  3. If the gas limits are to low and you are just sending a simple transaction then your transaction could get stuck but is easy to create a new transaction with the same nonce and a higher gas fee. If you are trying to interact with a smart contract or swap a token you could fail a transaction losing all the funds associated to the miners.

  4. The high gas limit won’t incentivize the miners to process the transaction, since their gain is only in proportion to the actual gas that is consumed by the transaction.

  5. Gas price is an amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction
  2. it corresponds to the maximum amount of gas you are willing to spend on the transaction
  3. the transaction could be out of gas and be stopped. the lower gas spend will not be refunded but the transaction will also not be executed.
  4. a gwei is fractionnal part of ether currency
1 Like

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

  • every action has an gas price. We calculate all transactions together.
    What is gas limit?
  • The limit of gas you can spend in a block. - and so also for a transaction.
    What happens if we specify a gas limit that is too low?
  • transaction can fail and the operation is not fullfilled.
    What happens if we specify a gas limit that is too high and therefore not consumed fully?
  • the amount of gas well be transfered back.
    What is a gwei?
  • an calculation unit of GAS. And in relation to ETH.
1 Like
  1. Any operation have a gas fee, therefore the cumulative sum of all the operations is the total gas cost for the transaction.

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

  3. Your transaction will start to be executed, but will eventually run out of gas and be stopped. The gas or fees that you put in will not be refund.

  4. unspent gas is refunded automatically

  5. The units of calculation of ETH. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like

1.- Depending on the operations performed by the contract or transaction the gas cost can change. Each ethereum Operation has a gas cost.
2.- Gas limit is the amount of gas you have assigned for an ethereum function call or transaction to happen.
3.- If the gas is too low, the transaction does not conclude but the gas is burned either way.
4.- If the gas is too high, it may be rejected and not accepted into a block, additionally the not used gas returns to the user or address that initiated the transaction.
5.- Gwei = 1e6 wei

1 Like

1/ gas limit X price of gas unit
2/ the maximum of gas used in the transactions of this block
3/ transaction will start running, but if limit is reached before transactions achievement, those won’t be processed, and gas fee won’t be refunded
4/ extra consumption won’t be refunded to you, if transaction is completed.
5/ = 10^^9 wei, wei being the mini unit in Ether.

1 Like

1 Like
  1. By adding up the sum of gas costs for all of the different operations in a transaction.

  2. Maximum amount of gas that we are willing to spend on a transaction.

  3. This situation happened with me, the transaction was run out of Gas, then stopped, I lost miners fees, it was something like 25 USD, funds were returned, only miners fees were deducted from my wallet.

  4. When we specify a lot of gas and it was used, the excess will be refunded automatically.

  5. 1000000000 wei.

1 Like