1

The more gas used, the more profit a miner earns. So miners can simply say that the transaction ran out of gas without even executing the transaction and updating the state.

JITVM optimizes the byte-code so less gas is required for executing transactions. But how does this benefit miners? Less operation will result in less profit.

How does another node verify verify the gas used is correct?

0

A miner may well cheat as you describe. However, when this cheating miner sends its block to the network, regular nodes will verify the block. And in particular they will rerun the operations. If they find out the fraud, the nodes will reject the block.

JITVM, AFAIK, is only there to reduce the burden of running the code on the EVM. It is not meant as a way to reprice opcodes' gas cost.

0

Is the EVM in its main loop that checks how much gas may be consumed by executing a contract:

The EVM’s internals are pretty simple; it has a single run loop which will attempt to execute the instruction at the current Program Counter (PC in short). Within this loop the Gas is calculated for each instruction, memory is expanded if necessary and executes the instruction if the preamble succeeds

Source: https://blog.ethereum.org/2016/06/02/go-ethereums-jit-evm/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.