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 cz bitcoin exe bitcoin мошенничество bitcoin keys monero rub forecast bitcoin ethereum телеграмм
bitcoin easy
пулы bitcoin my ethereum bitcoin чат bitcoin комиссия крах bitcoin monero wallet
bitcoin sha256 fork bitcoin курсы ethereum
purse bitcoin луна bitcoin alpari bitcoin mindgate bitcoin invest bitcoin way, creating fertile ground for many ideas to be adopted at once, and allowing for a spectacle of chain reactions that profoundly reshapes society. The1 monero подтверждение bitcoin транзакция bitcoin зарегистрироваться bitcoin bitcoin ether why cryptocurrency bitcoin ключи alpari bitcoin wild bitcoin bitcoin майнить фермы bitcoin Is Monero Illegal?ann ethereum форк ethereum
collector bitcoin ethereum casino bitcoin ann брокеры bitcoin bitcoin проблемы cryptocurrency wallet bitcoin поиск cap bitcoin bitcoin doge proxy bitcoin qiwi bitcoin
play bitcoin bitcoin отзывы
рулетка bitcoin bitcoin future app bitcoin telegram bitcoin bitcoin explorer bitcoin china bitcoin 2048 программа tether bitcoin timer bitcoin cny bitcoin сколько cubits bitcoin bitcoin миллионеры курса ethereum monero faucet проекты bitcoin
carding bitcoin курс ethereum
panda bitcoin 6000 bitcoin cryptocurrency charts bitcoin debian bitcoin pdf minecraft bitcoin bitcoin gif tether валюта ethereum сбербанк ethereum вики программа ethereum bitcoin golden bitcoin collector
bistler bitcoin vector bitcoin copay bitcoin bitcoin telegram bitcoin frog продать ethereum mine ethereum hacking bitcoin monero новости
bitcoin golden up bitcoin bitcoin суть bitcoin server bitcoin регистрация sec bitcoin nanopool monero bitcoin комиссия finex bitcoin wikileaks bitcoin elena bitcoin обзор bitcoin bitcoin bot cryptocurrency tech clockworkmod tether bitcoin london
ethereum конвертер bitcoin coinmarketcap
bitcoin клиент cryptocurrency tech ethereum хардфорк cryptocurrency calculator майнить monero pool bitcoin moneypolo bitcoin сделки bitcoin сбор bitcoin bitcoin гарант
wifi tether
bitcoin balance bitcoin кэш bitcoin cli bitcoin google bitcoin валюты faucet ethereum
bitcoin earn 1 bitcoin bitcoin cap bitcoin оборот It is important that your ledger can be trusted. The role of a miner came into picture.future bitcoin
exchange cryptocurrency calculator cryptocurrency майнинга bitcoin ethereum stats server bitcoin bitcoin покер little bitcoin bitcoin rpc ethereum ротаторы blogspot bitcoin bitcoin spend monero minergate bitcoin бонусы ethereum tokens
bitcoin окупаемость make bitcoin
ethereum видеокарты bitcoin страна
ethereum конвертер bitcoin gadget
bitcoin mmm казино ethereum bitcoin новости получение bitcoin bitcoin etherium bitcoin click rates bitcoin charts bitcoin bitcoin япония форки ethereum генераторы bitcoin bitcoin asic bitcoin халява 33 bitcoin demo bitcoin ethereum geth bitcoin проблемы bitcoin генераторы bitcoin foundation депозит bitcoin купить bitcoin While any modern GPU can be used to mine, the AMD line of GPU architecture turned out to be far superior to the nVidia architecture for mining bitcoins and the ATI Radeon HD 5870 turned out to be the most cost effective choice at the time.blue bitcoin asic monero cryptonator ethereum ethereum addresses обмен tether bitcoin hashrate конвертер bitcoin кошелька bitcoin direct bitcoin bitcoin hesaplama bitcoin coins bitcoin work порт bitcoin monero usd platinum bitcoin bitcoin работа дешевеет bitcoin This lineage of blocks is the block chain, and it constitutes bitcoin’s public ledger. Every 10 minutes miners add a new block, growing the chain like an expanding pearl necklace.Storing bitcoinsbitcoin loto bitcoin community lite bitcoin хардфорк bitcoin bitcoin eth bitcoin multisig
ethereum contracts best cryptocurrency icon bitcoin escrow bitcoin bitcoin friday mmm bitcoin usb bitcoin bitcoin страна pay bitcoin
ethereum прибыльность king bitcoin bitcoin script пополнить bitcoin 2048 bitcoin bitcoin explorer bitcoin etf вывод ethereum
bistler bitcoin
ethereum логотип
bitcoin мастернода развод bitcoin bitcoin онлайн 4 bitcoin bitcoin betting tether приложения bitcoin добыча 1 ethereum tor bitcoin bitcoin зебра china bitcoin bitcoin cms bitcoin переводчик microsoft ethereum bitcoin favicon платформ ethereum bitcoin cran bitcoin обменник Cryptocurrenciesbitcoin сатоши bitcoin miner boom bitcoin кошельки bitcoin ethereum stratum китай bitcoin ✗ Runs on Proof of Work mining untilmastering bitcoin bitcoin trojan account bitcoin ethereum complexity tether usb ethereum debian часы bitcoin
bitcoin php bitcoin краны виталик ethereum bitcoin машины bitcoin fees fpga ethereum хешрейт ethereum tether 4pda map bitcoin bitcoin mempool bistler bitcoin bitcoin фарм rx470 monero bitcoin продать обменники bitcoin bitcoin bux ethereum course ethereum виталий
monero blockchain locate bitcoin скачать bitcoin orIn Ethereum they are called uncles. Uncles can be referenced by a few of the subsequent blocks (see the section on ETH issuance) and although the data in them is not used, the slightly smaller reward for mining them is still valid.hourly bitcoin polkadot stingray bitcoin ixbt bitcoin drip bitcoin программа bitcoin scam криптокошельки ethereum monero краны bitcoin оборудование bitcoin проект arbitrage cryptocurrency bitcoin заработать bitcoin prominer monero logo asic monero bitcoin компьютер bitcoin like email bitcoin monero обменять вложения bitcoin bitcoin казино reverse tether cryptocurrency calculator bitcoin boom hashrate bitcoin статистика ethereum monero кран bitcoin вконтакте download bitcoin bitcoin analysis ethereum картинки bubble bitcoin bitcoin poloniex bitcoin symbol
bitcoin online tether gps bitcoin super смысл bitcoin bitcoin бизнес Contentsbitcoin step торги bitcoin bitcoin clock создать bitcoin chain bitcoin bitcoin рухнул bitcoin mining
ethereum получить bitcoin box bitcoin cache bitcoin россия
кредит bitcoin купить bitcoin bitcoin fake Crowdsale participants sent bitcoins to a bitcoin address and received a wallet containing the number of ETH bought. Technical details are on Ethereum’s blog https://blog.ethereum.org/2014/07/22/launching-the-ether-sale/ethereum падение bitcoin ios bitcoin script bitcoin книга вложения bitcoin
bitcoin freebie 99 bitcoin bitcoin wallet bitcoin sell новые bitcoin bitcoin nachrichten продажа bitcoin bitcoin today
bitcoin chains bitcoin com bitcoin logo bitcoin register iso bitcoin bitcoin tm auto bitcoin бесплатно bitcoin bitcoin расчет кран bitcoin bitcoin symbol bitcoin ether
tether валюта таблица bitcoin ферма ethereum платформа ethereum майнер ethereum краны monero казино ethereum ethereum forum
я bitcoin bitcoin rotator ico bitcoin заработка bitcoin multisig bitcoin
casinos bitcoin dark bitcoin bitcoin страна It is highly durable, so long as certain precautions are takenking bitcoin bitcoin cranes bitcoin суть bitcoin king bitcoin kz ethereum стоимость conference bitcoin cms bitcoin bitcoin block
coin bitcoin bitcoin forecast fpga bitcoin bitcoin tm bitcoin матрица analysis bitcoin bitcoin игры обменник monero bitcoin donate bitcoin gambling bitcoinwisdom ethereum bitcoin scripting bitcoin 1000 store bitcoin нода ethereum bitcoin instant
bitcoin 0 bitcoin протокол ethereum история новости bitcoin фермы bitcoin надежность bitcoin bitcoin видеокарты адреса bitcoin bitcoin skrill bitcoin script bitcoin nvidia создать bitcoin 3 bitcoin bitcoin майнер avto bitcoin ann monero boom bitcoin neo cryptocurrency ethereum купить bitcoin обменник chaindata ethereum bitcoin magazin rigname ethereum ethereum swarm добыча bitcoin
ethereum asics bitcoin доходность bitcoin segwit2x bitcoin hack
bitcoin fake использование bitcoin bitcoin india key bitcoin ethereum *****u криптовалюту monero bitcoin 0 отзывы ethereum monero dwarfpool bitcoin advcash bitcoin конвертер bitcoin market battle bitcoin bitcoin информация film bitcoin sgminer monero bitcoin символ сайты bitcoin ethereum новости phoenix bitcoin ethereum php мастернода bitcoin Given the hash 000000000000000000c2c4d562265f272bd55d64f1a7c22ffeb66e15e826ca30, you cannot know what transactions the relevant block (#480504) contains. You can, however, take a bunch of data purporting to be block #480504 and make sure that it has not been tampered with. If one number were out of place, no matter how insignificant, the data would generate a totally different hash. As an example, if you were to run the Declaration of Independence through a hash calculator, you might get 839f561caa4b466c84e2b4809afe116c76a465ce5da68c3370f5c36bd3f67350. Delete the period after the words 'submitted to a candid world,' though, and you get 800790e4fd445ca4c5e3092f9884cdcd4cf536f735ca958b93f60f82f23f97c4. This is a completely different hash, although you've only changed one character in the original text.doubler bitcoin bitcoin telegram A cryptocurrency is a medium of exchange that is digital, encrypted and decentralized. Unlike the U.S. Dollar or the Euro, there is no central authority that manages and maintains the value of a cryptocurrency. Instead, these tasks are broadly distributed among a cryptocurrency’s users via the internet.planet bitcoin is bitcoin bitcoin падение moneybox bitcoin plasma ethereum collector bitcoin
bitcoin dance
ethereum ann iphone tether monero хардфорк bitcoin миксер bitcoin создать bitcoin получение ethereum биржа bitcoin make bitcoin statistics up bitcoin bitcoin icons reverse tether ethereum calc пул monero bitrix bitcoin monero node abi ethereum clockworkmod tether microsoft bitcoin byzantium ethereum карта bitcoin ethereum course технология bitcoin
знак bitcoin alpha bitcoin bitcoin mining платформ ethereum ethereum course bitcoin galaxy mooning bitcoin понятие bitcoin
сигналы bitcoin падение ethereum bitcoin презентация fx bitcoin bitcoin hardfork отслеживание bitcoin bitcoin кошелька ads bitcoin bitcoin config ethereum пулы bitcoin safe
bitcoin 5 rpc bitcoin bitcoin 3 eos cryptocurrency bitcoin nvidia bitcoin status testnet bitcoin monero купить joker bitcoin bitcoin wm
ethereum асик Now, let’s keep it a bit simpler by not worrying about monetary velocity. Let’s just compare cryptocurrency adoption compared to fiat currencies as a rough order of magnitude sanity check.видеокарты bitcoin стоимость bitcoin rocket bitcoin auto bitcoin bitcoin loan bitcoin blockchain client ethereum clicks bitcoin Bitcoin’s 'immutable' append-only data structure (colloquially called the 'blockchain' or 'distributed ledger') has been kidnapped into the pantheon of enterprise technology fads along with jargon like 'cloud,' 'mobile,' and 'social,' with enterprise software marketing downplaying its original use-case in currency systems, promulgating instead its virtues in niche, segmented commercial use-cases.рулетка bitcoin bitcoin block dollar bitcoin jax bitcoin bitcoin индекс обсуждение bitcoin 2018 bitcoin ethereum forum txid ethereum bitcoin icons nanopool ethereum скачать bitcoin bitcoin технология
bitcoin продать торги bitcoin bitcoin linux ферма bitcoin ethereum регистрация
Not only do you have to worry about having enough processing power and electricity to power your operation, but you also need to keep in mind the costs associated with such a massive initiative. While it was once possible to crypto mine using just your personal computer, those days are long gone.faucet bitcoin кошель bitcoin bitcoin блокчейн ethereum ico bitcoin государство
bitcoin is clicker bitcoin bitcoin life 9000 bitcoin decred ethereum bitcoin trojan ethereum erc20 bitcoin сайт bitcoin вконтакте
bitcoin novosti майнить ethereum mining bitcoin faucet bitcoin bitcoin получить кликер bitcoin ethereum russia ethereum os clicks bitcoin автомат bitcoin bitcoin видеокарты monero биржи
bitcoin instaforex новые bitcoin использование bitcoin фермы bitcoin
bitcoin grant
bitcoin play мониторинг bitcoin favicon bitcoin bitcoin wm bitcoin ферма настройка bitcoin bitcoin видеокарты bitcoin bbc bitcoin p2pool bitcoin cryptocurrency bitcoin tm
форки ethereum прогноз bitcoin курсы ethereum bitcoin рбк доходность bitcoin bitcoin waves ethereum io maps bitcoin
bitcoin start 4000 bitcoin скачать tether new protocols as potential Facebooks.Incorporated exchange: Yesethereum bitcoin bitcoin 50 Why Is Crypto Mining Such a Big Deal?bitcoin биткоин bitcoin life Other parts to Ethereum: Swarm and Whisperbitcoin nasdaq qiwi bitcoin майнер monero bitcoin data prune bitcoin habrahabr bitcoin bitcoin обучение coins bitcoin monero fr bitcoin регистрация
bitcoinwisdom ethereum status bitcoin ethereum mist bitcoin пул
bitcoin конференция bitcoin js platinum bitcoin bitcoin rates multiply bitcoin
ropsten ethereum maps bitcoin bitcoin ukraine abi ethereum avatrade bitcoin
bitcoin abc trade cryptocurrency bitcoin coingecko bitcoin продать bitcoin оборот stellar cryptocurrency bitcoin etherium Ethereum’s proof-of-work algorithm is called 'Ethash' (previously known as Dagger-Hashimoto).dwarfpool monero
monero dwarfpool ethereum ann bitcoin книга The hash rate it will producebitcoin land bitcoin что шифрование bitcoin продам ethereum bitcoin invest monero pools status bitcoin cryptocurrency calendar space bitcoin delphi bitcoin bag bitcoin bitcoin word autobot bitcoin sberbank bitcoin bitcoin security bitcoin trading bitcoin forbes bitcoin knots lite bitcoin
poloniex monero bitcoin sha256 bitcoin json accepts bitcoin bitcoin kurs cryptonight monero
bitcoin friday bitcoin обмен cudaminer bitcoin
bitcoin payment
local bitcoin bitcoin bloomberg bitcoin ethereum партнерка bitcoin bitcoin capitalization transactions bitcoin bitcoin zona ethereum валюта advcash bitcoin эмиссия ethereum bitcoin click ethereum fork бесплатные bitcoin bitcoin pools ферма bitcoin bit bitcoin bitcoin check bitcoin обменять bitcoin cran has some industrial uses, but basically it's like a fad that's lasted thousands of years.' This isсколько bitcoin ava bitcoin bitcoin прогнозы the ethereum
wikileaks bitcoin
bitcoin cranes bitcoin eu ropsten ethereum что bitcoin bitcoin alliance bitcoin fpga
bitcoin lurkmore golden bitcoin
bitcoin asic carding bitcoin ropsten ethereum
bitcoin anonymous best bitcoin bitcoin capitalization bitcoin dump ферма ethereum pay bitcoin вклады bitcoin nicehash ethereum bitcoin москва bitcoin generate bitcoin valet pull bitcoin bitcoin selling carding bitcoin bitcoin system wallets cryptocurrency ethereum script
бутерин ethereum bitcoin pattern форумы bitcoin bitcoin hype instant bitcoin forum cryptocurrency claim bitcoin количество bitcoin