What is (EVM) Ethereum Virtual Machine?
The Ethereum Virtual Machine is the execution environment for the Ethereum network. It is comprised of several components, including a stack, memory, gas balance, and program counter. It can perform any kind of operation, such as executing decentralized applications. It can also execute Turing complete smart contracts, which are schedules that automatically carry out tasks. An Ethereum Virtual Machine can also execute a set of operations codes called OP_CODES. It allows a user to send and receive payments in an automated manner, and it is also capable of performing certain tasks.
Smart contract can initiate transactions, and call other contracts, which results in the instantiation of another EVM. Each instantiation starts by initializing the sandbox world state of the previous EVM. It is given a fixed amount of gas to run operations, and if the amount of gas is insufficient, the execution halts and the transaction returns to the previous EVM. This cycle repeats itself over.
The EVM stack is the storage for program code. It displays elements pushed and popped from the stack, as well as a program counter. The program counter increases with each instruction read from the main memory. The program code is then copied into the main memory using the CODECOPY instruction. When you run a program, you can see the state of the EVM, and the gas that it consumes. Typically, the EVM will consume approximately 20 gigabytes of memory.