Gas is the virtual currency for calculating the cost of transaction execution. The transaction cost is expressed as a given amount of gas consumed and can be seen intuitively as some cycles of the virtual processor that has to be used to run the computation defined as the transaction’s code.
The state of the virtual machine at the beginning of the blockchain.
When thinking of a blockchain as a decentralized computer, the global state is its memory state.
When thinking of a blockchain as a shared database, the global state is the snapshot of the database’s data.
Technically, a global state is a (possibly extensive) collection of key-value pairs, where the keys are references (Refs), and the values are large binary objects (BLOBs).
For every block B in the blockchain, one can compute the global state achieved by executing all transactions in this block and its ancestors. The root hash identifying this state is stored in every executed block.