The block_gas_used value is updated at the end of each block.
The total gas used by current block is stored in the KVStore at EndBlock.
EndBlock
It is initialized to block_gas defined in the genesis.
block_gas