Gas - Reading Assignment

1: Gas cost is the cumulative sum of all the operations involved with the transaction.
2:Gas limit is the maximum amount of gas you are willing to sped on the transaction.
3:If the gas limit is set too low, the transaction will commence and when it runs out of gas it stops and there is no refund of the gas you spent for an incomplete transaction.
4:If the gas limit is too high and not fully consumed you are refunded the remainder , while the miners get paid for mining your mempool transaction.
%: A gwei is the smallest unit of ether 1000000000. or 0.000000001 ether

2 Likes
  1. How do we calculate the total gas cost for a transaction?
    Each operation in a transaction has a gas cost. We tally up the gas costs of all the operations, and that establishes the total gas cost of the operation.

  2. What is gas limit?
    The amount of gas the user declares he’s willing to spend on a transaction.

  3. What happens if we specify a gas limit that is too low?
    They transaction may not execute, and whatever gas you did use gets sold to the miners, anyway.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The remaining balance of gas is returned back to the user.

  5. What is a gwei?
    It’s a small unit of measurement for ethereum. one gwei is 0.000000001 ETH.

1 Like
  1. The cumulative sum of what you are executing on the Ethereum Blockchain is the cost of gas for a transaction.
  2. A gas limit is the maximum amount you are willing to spend on a transaction.
    3.Too little gas will cause a failed transaction.
  3. A gas limit too high will run transaction, and unspent gas will be refunded.
  4. Gwei is the smallest unit of Ether, similar to Satoshi in terms of Bitcoin.
1 Like
  1. All transactions from simple transfers to ICO smart contracts on the Ethereum network has an associated cost in gas. Gas cost for a transaction results from the demand created by transactions senders and the supply for mining them - determined by the miners.
  2. Gas limit is the maximum amount of gas you are willing to spend on the transaction. Different types of transactions will require different amounts of gas to complete.
  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 spent on 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 limits fills up the block limit, but isn’t computationally-dense enough for miners to want.
  5. Gwei is 1000000000 wei. Wei is the smallest unit of ether.
1 Like
  1. The cumulative sum of all operations is the total gas cost for the transaction.
  2. Gas limit is the maximum amount of gas you are willing to spend on a transaction.
  3. If the gas limit is too low it will result in a failed transaction and the fees are kept by the miner.
  4. If the gas limit is too high extra unspent gas is refunded.
  5. gwei is the smallest unit of ether - 1000000000wei.
1 Like

Gas- assignment

1- each line of code has a fixed price in Gas, The cost of a Tx will be the sum of the gas applied to each line of code within the Tx.
2- It is the maximum gas ammount a user is willing to pay for a Tx.
3- THgen the Tx will not be validated. NO miner will choose it to include it in ablock and thus, the Tx will never happen.
4- the ramianing Gas will be returned to the user“s wallet
5- It is a lesser unit of ETH. 1 ETH equals 1 billion Gweis

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 tx

  2. What is gas limit?
    The maximum amount of gas you are willing to spend on the tx

  3. What happens if we specify a gas limit that is too low?
    Tx will fail and miner keeps fee

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Tx processes, unspent gas is refunded automatically

  5. What is a gwei?
    1000000000 wei, with 1 wei being the smallest unit of Ethereum.

1 Like
  1. The Gwei x current gas price at market
  2. 21000
  3. The transaction fails and you lose the gas.
  4. Gas not used is returned
  5. A unit billion times the wei
1 Like
  1. How do we calculate the total gas cost for a transaction?
    We sum up all the operations written in code and look at their price in gas.
  2. What is gas limit?
    That’s the maximum amount of gas you are willing to spend on a tx.
  3. What happens if we specify a gas limit that is too low?
    The transaction is getting rejected.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Unspent gas is refunded to your account.
  5. What is a gwei?
    1 ETH equals 1 billion gweis.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    Gas Price * Gas Limit

  2. What is gas limit?
    It is the maximum amount of gas that can be used for the given transaction

  3. What happens if we specify a gas limit that is too low?
    The transaction will not be completed -> Transaction fee is lost and transaction is not written to the blockchain

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    It is likely that the transaction will not be executed, as miners only get paid for the acutal gas consumed and there is a gas limit for blocks. If miners pick that transaction it will waste the gas limit of the block and the actual money earned for the transaction is low.

  5. What is a gwei?
    It is a unit of ether. The gas prize is measured in ether and 1 Gwei is 1000000000 wei which is the smallest unit of ether.

