Altcoins Talks - Cryptocurrency Forum

Crypto Discussion Forum => Cryptocurrency discussions => Technical Discussion => Topic started by: bitmover on March 20, 2024, 03:41:51 PM

Title: Understanding Ethereum Gas
Post by: bitmover on March 20, 2024, 03:41:51 PM
Quote
In a world computer, a program that abuses resources gets to abuse the world’s resources
How does Ethereum constrain the resources used by a smart contract if it cannot predict resource use in advance?
To answer this challenge, Ethereum introduces a metering mechanism called gas.

- Mastering Ethereum Book

Gas measures the amount of computational power that an operation (transaction) will consume. Gas is what fuels ethereum network. It is also what protects it against spam and Ddos attacks.

Payment for computation is made in the form of a gas fee, must be paid in Ethereum native token (eth).

Gas Limit and Gas Price attributes define the total cost of your transactions:

Code: [Select]
Transaction Cost = Gas Limit *  (base fee + priority fee)
Base fee: Amount of Gwei you are willing to spend per unit of gas.
Priority fee (tip): it is a tip that you add as an incentive for miners so they have incentives not to mine empty blocks.
Gas Limit: Maximum amount of units of gas that you will spend on the transaction.

Gas is usually quoted in Gwei. Gwei is a unit of of Ethereum.
The smallest ethereum denomination is wei. Both as named after Wei Dai,  the creator of b-money.

(https://www.investopedia.com/thmb/gclhVXuzRt9g6HQwRSYr8do1PSg=/750x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/dotdash_INV_final_Gwei_Ethereum_Jan_2021-01-370e27f6becf4830b333dacffe739415.jpg)




Monitor Gas Price
https://etherscan.io/gastracker

References:
https://github.com/ethereumbook/ethereumbook
https://ethereum.org/en/developers/docs/gas/ (main article used in this post)
Title: Re: Understanding Ethereum Gas
Post by: Yamane_Keto on March 20, 2024, 09:07:06 PM
I used to think that Gwei is the smallest unit of something like a satoshi, not Gwei.


How are gas fees a solution to DDOS attacks? Without filtering transactions, gas fees cannot be a solution. On the contrary, they may cause the inability to broadcast transactions, even if they are with higher fees.
Does anyone know why POS was promoted as solving the problem of high fees?
Title: Re: Understanding Ethereum Gas
Post by: bitmover on March 21, 2024, 06:36:32 PM
How are gas fees a solution to DDOS attacks? Without filtering transactions, gas fees cannot be a solution. On the contrary, they may cause the inability to broadcast transactions, even if they are with higher fees.

You answered the question by yourself.
Gas fees cause the "inability to broadcast transactions".

Transactions become so expensive, that only billionaires could perform a DDOS attack to ethereum protocol. And they coudn't do it for long... because it is expensive.

Title: Re: Understanding Ethereum Gas
Post by: Yamane_Keto on March 22, 2024, 07:38:31 PM
How are gas fees a solution to DDOS attacks? Without filtering transactions, gas fees cannot be a solution. On the contrary, they may cause the inability to broadcast transactions, even if they are with higher fees.

You answered the question by yourself.
Gas fees cause the "inability to broadcast transactions".

Transactions become so expensive, that only billionaires could perform a DDOS attack to ethereum protocol. And they coudn't do it for long... because it is expensive.
In the same way, normal users will not be able to broadcast the transaction due to the high fees, and if the fees decrease, the DDOS attack will return.
Success in stopping these attacks lies in blocking or removing addresses that cause spam or from broadcasting transactions, and gas fees do not have a mechanism to create such filters, so they will not prevent DDOS attacks.
Title: Re: Understanding Ethereum Gas
Post by: bitmover on March 22, 2024, 07:48:36 PM
How are gas fees a solution to DDOS attacks? Without filtering transactions, gas fees cannot be a solution. On the contrary, they may cause the inability to broadcast transactions, even if they are with higher fees.

You answered the question by yourself.
Gas fees cause the "inability to broadcast transactions".

Transactions become so expensive, that only billionaires could perform a DDOS attack to ethereum protocol. And they coudn't do it for long... because it is expensive.
In the same way, normal users will not be able to broadcast the transaction due to the high fees, and if the fees decrease, the DDOS attack will return.
Success in stopping these attacks lies in blocking or removing addresses that cause spam or from broadcasting transactions, and gas fees do not have a mechanism to create such filters, so they will not prevent DDOS attacks.

Well, it is a way to protect the network from DDOS attacks because it is expensive to do so. It is not 100%, because someone (or a group of people) may be willing to spend a lot of money to attack it. BUt, it is a protection.
Title: Re: Understanding Ethereum Gas
Post by: yhiaali3 on April 14, 2024, 06:34:59 AM
Thank you for the good explanation about Ethereum network gas.

As you know, Ethereum moved from the POW algorithm to POS, and there was also more than one upgrade on the Ethereum network. My question is, how does this affect Ethereum gas fees?

I expected to see a significant reduction in fees after all these upgrades, but what I see is that the desired effect has not been achieved yet. I mean, there has already been a reduction in fees, but not to the sufficient or desired degree that network users want to see. Why do you think?
Title: Re: Understanding Ethereum Gas
Post by: bitmover on April 15, 2024, 12:18:01 AM
Thank you for the good explanation about Ethereum network gas.

As you know, Ethereum moved from the POW algorithm to POS, and there was also more than one upgrade on the Ethereum network. My question is, how does this affect Ethereum gas fees?

I expected to see a significant reduction in fees after all these upgrades, but what I see is that the desired effect has not been achieved yet. I mean, there has already been a reduction in fees, but not to the sufficient or desired degree that network users want to see. Why do you think?

I also expected gas prices to go down once pos was implemented.  However,  it didn't happen.
 A simple uniswap swap is about 17usd, and a eth transaction is about 1 usd
https://etherscan.io/gastracker
Title: Re: Understanding Ethereum Gas
Post by: yhiaali3 on April 15, 2024, 03:56:56 AM
I also expected gas prices to go down once pos was implemented.  However,  it didn't happen.
 A simple uniswap swap is about 17usd, and a eth transaction is about 1 usd
https://etherscan.io/gastracker
The Eth transaction fee of about $1 is not a lot, but the $17 Uniswap swap fee is a lot, and of course this number can increase significantly as the swap value increases, so why all these high fees? Since the Eth transaction fees on the network are not that great?

Is it because of the fees Uniswap takes on each swap? Are the fees the same on all decentralized exchanges?
Title: Re: Understanding Ethereum Gas
Post by: bitmover on April 15, 2024, 04:26:01 PM
I also expected gas prices to go down once pos was implemented.  However,  it didn't happen.
 A simple uniswap swap is about 17usd, and a eth transaction is about 1 usd
https://etherscan.io/gastracker
The Eth transaction fee of about $1 is not a lot, but the $17 Uniswap swap fee is a lot, and of course this number can increase significantly as the swap value increases, so why all these high fees? Since the Eth transaction fees on the network are not that great?

Is it because of the fees Uniswap takes on each swap? Are the fees the same on all decentralized exchanges?

Amount of gas determined by the amount of computational calculations that the smartcontract does. Uniswap has a complex and expensive smartcontract, this is why the fee is high for the swap.

It is like a very big transaction