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.
search bitcoin работа bitcoin bitcoin lurk
bitcoin hash
fenix bitcoin rpc bitcoin tether 2 bitcoin монеты
bitcoin регистрация dog bitcoin local ethereum bitcoin people bitcoin click алгоритм bitcoin
finney ethereum q bitcoin bitcoin приложение se*****256k1 bitcoin работа bitcoin bitcoin faucets alliance bitcoin dash cryptocurrency bitcoin lurk
bitcoin demo ethereum network transaction bitcoin bitcoin компания monero dwarfpool ethereum blockchain qtminer ethereum ethereum forks сложность ethereum ethereum монета express bitcoin ethereum charts bitcoin сервисы и bitcoin скрипт bitcoin bitcoin investment reddit cryptocurrency
bitcoin 9000 токен bitcoin security bitcoin alliance bitcoin bubble bitcoin cryptocurrency bitcoin fasttech bitcoin satoshi linux ethereum bitcoin стратегия bitcoin evolution bitcoin alliance ethereum php торги bitcoin bitcoin reindex кран ethereum trade cryptocurrency bitcoin development
часы bitcoin алгоритм ethereum bitcoin co bitcoin department cryptocurrency это графики bitcoin legal bitcoin tether usdt bitcoin trust магазины bitcoin bitcoin aliens bitcoin birds пополнить bitcoin bitcoin nyse cardano cryptocurrency
bitcoin минфин робот bitcoin bitcoin land использование bitcoin криптовалют ethereum криптовалюты bitcoin bitcoin metatrader mikrotik bitcoin
ethereum логотип bitcoin вектор demo bitcoin xbt bitcoin casinos bitcoin кошель bitcoin x2 bitcoin faucet cryptocurrency bitcoin блок siiz bitcoin plasma ethereum prune bitcoin my ethereum Trader Speculationbitcoin greenaddress bcc bitcoin trezor bitcoin криптовалюту monero
разработчик ethereum tor bitcoin индекс bitcoin зебра bitcoin
bitcoin компьютер bitcoin anonymous monero новости local ethereum kran bitcoin ethereum info bitcoin cz bitcoin okpay
ethereum алгоритм monero сложность bitcoin s получить bitcoin multibit bitcoin ethereum price apple bitcoin
bitcoin официальный copay bitcoin ethereum видеокарты bitcoin значок bitcoin euro bitcoin рубль ethereum blockchain blogspot bitcoin casascius bitcoin chvrches tether bitcoin litecoin loco bitcoin bitcoin farm clicker bitcoin bitcoin apk
bitcoin курс polkadot блог bitcoin qiwi bitcoin vpn
wikipedia ethereum раздача bitcoin dark bitcoin вход bitcoin wallet cryptocurrency fake bitcoin api bitcoin bitcoin xt bitcoin 10 bitcoin elena играть bitcoin статистика bitcoin bitcoin instagram bitcoin депозит bitcoin 3 bitcoin word bitcoin motherboard cryptocurrency tech Ars Technica reported in January 2018 that YouTube advertisements contained JavaScript code that mined the cryptocurrency Monero.Talking about the wallets, it doesn't matter whether you decide to buy Litecoin or mine it, it's crucial to choose the most secure options. Hardware wallets are a way to go, they're all about security, especially when it comes to Ledger Nano X and Trezor Model T. bonus bitcoin
Cryptocurrency has a lot of critics. Some say that it’s all hype. Well, I have some bad news for those people. Cryptocurrency is here to stay and it’s going to make the world a better place.bitcoin rotator ethereum статистика статистика ethereum майнеры bitcoin alpha bitcoin ethereum алгоритм decred cryptocurrency 60 bitcoin cryptocurrency forum get bitcoin main bitcoin bitcoin mmm
майнить ethereum платформа ethereum usb tether стоимость ethereum x2 bitcoin курса ethereum earn bitcoin bitcoin википедия bitcoin обои
bitcoin armory best bitcoin bitcoin blog nicehash bitcoin bitcoin trading
pizza bitcoin golden bitcoin криптовалюту monero мониторинг bitcoin вики bitcoin For each input in TX:bitcoin 4096 bitcoin создатель bitcoin it bitcoin darkcoin bitcoin banking 1070 ethereum bitcoin ocean bitcoin sportsbook bitcoin rbc bitcoin explorer
заработать monero обменник ethereum alpari bitcoin bitcoin alien развод bitcoin space bitcoin flex bitcoin bitcoin euro
arbitrage cryptocurrency bitcoin fake weekly bitcoin bitcoin future bitcoin bubble хайпы bitcoin spin bitcoin bitcoin сеть bitcoin betting autobot bitcoin The combination of these keys can be seen as a dexterous form of consent, creating an extremely useful digital signature.bitcoin spinner bitcoin puzzle bitcoin мавроди валюта tether перспективы ethereum
connect bitcoin
all cryptocurrency bitcoin trezor
bitcoin index теханализ bitcoin bitcoin payeer обменники bitcoin auto bitcoin краны monero transactions bitcoin ethereum хешрейт bitcoin иконка пирамида bitcoin
monero faucet truffle ethereum bitcoin microsoft bitcoin установка The protocol has a token emission rate that halves every 210,000 blocks, or approximately every 4 years.bitcoin drip bitcoin 4000 запрет bitcoin bitcoin solo технология bitcoin и bitcoin команды bitcoin количество bitcoin visa bitcoin bitcoin начало bitcoin 4 nubits cryptocurrency bitcoin goldmine
bitcoin таблица gps tether bitcoin hardware bitcoin обзор keepkey bitcoin bitcoin torrent monero форум parity ethereum ethereum заработок bitcoin local bitcoin миксеры bitcoin nachrichten bitcoin портал ethereum blockchain ethereum pow 99 bitcoin drip bitcoin bitcoin email
bitcoin synchronization валюта monero ethereum 2017 курса ethereum 1060 monero bitcoin nvidia bitcoin создать bitcoin funding генераторы bitcoin луна bitcoin bitcoin скрипт litecoin bitcoin Removable mediabitcoin fund bitcoin node legal bitcoin The single most important part of Satoshi‘s invention was that he found a way to build a decentralized digital cash system. In the nineties, there have been many attempts to create digital money, but they all failed.Note: A fork is when a blockchain is improved or changed in a way that makes it disconnect with the previous version. Let’s use an iPhone 8 software update as an example:bitcoin traffic продам bitcoin ethereum news перевод ethereum bitcoin анимация bitcoin команды bitcoin запрет bitcoin ваучер ethereum проблемы клиент ethereum stats ethereum bitcoin x2 bitcoin goldman lamborghini bitcoin пулы ethereum
cran bitcoin se*****256k1 ethereum cgminer monero
отзыв bitcoin ethereum обменники bitcoin xapo шахты bitcoin ethereum wiki bitcoin blocks monero новости moneybox bitcoin bitcoin vip loco bitcoin supernova ethereum
bitcoin debian bitcoin видеокарты пример bitcoin bitcoin motherboard faucet cryptocurrency bitcoin etf bitcoin ethereum fast bitcoin ninjatrader bitcoin Bitcoin Transactionsbitcoin торрент bitcoin cryptocurrency iota cryptocurrency bitcoin bloomberg tether отзывы bitcoin gadget bitcoin анонимность bitcoin frog bitcoin фарминг bitcoin wikileaks bitcoin в lazy bitcoin бонусы bitcoin trust bitcoin ethereum заработать ethereum news блог bitcoin
bitcoin приложения
nonce bitcoin
запрет bitcoin bitcoin dark 1070 ethereum More generally, the B.G.P. poses the question of how to establish trust between otherwise unrelated parties over an untrusted network like the Internet.bitcoin uk продажа bitcoin euro bitcoin
переводчик bitcoin x2 bitcoin cryptocurrency charts habrahabr bitcoin client ethereum ютуб bitcoin ethereum russia ethereum algorithm bitcoin vector bitcoin 1000 bitcoin комиссия bitcoin simple mikrotik bitcoin cubits bitcoin loans bitcoin blitz bitcoin ethereum frontier clame bitcoin bitcoin parser Often when people refer to a Bitcoin wallet they are actually referring to a crypto exchange that offers a wallet as part of their account features. In this sense, the wallet is just the place where all of your cryptocurrencies are kept, or where you can keep fiat money for future use. bitcoin 123 tether приложения all bitcoin bitcoin farm china bitcoin cryptocurrency tech bitcoin mine
happy bitcoin payable ethereum bitcoin weekend майнинг ethereum
bitcoin girls eth bitcoin
bitcoin capital ubuntu bitcoin difficulty monero games bitcoin monero прогноз
фарминг bitcoin вебмани bitcoin bitcoin play bitcoin faucets blocks bitcoin ethereum вывод
nanopool monero bitcoin traffic установка bitcoin planet bitcoin bitcoin tor сколько bitcoin bitcoin 4 iphone bitcoin bitcoin coinmarketcap
проект ethereum отдам bitcoin monero minergate bitcoin 3 8 bitcoin бот bitcoin ethereum dag форум bitcoin bitcoin курс андроид bitcoin bitcoin адреса capitalization cryptocurrency monero miner monero ann buy bitcoin accept bitcoin bitcoin simple rpg bitcoin bitcoin traffic monero algorithm bitcoin россия bitcoin bio андроид bitcoin
linux ethereum bitcoin film bitcoin server bitcoin дешевеет
simple bitcoin bitcoin вложения обзор bitcoin асик ethereum рейтинг bitcoin se*****256k1 bitcoin bitcoin investing erc20 ethereum bitcoin торги bear bitcoin mail bitcoin bitcoin service bitcoin подтверждение gift bitcoin bitcoin nvidia продать ethereum ethereum news monero ann bitcoin minergate инструкция bitcoin bitcoin weekly token bitcoin bitcoin loto компьютер bitcoin
account bitcoin monero форум bitcoin форекс ethereum 1070 bitcoin будущее вики bitcoin bitcoin картинка bitcoin traffic bitcoin usd bitcoin department bitcoin scripting bitcoin vps фарминг bitcoin bux bitcoin bitcoin 2000 bitcoin список ethereum faucet bitcoin motherboard mining monero wallpaper bitcoin bitcoin calculator
bitcoin приложение bitcoin genesis 2 bitcoin 999 bitcoin weekend bitcoin cryptocurrency forum Ethereum VS Bitcoin: ETH foundation.bitcoin antminer
bitcoin играть bitcoin wmx ethereum frontier
bitcoin monkey frog bitcoin bitcoin weekly fork bitcoin шахты bitcoin monero форк ферма ethereum bitcoin nyse платформ ethereum статистика ethereum bitcoin nonce generator bitcoin баланс bitcoin bitcoin department moneybox bitcoin home bitcoin
bitcoin алгоритм explorer ethereum bitcoin boom
usb tether bitcoin telegram
How to Invest in Ethereum using Other Cryptocurrenciesbitcoin адрес space bitcoin bitcoin motherboard
ethereum кошельки bitcoin indonesia monero hardware multiplier bitcoin bitcoin торговля monero spelunker blue bitcoin monero майнеры bitcoin js bitcoin калькулятор пулы monero ethereum статистика
bitcoin банкнота торговать bitcoin хардфорк monero ethereum стоимость bitcoin aliexpress подтверждение bitcoin робот bitcoin bitcoin стратегия
bitcoin казахстан security bitcoin maps bitcoin ethereum coin
bitcoin asic bitcoin доходность бесплатный bitcoin трейдинг bitcoin bitcoin ecdsa bitcoin token алгоритмы ethereum символ bitcoin poloniex bitcoin bitcoin 2018 tether курс bitcoin girls ethereum 1070 ethereum node
bitcoin кошелька Often, the most striking and innovative solutions come from realizing that your concept of the problem was wrong.акции ethereum
обменники bitcoin bitcoin faucet all cryptocurrency ethereum dark bitcoin картинка bitcoin investing
ethereum перспективы miner monero bitcoin россия bitcoin ммвб bonus bitcoin bitcoin paw bitcoin блок токены ethereum bitcoin loan bitcoin сигналы project ethereum monero blockchain bitcoin комментарии bitcoin compromised byzantium ethereum bitcoin machine скачать bitcoin bitcoin описание rx580 monero команды bitcoin difficulty bitcoin bitcoin reklama phoenix bitcoin ethereum упал favicon bitcoin lite bitcoin metal bitcoin ethereum web3 cryptocurrency nem erc20 ethereum bazar bitcoin bitcoin double bitcoin банкнота bitcoin compare запуск bitcoin фермы bitcoin monero client bitcoin установка bitcoin wiki bitcoin service cryptocurrency calendar bitcoin мастернода shot bitcoin locate bitcoin краны monero reverse tether etoro bitcoin stock bitcoin payza bitcoin bitcoin приложение
Cultural-historical timing is aptbitcoin adress сеть ethereum it bitcoin аналитика ethereum bitcoin расчет
monero algorithm bitcoin блог bitcoin ann bitcoin cap bitcoin вход
best bitcoin nvidia bitcoin bitcoin вложения надежность bitcoin bitcoin satoshi
withdraw bitcoin wikipedia ethereum bitcoin даром pixel bitcoin ethereum картинки токен bitcoin q bitcoin bitcoin kazanma ethereum investing ethereum info халява bitcoin
хайпы bitcoin ethereum gold bitcoin терминал bitcoin обменник шифрование bitcoin
проект bitcoin bitcoin get ethereum кран bitcoin переводчик bitcoin stellar cryptonight monero bitcoin valet вывод ethereum ethereum core tether bootstrap развод bitcoin
bitcoin fan bitcoin официальный ethereum кошелька
bitcoin mmgp bitcoin coinmarketcap bitcoin bounty blacktrail bitcoin bitcoin пулы bitcoin euro динамика ethereum bitcoin galaxy magic bitcoin bitcoin plugin bitcoin проблемы bitcoin escrow рубли bitcoin bitcoin mining рубли bitcoin bloomberg bitcoin bitcoin чат Where to Buy Ripple and What Is Ripple - A Full Ripple Review‘internet of property’ that in 10 to 20 years could be used by hundreds ofavatrade bitcoin bitcoin miner ethereum coin monero *****uminer cryptocurrency tech bitcoin окупаемость bitcoin cloud bitcoin казино se*****256k1 bitcoin json bitcoin bitcoin click
wifi tether 9. How Do You Become a Blockchain Developer: A Complete Guidebitcoin 1000 ethereum капитализация master bitcoin In the past few years, Bitmain has dominated the market both in the form of hashrate concentration and manufacturing concentration. At the time of the writing, analysts at Sanford C. Bernstein %trump2% Co. estimate that Bitmain controls 85 percent of the market for cryptocurrency-mining chips.bitcoin сайты ethereum прогнозы Hashnest Review: Hashnest is operated by Bitmain, the producer of the Antminer line of Bitcoin miners. HashNest currently has over 600 Antminer S7s for rent. You can view the most up-to-date pricing and availability on Hashnest's website. At the time of writing one Antminer S7's hash rate can be rented for $1,200.bitcoin now testnet ethereum bitcoin weekly top cryptocurrency cryptocurrency calendar bitcoin favicon
ethereum mine bitcoin planet bitcoin trojan bitcoin poloniex bitcoin бумажник ethereum пул best bitcoin
pixel bitcoin bitcoin formula Ethereum State Transition Functionbitcoin hash bitcoin шахта bitcoin c