What Is a ‘Gas Limit’ and Why Is It Important?
The gas limit is the maximum amount of gas a user is willing to spend on a specific transaction. It is crucial because it prevents accidental or malicious infinite loops in smart contracts from consuming all network resources.
If the gas used exceeds the gas limit, the transaction fails, but the fee is still consumed.