Implement Crass Gas Limit
I have assigned this to myself, because I wish to include this as part of my contributions to the project in my PhD Thesis.
This issue will allow for limiting the state space significantly and thus speed up execution for queries which are not reachable.
The Gas Limit has an interesting definition:
- The gas price is a value set by the creator of the transaction, who has to pay
gas_price * gas
up front from the sending account. If some gas is left after the execution, it is refunded to the creator in the same way. - If the gas is used up at any point (i.e. it would be negative), an out-of-gas exception is triggered, which reverts all modifications made to the state in the current call frame.
- Memory Costs Gas: Memory is expanded by a word (256-bit), when accessing (either reading or writing) a previously untouched memory word (i.e. any offset within a word). At the time of expansion, the cost in gas must be paid. Memory is more costly the larger it grows (it scales quadratically).
- in Ethereum, the sender of the transaction must specify a gas limit before they submit it to the network. The gas limit is the maximum amount of gas the sender is willing to pay for this transaction.
- Source: https://solidity.readthedocs.io/en/v0.6.7/introduction-to-smart-contracts.html#gas
- Ethereum block size is bound by how many units of gas can be spent per block. This limit is known as the block gas limit
- Ethereum miners determine what the maximum gas limit should be by signalling it to the network each block. Miners are given this ability to adjust this rate because changes to the gas limit affects the resources necessary to effectively mine Ethereum.
- Source: https://blockgeeks.com/guides/ethereum-gas/#Why_do_we_have_this_Gas_system
- Raising the gas limit has the potential to increase the average block size, ultimately affecting the cost of node on the Ethereum network. Larger block sizes means that the space required to store the Ethereum blockchain grows faster. Bigger blocks and the possibility of less nodes on the network can affect Ethereum's uncle rate.
- Source: https://ethgasstation.info/blog/ethereum-block-size/
Notes:
- New Command:
/*!AttackGasLimit:<INT>;*/
- Build a lookup table for the amount of gas each solidity command could take in gas (set initially to 1)
- When a command runs, decrement the gas used
- Stop execution when gas used reaches 0
Edited by Jon Shahen