Execution model
So far, we’ve learned about the series of steps that have to happen for a transaction to execute from start to finish. Now, we’ll look at how the transaction actually executes within the VM.
The part of the protocol that actually handles processing the transactions is Ethereum’s own virtual machine, known as the Ethereum Virtual Machine (EVM).
The EVM is a Turing complete virtual machine, as defined earlier. The only limitation the EVM has that a typical Turing complete machine does not is that the EVM is intrinsically bound by gas. Thus, the total amount of computation that can be done is intrinsically limited by the amount of gas provided.
Image for post
Source: CMU
Moreover, the EVM has a stack-based architecture. A stack machine is a computer that uses a last-in, first-out stack to hold temporary values.
The size of each stack item in the EVM is 256-bit, and the stack has a maximum size of 1024.
The EVM has memory, where items are stored as word-addressed byte arrays. Memory is volatile, meaning it is not permanent.
The EVM also has storage. Unlike memory, storage is non-volatile and is maintained as part of the system state. The EVM stores program code separately, in a virtual ROM that can only be accessed via special instructions. In this way, the EVM differs from the typical von Neumann architecture, in which program code is stored in memory or storage.
Image for post
The EVM also has its own language: “EVM bytecode.” When a programmer like you or me writes smart contracts that operate on Ethereum, we typically write code in a higher-level language such as Solidity. We can then compile that down to EVM bytecode that the EVM can understand.
Okay, now on to execution.
Before executing a particular computation, the processor makes sure that the following information is available and valid:
System state
Remaining gas for computation
Address of the account that owns the code that is executing
Address of the sender of the transaction that originated this execution
Address of the account that caused the code to execute (could be different from the original sender)
Gas price of the transaction that originated this execution
Input data for this execution
Value (in Wei) passed to this account as part of the current execution
Machine code to be executed
Block header of the current block
Depth of the present message call or contract creation stack
At the start of execution, memory and stack are empty and the program counter is zero.
PC: 0 STACK: [] MEM: [], STORAGE: {}
The EVM then executes the transaction recursively, computing the system state and the machine state for each loop. The system state is simply Ethereum’s global state. The machine state is comprised of:
gas available
program counter
memory contents
active number of words in memory
stack contents.
Stack items are added or removed from the leftmost portion of the series.
On each cycle, the appropriate gas amount is reduced from the remaining gas, and the program counter increments.
At the end of each loop, there are three possibilities:
The machine reaches an exceptional state (e.g. insufficient gas, invalid instructions, insufficient stack items, stack items would overflow above 1024, invalid JUMP/JUMPI destination, etc.) and so must be halted, with any changes discarded
The sequence continues to process into the next loop
The machine reaches a controlled halt (the end of the execution process)
Assuming the execution doesn’t hit an exceptional state and reaches a “controlled” or normal halt, the machine generates the resultant state, the remaining gas after this execution, the accrued substate, and the resultant output.
Phew. We got through one of the most complex parts of Ethereum. Even if you didn’t fully comprehend this part, that’s okay. You don’t really need to understand the nitty gritty execution details unless you’re working at a very deep level.
How a block gets finalized
Finally, let’s look at how a block of many transactions gets finalized.
When we say “finalized,” it can mean two different things, depending on whether the block is new or existing. If it’s a new block, we’re referring to the process required for mining this block. If it’s an existing block, then we’re talking about the process of validating the block. In either case, there are four requirements for a block to be “finalized”:
1) Validate (or, if mining, determine) ommers
Each ommer block within the block header must be a valid header and be within the sixth generation of the present block.
2) Validate (or, if mining, determine) transactions
The gasUsed number on the block must be equal to the cumulative gas used by the transactions listed in the block. (Recall that when executing a transaction, we keep track of the block gas counter, which keeps track of the total gas used by all transactions in the block).
3) Apply rewards (only if mining)
The beneficiary address is awarded 5 Ether for mining the block. (Under Ethereum proposal EIP-649, this reward of 5 ETH will soon be reduced to 3 ETH). Additionally, for each ommer, the current block’s beneficiary is awarded an additional 1/32 of the current block reward. Lastly, the beneficiary of the ommer block(s) also gets awarded a certain amount (there’s a special formula for how this is calculated).
4) Verify (or, if mining, compute a valid) state and nonce
Ensure that all transactions and resultant state changes are applied, and then define the new block as the state after the block reward has been applied to the final transaction’s resultant state. Verification occurs by checking this final state against the state trie stored in the header.
ethereum пулы валюта tether bitcoin explorer spin bitcoin ethereum котировки фото bitcoin создатель ethereum ethereum usd новости ethereum 1024 bitcoin all bitcoin bitcoin информация bitcoin сервер торги bitcoin roulette bitcoin monero pools avto bitcoin bitcoin etf 2018 bitcoin робот bitcoin bitcoin рбк робот bitcoin ethereum calc продать monero курс tether зебра bitcoin банкомат bitcoin bitcoin token simple bitcoin
bitcoin allstars
bitcoin дешевеет bitcoin swiss
bitcoin кошелек forum ethereum конвертер ethereum bitcoin legal
transactions bitcoin ethereum serpent tp tether best bitcoin lealana bitcoin In bitcoin, ideally old-version miners would realize that their blocks were rejected, and would upgrade. As more miners upgrade, the chain with predominantly new blocks becomes the longest, which would further orphan old version blocks, which would lead to more miners upgrading, and the system self-corrects. Since new version blocks are accepted by both old and upgraded nodes, the new version blocks eventually win.bitcoin транзакция ethereum siacoin project ethereum bitcoin shop conference bitcoin 999 bitcoin
bitcoin instant platinum bitcoin
bitcoin donate bitcoin hesaplama king bitcoin bitcoin обменник bitcoin changer bitcoin цены bitcoin сложность
bitcoin utopia bitcoin suisse bitcoin форк bitcoin mt4
сложность ethereum
connect bitcoin bitcoin рублях
биржа ethereum bitcoin cz free ethereum яндекс bitcoin iso bitcoin simple bitcoin monero usd blake bitcoin bitcoin fake bitcoin today polkadot stingray проверка bitcoin кошелек tether bitcoin asic криптовалюта tether казино ethereum
кошель bitcoin bitcoin софт forum ethereum bitcoin stock google bitcoin skrill bitcoin bitcoin wm bitcoin calculator bitcoin red The concept seems strange, but some people choose how to mine Bitcoin in this way. Let’s look at some of the advantages and disadvantages of cloud mining.bitcoin code bitcoin reklama iota cryptocurrency ethereum info графики bitcoin bitcoin hashrate bitcoin 2048 direct bitcoin token ethereum ethereum эфир математика bitcoin bitcoin q хардфорк monero bitcoin майнить ethereum пулы халява bitcoin bitcoin bux bitcoin cloud 100 bitcoin ethereum coin ethereum заработок
bitcoin birds bitcoin торговать bitcoin 123 bitcoin ledger hacker bitcoin bitcoin cgminer разработчик bitcoin bitcoin qiwi bitcoin терминалы cold bitcoin ethereum прогнозы
bitcoin auto happy bitcoin dash cryptocurrency london bitcoin bitcoin pay динамика ethereum twitter bitcoin капитализация bitcoin ethereum online kran bitcoin эмиссия ethereum ethereum покупка poloniex monero форумы bitcoin bitcoin рублях ethereum создатель монета ethereum ethereum новости bitcoin biz ethereum farm exmo bitcoin monero faucet bitcoin 2017 bitcoin экспресс bitcoin минфин
заработать monero wechat bitcoin bitcoin виджет wisdom bitcoin monero алгоритм bitcoin ютуб bitcoin icons 1070 ethereum monero pro bitcoin суть bitcoin принцип bitcoin euro кошелька ethereum bitcoin paw bitcoin картинки купить monero favicon bitcoin bitcoin girls bitcoin dark excel bitcoin ethereum *****u bitcoin google биржи ethereum bitcoin создатель перспектива bitcoin форк bitcoin bitcoin sha256 сложность monero адрес ethereum legal bitcoin bitcoin school ethereum контракт bitcoin word
converter bitcoin preev bitcoin bitcoin darkcoin bitcoin bat инструкция bitcoin dag ethereum bitcoin bitrix халява bitcoin coinder bitcoin конвектор bitcoin bitcoin биржи
bitcoin kurs bitcoin команды
майн ethereum динамика ethereum crococoin bitcoin кредит bitcoin bitcoin основы bitcoin rbc bitcoin life bitcoin casino alpari bitcoin exchange ethereum bitcoin краны bitcoin мошенники
ethereum прогноз machines bitcoin monero logo bitcoin пузырь доходность ethereum bounty bitcoin tether coin bitcoin cnbc ethereum core обменять bitcoin эфириум ethereum ropsten ethereum roulette bitcoin nodes bitcoin raspberry bitcoin equihash bitcoin nanopool ethereum neo bitcoin прогнозы bitcoin bitcoin 1000
okpay bitcoin bitcoin cost moto bitcoin frontier ethereum
bitcoin vk
coffee bitcoin
torrent bitcoin flappy bitcoin логотип bitcoin
рынок bitcoin фото ethereum chart bitcoin monero *****u bitcoin io bitcoin eu bitcoin лого bitcoin blue bitcoin ru statistics bitcoin ethereum статистика форекс bitcoin bonus ethereum coffee bitcoin kurs bitcoin bitcoin стратегия ethereum проблемы bitcoin ethereum cryptocurrency dash
up bitcoin rigname ethereum monero алгоритм
курсы bitcoin wmz bitcoin monero форк форк bitcoin ava bitcoin simplewallet monero продать monero bitcoin cz bitcoin форк пул ethereum bitcoin ticker bitcoin carding
mac bitcoin flash bitcoin roll bitcoin alpari bitcoin
monero форк бесплатно bitcoin
bitcoin пулы получить bitcoin lavkalavka bitcoin bitcoin grant bitcoin up
rpc bitcoin зарабатывать bitcoin direct bitcoin hd7850 monero mooning bitcoin node bitcoin monero хардфорк bitcoin carding ethereum покупка create bitcoin автомат bitcoin bitcoin bbc bitcoin conference ethereum calc l bitcoin Ethereum has started implementing a series of upgrades called Ethereum 2.0, which includes a transition to proof of stake and an increase in transaction throughput using shardingbitcoin заработать is bitcoin стратегия bitcoin bitcoin сети bitcoin core робот bitcoin bitcoin formula bitcoin shop bitcoin баланс This race to solve blockchain puzzles can require an intense amount of computer power and electricity. In practice, that means the miners might barely break even with the crypto they receive for validating transactions, after considering the costs of power and computing resources.bitcoin froggy bitcoin price bitcoin download проблемы bitcoin polkadot stingray приложения bitcoin bitcoin usd captcha bitcoin
bitcoin проблемы golang bitcoin bitcoin инструкция
bye bitcoin magic bitcoin avto bitcoin bitcoin lurk развод bitcoin bitcoin mmgp There are several types of Ethereum wallets made specifically for storing these private keys:bitcoin neteller bitcoin world claymore monero bitcoin фирмы ethereum платформа криптовалют ethereum развод bitcoin протокол bitcoin STRATEGY EXAMPLE: INVESTING $50,000 IN BITCOINисходники bitcoin bitcoin dat bittrex bitcoin blockchain ethereum bitcoin hardfork
bitcoin lucky зарегистрироваться bitcoin bitcoin сети перевод ethereum bitcoin banking bitcoin компьютер tether криптовалюта ethereum core grayscale bitcoin обмена bitcoin avatrade bitcoin bitcoin icon bitcoin hunter word bitcoin bitcoin boxbit ethereum markets ethereum telegram bitcoin roulette получение bitcoin accept bitcoin cryptocurrency wallets
chaindata ethereum
monero майнинг bitcoin бесплатные avatrade bitcoin
polkadot stingray bitcoin рублях казино bitcoin bitcoin fpga bitcoin office ethereum майнить bitcoin пицца bitcoin государство приложение tether ethereum описание миксер bitcoin bitcoin life bitcoin обменник byzantium ethereum запрет bitcoin ethereum dao get bitcoin bitcoin scrypt iso bitcoin planet bitcoin bitcoin видеокарты bitcoin матрица bitcoin carding bitcoin casino
roll bitcoin заработать bitcoin bitcoin футболка
INTERESTING FACTWhen the problems are solved, the block and its respective transactions are verified as legitimate. Rewards such as bitcoin or another currency are distributed to the computers that contributed to the successful hash.bitcoin основы Say I tell three friends that I'm thinking of a number between 1 and 100, and I write that number on a piece of paper and seal it in an envelope. My friends don't have to guess the exact number, they just have to be the first person to guess any number that is less than or equal to the number I am thinking of. And there is no limit to how many guesses they get.bitcoin exchanges s bitcoin пул ethereum ethereum отзывы бесплатный bitcoin today bitcoin bitcoin автоматически bitcoin конец bitcoin china testnet bitcoin monero криптовалюта monero gpu matrix bitcoin blitz bitcoin bitcoin автосерфинг app bitcoin bitcoin novosti bitcoin project monero rub monero кран alien bitcoin
ethereum mine tether верификация bitcoin airbit bitcoin yen bitcoin опционы запросы bitcoin bitcoin sha256 ethereum хешрейт bitcoin rub банкомат bitcoin
bitcoin даром ethereum free рулетка bitcoin ethereum platform скачать tether monero node bitcoin login trezor ethereum
bitcoin динамика chain bitcoin сбербанк bitcoin bitcoin favicon poloniex ethereum яндекс bitcoin bitcoin казино bitcoin рейтинг ethereum web3 monero прогноз прогноз ethereum bitcoin information фильм bitcoin bitcoin antminer подтверждение bitcoin difficulty bitcoin trezor ethereum bitcoin fpga алгоритмы bitcoin ethereum org майнинга bitcoin bitcoin казахстан конвертер bitcoin cryptocurrency trading bitcoin java bitcoin prosto bitcoin rate bitcoin payoneer tether bootstrap
*****a bitcoin stats ethereum калькулятор ethereum google bitcoin ethereum serpent майнер bitcoin bitcoin elena trezor bitcoin ethereum стоимость playstation bitcoin ethereum pools bitcoin waves store bitcoin сатоши bitcoin bitcoin hunter bitfenix bitcoin покупка ethereum bitcoin регистрация обменник ethereum bitcoin автоматически half bitcoin bitcoin заработок *****uminer monero bitcoin uk удвоитель bitcoin
bitcoin анимация ico cryptocurrency bitcoin evolution
сложность monero bitcoin php bitcoin nodes bitcoin scripting ethereum markets usdt tether bitcoin получить bitcoin 1000 bitcoin trezor bitcoin mainer bitcoin взлом bitcoin инвестиции bitcoin bitcointalk bitcoin community bitcoin masternode ethereum видеокарты криптокошельки ethereum poloniex monero ethereum com bitmakler ethereum bitcoin magazine bitcoin hyip bitcoin instant bitcoin hype bitcoin аналоги tether gps bittorrent bitcoin monero fr bitcoin forum ethereum network компиляция bitcoin bitcoin bitcointalk reverse tether bitcoin roll bitcoin free bitcoin de bitcoin bat bitcoin change ethereum история монета ethereum форекс bitcoin bitcoin amazon bitcoin адреса captcha bitcoin ethereum платформа кран bitcoin delphi bitcoin bitcoin golden bitcoin обучение monero blockchain bitcoin double british bitcoin
bitcoin monkey bitcoin выиграть bitcoin 2016 bitcoin scan boom bitcoin bitcoin магазины проекта ethereum bitcoin мошенничество zcash bitcoin panda bitcoin ethereum майнить market bitcoin download bitcoin bitcoin gif purchase bitcoin картинка bitcoin This prohibitive hardware requirement is one of the biggest security measures that deter people from trying to manipulate the bitcoin system.strategy bitcoin bitcoin game ads bitcoin bitcoin 4096 bitcoin футболка bitcoin office blocks bitcoin
pull bitcoin polkadot store bitcoin foundation bitcoin blockchain bitcoin кошельки bitcoin converter pos bitcoin monero simplewallet roulette bitcoin rx580 monero tether gps monero новости neo cryptocurrency play bitcoin bitcoin рбк avatrade bitcoin bitcoin department bitcoin monkey bitcoin biz bitcoin work planet bitcoin