Gas - Reading Assignment

Gas - Reading

  1. The total gas cost for a transaction is calculated by first determining the price of gas.Then calculate the maximum amount of gas you want to spend on performing the transaction PLUS the amount to execute any fall-back option if it is sent to the smart contract.This will give you the total gas. Multiply the total gas by the cost price of gas , the result will give you the total gas cost.

  2. Gas Limit is the maximum amount we are willing to spend on a transaction.

  3. If we specify a gas limit that is too low, a transaction will start to be executed but will not be completed and will stop the transaction. You will not get ether spent but the incomplete of the transaction will not be reflected as a transfer on the blockchain. As a result, your main wallet amount will still remain the same ie no deduction in your wallet.

  4. If we specify a gas limit that is too high and therefore not consumed fully, the miner of the block will not process your transaction as the miner has a maximum limit that is allowed for its blocks. The miner is only paid for the amount of actual gas that is consumed by a transaction in a block. So, putting up a high value of the gas limit only fills up his block gas limit. This will not be computational dense enough for the miner to want it.

  5. GWEI is the unit use for gas price - one amount of gwei is 1000000000 wei

1 Like
  1. The total gas cost is the sum of all operational costs in the transaction.

  2. Gas limit refers to the maximum amount the sender is willing to pay to execute a transaction.

  3. If we specify a gas limit that is too low, the transaction may run out of gas. If that happens we lose our gas fee and the transaction will be cancelled.

  4. If we specify too much gas and it is not used, the excess will be automatically refunded.

  5. Gwei is the unit for gas in Ethereum transactions. 1ETH = 1 000 000 000 gwei

2 Likes

In regards to transaction fees on Ethereum, all transactions require a minimum gas limit of 21,000. The theory behind gas is complex and the gas prices can change erratically. The total gas required for a transaction is the sum of al the gas prices for each of the operations within a transaction or smart contract, including sufficient gas to return funds if a contract has a callback function for any failure to execute. The trick with gas is being able to determine the sufficient gas without wasting any gas or worse not specifying enough so that a transaction actually fail as it runs out of gas. In this case, the entire transaction fee will awarded to the miner and lost by the sender, and the original funds will not be transferred to the deposit address.
Also note that if too high gas is committed, miners will ignore the transaction, because the mining fees are based on what actually gets executed. Too high gas will not be rewarding to the miner, as the tx doesnt call for enough operations and the block gas limits will fill up if they get selected. A wei is the smallest possible unit of ether, and 1 billion wei is a gigawei, or gwei.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    Every operation on the blockchain has its cost, we calculate the end cost by calculating all the operations we need executed.

  2. What is gas limit?
    That is the maximum amount of gas you are willing to pay for a transaction. The higher the price you set the quicker your transaction could be executed. There is a lower limit of transactions, which is 21,000.

  3. What happens if we specify a gas limit that is too low?
    Our transaction could run out of gas, be stopped, and the funds returned.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    If the gas is not consumed it will be returned to you.

  5. What is a gwei?
    Unit of ether, one ether is divided into 1,000,000,000 gwei and to 1,000,000,000,000,000,000 wei.

3 Likes
  1. Each operation costs a certain amount of gas. The cumulative sum of all the operations’ costs is the total gas cost for the transaction.

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

  3. Providing too little gas will result in a failed transaction and the fees are kept by the miner

  4. When we specify a gas limit that is too high and not fully consumed, the unspent gas will be refunded.

  5. Gwei is one of the units that gas price can be measured in and is a subdivision of Ether. Wei is the smallest unit of Ether, and one gwei is one billion wei.

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. This is the maximum amount that is willing to be spent on the transaction.
  3. The transaction will begin to be executed but will eventually run out of gas meaning the transaction will be rejected by the network.
  4. Any excess amount not consumed by the transaction will be refunded back to the sender.
  5. Gwei is a smaller fractional unit of Ethereum. 1 unit of Gwei is equal to 1-billionth of an Ether
1 Like
  1. The total gas cost are a sum of each single operation (command).
  2. Gas limit defines the absolut amount of gas cost that a user is willing to pay.
  3. The operation is running out of gas and would not be executed. Paid fee would be lost (miners keep them) - transaction would not leave the wallet.
  4. Unspent gas will be refunded.
  5. Gwei is a denomination of ether. It represents 1 billion wei.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    sum of each single operation in a contract
  2. What is gas limit?
    The max amount of gas i am willing to spend on a transaction
  3. What happens if we specify a gas limit that is too low?
    fees are keeped by the miners
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Will be refund
  5. What is a gwei?
    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;
  2. The maximum amount of gas that the “client” are willing to pay;
  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. 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. 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. wei is the smaller unit of price of ethereum and gwei is simply 1000000000 wei.
