Can a Transaction Be Partially Executed and Still Consume Gas?

Yes, a transaction that fails (e.g. due to running out of gas or a contract revert) is considered partially executed and still consumes gas. The gas consumed up to the point of failure is paid to the miner or validator for the computational work performed, even though the state changes are reverted.

What Happens When a Transaction Runs out of Gas?
What Is the Difference between a ‘Gas Limit’ and ‘Gas Price’ in Ethereum?
What Is the Primary Resource Consumed to Achieve Consensus in a PoW System?
Why Is the Consumed Gas Not Refunded upon Transaction Failure?
What Happens If a Transaction Runs out of Gas before Completion?
What Is the Concept of ‘Revert’ in Smart Contract Execution?
What Happens If a Transaction Runs out of Gas?
What Is the Risk of a ‘Gas Griefing’ Attack?

Glossar