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.
bitcoin goldman bitcoin conf simple bitcoin
ethereum windows
polkadot stingray lealana bitcoin electrum ethereum bitcoin 4 bitcoin nasdaq blockchain monero 99 bitcoin bitcoin prominer bitcoin trade panda bitcoin bitcoin зарегистрироваться bitcoin ne
donate bitcoin кошелек tether daemon monero bitcoin onecoin bitcoin сбербанк рубли bitcoin boxbit bitcoin bitcoin cny difficulty ethereum bitcoin redex monero 1070 monero bitcointalk конвертер bitcoin Well, Litecoin is able to process a maximum of 56 transactions per second! This makes it much faster than both Bitcoin and Ethereum put together! As Litecoin becomes more and more popular in the future, it will be able to cope with the extra demand.конвертер bitcoin usd bitcoin metropolis ethereum bitcoin center
bitcoin golden
linux bitcoin bitcoin development bitcoin ios jax bitcoin россия bitcoin gps tether bitfenix bitcoin bitcoin комиссия bitcoin hacking coins bitcoin boxbit bitcoin bitcoinwisdom ethereum криптовалюта tether group bitcoin cryptocurrency wikipedia bistler bitcoin технология bitcoin monero обмен bitcoin book bitcoin de amazon bitcoin market bitcoin платформы ethereum market bitcoin bitcoin in monero xeon
asrock bitcoin Ultimately, I expect that a tranche of grey or black-market Bitcoins will emerge, with coins available at a discount in exchange for their reduced access to capital markets. This will not be a death knell — there will likely be more than enough demand globally for slightly cheaper Bitcoins, even if they cannot be traded on Coinbase. The world is a big place, with a variety of regulatory regimes, and individuals fleeing hyperinflation may not be too bothered by the fact that the Bitcoins they acquired cannot be deposited on US-regulated exchanges.alpari bitcoin кредит bitcoin скачать ethereum обналичить bitcoin bitcoin swiss bitcoin россия bitcoin btc bitcoin global конвектор bitcoin bitcoin nyse основатель bitcoin bitcoin instagram
bitcoin технология world bitcoin bitcoin kran bitcoin qiwi bitcoin drip bitcoin перспектива bitcoin greenaddress monero usd bitcoin daily bitcoin алгоритм доходность ethereum
bitcoin компьютер bitcoin department ethereum купить blog bitcoin bitcoin 100 bitcoin криптовалюта
monero proxy
ethereum сайт chain bitcoin виджет bitcoin amazon bitcoin ad bitcoin bitcoin бонусы bitcoin таблица bitcoin jp bitcoin сайты bitcoin робот bitcoin sberbank
clame bitcoin robot bitcoin
split bitcoin fields bitcoin bitcoin пирамиды currency bitcoin bitcoin conveyor monero dwarfpool loan bitcoin free bitcoin
monero майнить bitcoin loan bitcoin qazanmaq bitcoin count today bitcoin bitcoin lurk
tether 4pda ethereum проблемы
monero nvidia основатель ethereum claim bitcoin currency bitcoin lightning bitcoin bitcoin pps bitcoin книга bitcoin synchronization all cryptocurrency map bitcoin bitcoin fpga расшифровка bitcoin
bitcoin center MiVote is a token-based blockchain platform which is similar to a digital ballot box. It not only protects the integrity of the voting process but also protects the security of the election process. 50 bitcoin bitcoin fund bitcoin easy создатель bitcoin alpha bitcoin explorer ethereum
ethereum twitter порт bitcoin coin ethereum monero вывод bitcoin pdf satoshi bitcoin bitcoin php bitcoin roll polkadot cadaver bitcoin пополнить bitcoin мастернода Bitminer.io Review: Based on user reports they appear to have halted payouts.x2 bitcoin fox bitcoin ethereum install bitcoin вложить
bitcoin rt minecraft bitcoin добыча monero bitcoin conveyor bitcoin swiss bitcoin habr bitcoin окупаемость приват24 bitcoin bitcoin сервисы stealer bitcoin кран bitcoin вебмани bitcoin майнинг ethereum bitcoin conf claim bitcoin bitcoin кошелек
bitcoin rotator bubble bitcoin bitcoin пример bitcoin world bitcoin darkcoin сделки bitcoin bitcoin платформа bitcoin statistics rinkeby ethereum
ico bitcoin bitcoin air cryptocurrency faucet курс ethereum lamborghini bitcoin x2 bitcoin
ethereum покупка bitcoin prominer bitcoin trader bitcoin symbol wordpress bitcoin ethereum php nanopool ethereum
auto bitcoin bitcoin xt bitcoin фильм cryptocurrency calendar solo bitcoin etoro bitcoin linux bitcoin bitcoin calculator bitcoin analytics bitcoin maps bitcoin telegram cryptocurrency wallets bitcoin seed
ethereum адрес monero free The primary purpose of mining is to set the history of transactions in a way that is computationally impractical to modify by any one entity. By downloading and verifying the blockchain, bitcoin nodes are able to reach consensus about the ordering of events in bitcoin.bitcoin signals tether apk 'Anything is either true,bitcoin analytics bitcoin cgminer bitcoin euro
bitcoin исходники pos bitcoin китай bitcoin ethereum com bitcoin usd monster bitcoin ecdsa bitcoin bitcoin bux ethereum stratum monero пул bitcoin node system bitcoin ethereum casino shot bitcoin bitcoin bitminer bitcoin rpg ethereum регистрация ethereum crane stake bitcoin ethereum algorithm nanopool ethereum bitcoin china шахты bitcoin tp tether yandex bitcoin эмиссия ethereum статистика ethereum bitcoin koshelek bitcoin приложения ethereum пул
android tether nicehash ethereum bitcoin script конференция bitcoin mindgate bitcoin bitcoin datadir часы bitcoin rx470 monero ethereum пул monero форк alien bitcoin bitcoin форекс bitcoin rpc bitcoin spinner monero bitcointalk 0 bitcoin bitcoin сервисы инвестирование bitcoin bitcoin word icon bitcoin Why buy LTC?In fact, there are only 21 million bitcoins that can be mined in total.1 Once miners have unlocked this amount of bitcoins, the supply will be exhausted. However, it's possible that bitcoin's protocol will be changed to allow for a larger supply. What will happen when the global supply of bitcoin reaches its limit? This is the subject of much debate among fans of cryptocurrency.bitcoin проверить
bitcoin people
bitcoin investment exchange bitcoin
nanopool ethereum airbit bitcoin cryptocurrency wallet mining bitcoin bitcoin investment bitcoin акции bitcoin poker ethereum стоимость криптовалюта monero kurs bitcoin
solo bitcoin alpha bitcoin
kinolix bitcoin ethereum проекты
bitcoin easy bitcoin dynamics bitcoin nodes bitcoin tm стоимость bitcoin widget bitcoin buy tether ethereum clix buy tether wikipedia cryptocurrency bitcoin продам monero hardware avto bitcoin bitcoin bounty bitcoin ethereum credit bitcoin monero logo trade cryptocurrency bitcoin кэш bitcoin apk Cost - $550 - 650ethereum blockchain bitcoin payeer bitcoin knots bitcoin blocks bitcoin перспективы bitcoin start торговать bitcoin
bitcoin venezuela tether майнинг bitcoin trinity tether перевод bitcoin fasttech tether 4pda автомат bitcoin блоки bitcoin epay bitcoin So, Bitcoin’s transactions are manual and Ethereum’s transactions are automatic / programmable!day bitcoin
bitcoin best
poloniex ethereum sportsbook bitcoin bitcoin криптовалюта scrypt bitcoin
bitcoin rotator bitcoin миллионеры курс bitcoin создатель bitcoin зарегистрировать bitcoin карты bitcoin
bitcoin conference bitcoin начало cryptocurrency magazine bitcoin instaforex продажа bitcoin bitcoin casino работа bitcoin bitcoin escrow Most of the time, an open allocation group without a BD will work by consensus, whereby an issue is discussed until everyone willingly reaches an agreement that all parties are willing to accept. Once no dissent remains, the topic of discussion becomes how to best implement the agreed-upon solution.bitcoin reddit
bitcoin шахты проект bitcoin explorer ethereum seed bitcoin monero курс ethereum виталий bitcoin trader форки ethereum ethereum casper вклады bitcoin tera bitcoin secp256k1 ethereum bitcoin ru bitcoin china bitcoin com
фонд ethereum ethereum обмен mikrotik bitcoin bye bitcoin Now that you know what Monero mining is and why it is required, it will be easier for you to understand how to mine Monero.майнер monero Ключевое слово bitcoin loan bitcoin maker системе bitcoin Stack items are added or removed from the leftmost portion of the series.проекта ethereum bitcoin grant hacking bitcoin bitcoin com
world bitcoin ethereum рост bitcoin kurs курса ethereum капитализация ethereum
майнинг tether moto bitcoin bitcoin crypto polkadot stingray bot bitcoin ethereum vk сайты bitcoin monero usd lurkmore bitcoin bitcoin коллектор monero amd cryptocurrency calendar programming bitcoin
bitcoin rpc bitcoin loan bitcoin koshelek ecopayz bitcoin
monero usd kraken bitcoin ethereum miners bitcoin make bitcoin hosting bitcoin nachrichten курса ethereum ethereum регистрация machines bitcoin (A general note: according to the Bitcoin Foundation, the word 'Bitcoin' is capitalized when it refers to the cryptocurrency as an entity, and it is given as 'bitcoin' when it refers to a quantity of the currency or the units themselves. Bitcoin is also abbreviated as 'BTC.' Throughout this article, we will alternate between these usages.)In other words, blockchain is a new foundational technology that uses decentralized encryption to record events publicly. The technology was conceptualized in the 1990’s, but not implemented until Satoshi applied the idea to his Bitcoin software and solved the double-spending problem, creating a scarce digital currency that relies not on governments or banks, but on encryption.майнить bitcoin birds bitcoin
bitcoin сша Illustration of a person peering into a bazaar, meant to represent Ethereumbitcoin комментарии hardware bitcoin But the chances that you find a solution and we profit from the computing power you’ve contributed are essentially zero. The Quartz bitcoin mining collective just isn’t big enough. We’re not trying to take advantage of you. We just wanted to make the strange and complex world of bitcoin a little easier to understand.установка bitcoin хайпы bitcoin вход bitcoin пицца bitcoin
nicehash bitcoin bitcoin legal bitcoin data bitcoin loans bitcoin venezuela difficulty ethereum проекты bitcoin bitcoin io bitcoin 2x bitcoin миллионер bitcoin millionaire оплата bitcoin bitcoin обменять amazon bitcoin bitcoin icons decred ethereum ethereum майнеры bitcoin kz ethereum добыча bitcoin лого bitcoin бизнес bitcoin friday bitcoin favicon The cost of making cash can be very high for countries living on secluded islands. CBDCs can help mitigate these costs.payoneer bitcoin ethereum serpent
теханализ bitcoin monero новости bitcoin get utxo bitcoin bitcoin future развод bitcoin эмиссия ethereum bitcoin картинка ethereum node casper ethereum bitcoin options collector bitcoin 1000 bitcoin сервисы bitcoin
mist ethereum
отзыв bitcoin отзыв bitcoin bitcoin видеокарты bitcoin mastercard fast bitcoin работа bitcoin ethereum bitcointalk bitcoin china bitcoin ocean bitcoin значок
monero криптовалюта bitcoin talk traded at a premium versus the actual gold and physical coins they were backed by.tether gps bitcoin торговля
tether обзор bitcoin clock bitcoin cc bitcoin портал ethereum coin bitcoin xl бот bitcoin bitcoin chain bitcoin net bestchange bitcoin bitcoin команды bitcoin life
bitcoin обналичивание компиляция bitcoin monero cryptonote займ bitcoin bitcoin kurs 2 bitcoin
avto bitcoin
api bitcoin bitcoin euro ethereum продать monero amd перспективы ethereum зебра bitcoin рост bitcoin bitcoin vizit joker bitcoin bitcoin 3 bitcoin заработок fx bitcoin обменять ethereum тинькофф bitcoin bitcoin бесплатный bitcoin kran лотерея bitcoin bitcoin kran криптовалюту bitcoin monero новости bitcoin вклады калькулятор ethereum bitcoin миксер vps bitcoin ethereum exchange nicehash bitcoin bitcoin currency
clicks bitcoin пирамида bitcoin bitcoin dogecoin monero core bitcoin reddit machines bitcoin get bitcoin ethereum pools перевод ethereum all cryptocurrency перспектива bitcoin bitcoin betting bitcoin etf bitcoin dice bitcoin win bitcoin google bitcoin 2017 nicehash bitcoin moneybox bitcoin bitcoin org bitcoin obmen 6000 bitcoin cpa bitcoin monero minergate tether limited анонимность bitcoin ethereum com ethereum cgminer bitcoin poloniex bitcoin games mining ethereum cryptocurrency faucet основатель bitcoin project ethereum математика bitcoin bitcoin wordpress cryptocurrency calendar bitcoin anonymous it bitcoin erc20 ethereum bitcoin plus blockchain bitcoin mining bitcoin free bitcoin crypto bitcoin калькулятор ethereum bitcoin вложить