2 Likes
  1. The total gas cost for a transaction is the cumulative sum of all the operations required for that transaction.

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

  3. If we specify a gas limit that it too low, transaction could fail, and the fees will not get returned.

  4. If we specify a gas limit that it too high, it can fill up the block gas limit (no more space in the block), and that could lead transaction failure.

  5. gwei is 10^9 wei.

1 Like
  1. How do we calculate the total gas cost for a transaction?
  2. What is gas limit?
  3. What happens if we specify a gas limit that is too low?
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
  5. What is a gwei?

1.) We add up all the gas costs for executing the part of transactions and the use of a smart contract.
2.) It is the MAXIMUM amount of gas we are willing to pay to spend on the transaction.
3.) The transaction will start to be executed, but will eventually run out of gas and will be stopped.
4.) The ether used for the transaction will not be returned, and since the transaction did not complete, the blockchain will not reflect a transfer so the funds originated for the transfer will stay in the original account, like they never left the wallet.
5.) The gas price is usually some amount of gwei. It is a smaller amount of ether, wei is the smallest unit and gwei is 1000000000

1 Like
  1. How do we calculate the total gas cost for a transaction? The sum of the cost of all individual operations part of the transaction
  2. What is gas limit? Maximum amount of gas willing to be spent on transaction
  3. What happens if we specify a gas limit that is too low? Transaction will fail with the fees being paid to the miner
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully? Extra gas is automatically refunded
  5. What is a gwei? Amount of ether willing to be spent per gas unit
1 Like
  1. How do we calculate the total gas cost for a transaction?
    A: Each type of operation is associated with a fee expressed in multiples of gas (the fee unit). The cumulative sum of all the operations is the total gas cost for the transaction.

  2. What is gas limit?
    A: The gas limit expresses the maximum amount of gas a user is willing to pay for the transaction.

  3. What happens if we specify a gas limit that is too low?
    A: The transaction will not be able to be fully executed and will be rejected. The Ether transaction fee is lost. Nevertheless, the funds transferred are not lost: as the transaction is not viable they will not leave the wallet.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    A: The excess (unspent) gas is refunded

  5. What is a gwei?
    A: 1 gwei is equal to 1 billion wei. The wei converts the gas units in a cost expressed in Ether (1 Ether = 10^18 wei)

1 Like
  1. Every action / line of code that is executed has a gas amount assigned to it. Simple transactions have a lower fee and more complex transactions have a higher gas fee. The total gas amount is calculated by adding the total actions or code in the transaction.

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

  3. The transaction will begin but if there is not enough gas then it will run out and stop the transaction before it has been completed and accepted by the network. As it is not accepted, the gas used will not be returned but the transaction would be as if it never occurred, leaving the funds still in the wallet.

  4. The blocks in the Ethereum network have a gas limit. If the gas fee is to high and consumes a large portion of the block limit, the miners may not want to accept the transaction as it is not computationally dense enough. If the miners do accept the transaction then they will only use what is required for the transaction and the rest will remain in the wallet.

  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. Gas price is usually measured in ether, some amount in wei and usually in gwei. the value of gas is driven by the market & the nodes that prioritize higher gas prices when there is mining transactions.
    2 A gas limit is the maximum amount of gas you are willing to spend on a transaction
  2. If gas limit is to high and not consumed, the difference will be not be refunded.
  3. Gwei is 1000000000 wei.
1 Like
  1. Is the cumulative sum of all the operations involved in a transaction.

  2. Gas limit is the maximum amount of gas allocated to a transaction.

  3. You will run out of gas and the transaction will not be completed. And funds will go back into your wallet

  4. Unspent gas is automatically refunded.

  5. Wei is the smallest amount of Ether and gwei is 1000000000 wei

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 corresponds 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

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

Gas Limit is the maximum amount of gas allotted to the transaction.

It will result in a failed transaction, the fee paid will be lost, but the ether transferred never leaves the wallet since the blockchain was never updated.

Ethereum blocks have a gas limit size. The transaction will not be processed as miners will not want to deal with the transaction that isn’t computationally dense enough. Miners only get paid for the actual gas consumed to perform a transaction.

Gwei is 1000000000 wei. Wei is the smallest unit of ether.

1 Like
  • How do we calculate the total gas cost for a transaction?
    By adding up all operations. Each operation is calculated at a certain number of gas costs.

  • What is gas limit?
    The maximum you are willing to spend on gas fees to execute a transaction.

  • What happens if we specify a gas limit that is too low?
    Then the order starts executing but stops when there’s not enough gas. The transaction fails and no funds will be transferred.

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

  • What is a gwei?
    A fractional amount of Ether.

1 Like