1 Like
  1. By calculating and adding up the gas costs of each part of the specific transaction and/or smart contract.
  2. Gas limit defines the maximum amount of gas you are willing to spend for each particular transaction and/or smart contract.
    3.Your transaction will start to be executed, but will eventually run out of gas and be stopped. In this case, the ether spent on transactional fees will not be refunded but kept by the miner and your funds will have not left the wallet.
  3. The amount of ether that was not used for the gas costs will automatically be refunded to you. But 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

[quote=“filip, post:1, topic:6412”]

  • 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.

  • What is gas limit?
    Maximum amount of gas you are willing to spend on the transaction.

  • 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.

  • 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. Extra, unspent gas is refunded automatically

  • What is a gwei?
    1000000000 wei

1 Like
  1. You add up all the gas costs for executing each part of a transaction and use of a smart contract.
  2. Gas Limit is the maximum amount of gas that you are willing to pay for a transaction.
  3. Your transaction will start to be executed, but will eventually run out of gas and be stopped.
  4. The unused gas is refunded but the transaction might not be processed as each block has a gas limit.
    5.The measurement for Gas used on Ethereum network.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    Total gas cost is the sum of all operations within the transaction.
  2. What is gas limit?
    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?
    The transaction will start to execute but will run out of gas and be stopped. Gas used will not be returned.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Extra, unspent gas is automatically refunded. If you exceed the gas limit of the blocks then the transaction will not be processed.
  5. What is a gwei?
    Gwei is 1000000000 wei, wei being 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?
“Gas limit” refers to the maximum amount of gas (or energy) that you’re willing to spend on a particular 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?
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.) What is a gwei?
Gwei is a unit of ether which stands for gigawei, or rather 1,000,000,000 wei.

1 Like
  1. the total gas cost for a transaction is calculated by taking the gas units paid multiplied by the gas price measured in gwei.
  2. the gas limits the maximum amount of gas units a user is willing to spend on a tx.
  3. if we specify a gas limit that is too low, the tx will fail. the gas fees are not returned to the user, but the tx funds stay in the user’s wallet.
  4. if we specify a gas limit that is too high and therefore not consumed fully, the remained for the unspent gas is returned to the user who initiated the tx.
  5. a gwei is 1000000000 wei. And Wei is the smallest unit of ether.
1 Like
  • How do we calculate the total gas cost for a transaction?

    Depending of the amount, it's the gas, but in the article says about a formula, depending of the smart contract, you could use certain amount or other.
    
  • What is gas limit?

    The gas limit is the maximum amout the you're willing to pay for transaction.
    
  • What happens if we specify a gas limit that is too low?

    The transaction is sent to the mempool, and never get done the transaction.
    
  • What happens if we specify a gas limit that is too high and therefore not consumed fully?

    The miners only get paid of the job they did, and then it gets return to your EVM.
    
  • What is a gwei?

    It's a sub-currency of Eth.
1 Like
  1. The calculation of gas fee is the sum of all the operations we have to perform. Each operation has a cost.
  2. The gas limit is the maximum amount of gas you are willing to spend on the transaction.
  3. If your transaction runs out of gas it will not get completed.
  4. It will automatically be refunded
  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?

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

  1. What is gas limit?

It is the maximum amount of gas you are willing to spend on the transaction.

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

This will result in a failed transaction, 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.

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

Unspent gas is refunded automatically

  1. What is a gwei?

It is 1000000000 wei. And wei is the smallest unit of ether.

1 Like
  1. The cumulative sum of all the operations to be preformed.
  2. Maximum amount of gas allocated to the transaction.
    3.The transaction will not be preformed as you will have been deemed as running out of gas during processing.
  3. It will be refunded.
  4. Wei is the smallest unit of ether, 1 gwei is 1000000000 Wei.
1 Like

1- How do we calculate the total gas cost for a transaction?
The total is made up of the costs of each individual function contained in the code (and there is a 21000 gas minimum).

2- What is gas limit?
The maximum amount the user is willing to pay for transactions / operations.

3- What happens if we specify a gas limit that is too low?
The transaction will “start” but not be mined i.e. it will eventually fail. No transfer of assets will take place in such cases but any Ether spent on gas costs will not be returned.

4- What happens if we specify a gas limit that is too high and therefore not consumed fully?
Miners only get paid for the gas actually used when mining a block and blocks on Ethereum have their own gas limit as well. In the scenario the question outlines, the block’s gas limit is being used up in a way that guarantees miners won’t be paid some / a lot of it and so the most likely outcome is the block will not be mined.

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

1 Like