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 bitcoin direct bitcoin баланс ethereum block monero пул bitcoin rpc bitcoin habr
bitcoin создать
finney ethereum описание bitcoin bitcoin продать invest bitcoin flash bitcoin bitcoin обменять
roboforex bitcoin bitcoin trinity oil bitcoin
wallpaper bitcoin bitcoin delphi bitcoin автокран bitcoin xpub matrix bitcoin bitcoin получить atm bitcoin алгоритм monero bitcoin hosting майнеры monero верификация tether generation bitcoin деньги bitcoin bitcoin legal auction bitcoin китай bitcoin bitcoin таблица bitcoin 100 email bitcoin bitcoin kz
dao ethereum
bitcoin онлайн block bitcoin пицца bitcoin
coinmarketcap bitcoin депозит bitcoin xpub bitcoin joker bitcoin bitcoin миллионеры вклады bitcoin flypool ethereum
bitcoin gif bitcoin mmgp приложение bitcoin
bitcoin multiplier bitcoin pattern хабрахабр bitcoin рубли bitcoin
пример bitcoin bistler bitcoin bank bitcoin wm bitcoin tether валюта разделение ethereum lazy bitcoin bitcoin капитализация all cryptocurrency game bitcoin
casper ethereum хешрейт ethereum statistics bitcoin
monaco cryptocurrency bcc bitcoin ethereum erc20 bitcoin торговля CRYPTOhomestead ethereum
зарегистрироваться bitcoin bitcoin minecraft отдам bitcoin bubble bitcoin кошель bitcoin delphi bitcoin nicehash monero bitcoin скачать 100 bitcoin
pokerstars bitcoin cryptonight monero boxbit bitcoin monero новости bitcoin зарегистрироваться bitcoin пополнение bitcoin биржа bitcoin formula bitcoin markets instant bitcoin сервисы bitcoin теханализ bitcoin bitcoin banks bitcoin 15 cryptocurrency wallets асик ethereum
сколько bitcoin buy ethereum Given:яндекс bitcoin ocean bitcoin bitcoin bounty rus bitcoin bitcoin habr flypool monero monero 1070 bitcoin сети программа ethereum bitcoin опционы bitcoin обналичивание alien bitcoin
etf bitcoin сервисы bitcoin local bitcoin bitcoin world bitcoin advcash bitcoin evolution ethereum валюта direct bitcoin майнинг bitcoin And to think, that number is just for the people who are mining Bitcoin specifically!accepts bitcoin ethereum pool ethereum пулы bitcoin казахстан avto bitcoin 0 bitcoin bitcoin xpub source bitcoin пожертвование bitcoin сокращение bitcoin bitcoin algorithm bitcoin demo ethereum rotator использование bitcoin дешевеет bitcoin captcha bitcoin особенности ethereum ethereum pos динамика ethereum
bitcoin прогноз water bitcoin bitcoin count bitcoin dice
ethereum стоимость bitcoin майнер bitcoin x2 search bitcoin создатель bitcoin system bitcoin отзывы ethereum
стоимость ethereum satoshi bitcoin tradingview bitcoin bitcoin bitcoin song ethereum бесплатно bitcoin weekend bitcoin коллектор bitcoin ebay bitcoin zone ethereum вики bitcoin escrow clockworkmod tether ethereum телеграмм
bootstrap tether bitcoin landing bitcoin деньги local ethereum обмен ethereum bitcoin atm bitcoin eu удвоитель bitcoin q bitcoin
bitcoin etherium bitcoin луна
monero miner bitcoin exchange goldmine bitcoin bitcoin dance bitcoin расчет ethereum метрополис bitcoin 2017
…It has been decided that anyone who feels like it will announce a time, and whatever time is heard first will be the official attack time. The problem is that the network is not instantaneous, and if two generals announce different attack times at close to the same time, some may hear one first and others hear the other first.bitcoin trezor
bitcoin развод bitcoin surf it bitcoin генераторы bitcoin bitcoin haqida ethereum алгоритмы cryptocurrency gold
bitcoin scripting bitcoin step bitcoin автокран bitcoin hashrate bitcoin казахстан bitcoin io No fun! If you like building your own Bitcoin hashing systems.ethereum видеокарты
статистика ethereum monero free bitcoin classic tradingview bitcoin dag ethereum
The primary role of mining is to ensure that all participants have a consistent view of the Bitcoin ledger. Because there is no central database, the log of all transactions rely on the computational power miners contribute to the network to be immutable and secure.bitcoin q blacktrail bitcoin bitcoin usb While both the Bitcoin and Ethereum networks are powered by the principle of distributed ledgers and cryptography, the two differ technically in many ways. For example, transactions on the Ethereum network may contain executable code, while data affixed to Bitcoin network transactions are generally only for keeping notes. Other differences include block time (an ether transaction is confirmed in seconds compared to minutes for bitcoin) and the algorithms that they run on (Ethereum uses ethash while Bitcoin uses SHA-256). wallet cryptocurrency delphi bitcoin bitcoin client bitcoin x2 bitcoin etf расчет bitcoin суть bitcoin bitcoin hyip coinmarketcap bitcoin bitcoin поиск ethereum siacoin bitcoin multiply bitcoin easy cryptocurrency forum ethereum api bitcoin trojan nonce bitcoin bitcoin hacker bitcoin ann продам bitcoin
monero cryptonote config bitcoin easy bitcoin
monero xeon de bitcoin bitcoin shop coindesk bitcoin форк bitcoin bitcoin путин шрифт bitcoin monero coin bitcoin inside
настройка ethereum invest bitcoin bitcoin talk box bitcoin
bitcoin сбербанк описание bitcoin torrent bitcoin ethereum faucet bitcoin платформа bitcoin кошелька greenaddress bitcoin bitcoin хайпы simple bitcoin linux bitcoin aml bitcoin ethereum testnet monero майнинг будущее ethereum сервисы bitcoin bitcoin proxy blogspot bitcoin bitcoin rotator block bitcoin ethereum complexity bitcoin example bot bitcoin
bitcoin games bitcoin best web3 ethereum bitcoin arbitrage 4pda tether удвоитель bitcoin ● 2013: From -$13 (Jan 2013) to -$266 (Apr 2013) to -$65 (Jul 2013)bitcoin mastercard bitcoin ne
bitcoin aliens cryptocurrency reddit konverter bitcoin bitcoin carding bitcoin tm
сколько bitcoin all bitcoin cpuminer monero metropolis ethereum bio bitcoin видеокарта bitcoin mastering bitcoin
bitcoin official bitcoin conference
алгоритм monero live bitcoin bitcoin открыть monero fr платформы ethereum trezor ethereum raspberry bitcoin bitcoin monero life bitcoin ethereum 4pda
bitcoin отследить зарегистрироваться bitcoin bitcoin исходники bitcoin брокеры As an economic system, the rules for ether’s economy are a bit open-ended. While bitcoin has a hard cap of 21 million bitcoins, ether does not have a similar limit.bitcoin windows bitcoin easy кран bitcoin кран bitcoin bitcoin heist bitcoin развод accepts bitcoin HUMAN MISMANAGEMENT: ONLINE EXCHANGESethereum casper
bitcoin traffic bitcoin окупаемость сеть ethereum описание ethereum bitcoin algorithm bitcoin exe падение bitcoin bitcoin страна tether майнинг 3 bitcoin bitcoin капитализация чат bitcoin map bitcoin us bitcoin bitcoin пополнить математика bitcoin cryptocurrency capitalisation auto bitcoin bitcoin generate bitcoin uk сервисы bitcoin bitcoin 4 bitcoin iq bitcoin poloniex equihash bitcoin динамика ethereum monero usd bitcoin multiplier bitcoin таблица ethereum block bitcointalk monero registration bitcoin avto bitcoin nova bitcoin fpga ethereum мастернода bitcoin bitcoin 2018 bitcoin metatrader
разработчик bitcoin
fields bitcoin bitcoin bbc space bitcoin mempool bitcoin flash bitcoin вложения bitcoin bitcoin phoenix monero dwarfpool bitcoin location bitcoin legal alliance bitcoin nicehash bitcoin
etf bitcoin my ethereum bitcoin markets ethereum claymore value bitcoin bitcoin видеокарты bitcoin pay bitcoin generate кости bitcoin bitcoin games фарм bitcoin neo bitcoin расшифровка bitcoin monero биржа бесплатный bitcoin bitcoin poloniex bitcoin сбербанк bitcoin бесплатные cryptocurrency top bitcoin joker bitcoin apple bitcoin block block ethereum bitcointalk ethereum ethereum статистика
monero poloniex bitcoin maps satoshi bitcoin логотип bitcoin preev bitcoin bitcoin работа In order to discover which allocation strategy works best for your individualstore bitcoin bitcoin security bitcoin пул redex bitcoin bitcoin loan биржа monero wikipedia bitcoin ethereum хешрейт bitcoin com bitcoin часы Switching to Bitcoin, which charges no or very low fees, for these remittance payments will therefore raise the quality of life of migrant workers and their families significantly. In fact, it is hard to think of any one thing that would have a faster and more positive effect on so many people in the world’s poorest countries.Image for posttether addon конференция bitcoin bitcoin 2048 шрифт bitcoin
виталий ethereum
bitcoin boom rpg bitcoin key bitcoin monero bitcointalk bitcoin tor bitcoin сеть bitcoin аккаунт bitcoin payoneer ethereum виталий bitcoin virus биржа ethereum p2pool ethereum запуск bitcoin bitcoin bcn 6000 bitcoin bitcoin скрипт bitcoin стоимость биржа bitcoin nonce: a count of the number of transactions sent by the sender.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 bitcoin center tether coinmarketcap bitcoin кошелька bitcoin crash bitcoin mt4 bitcoin biz the ethereum ethereum windows
куплю ethereum bitcoin cudaminer калькулятор monero
cryptonator ethereum bitcoin рейтинг bitcoin mmgp лучшие bitcoin gui monero sberbank bitcoin ethereum api bitcoin бумажник ethereum transactions россия bitcoin bitcoin лохотрон tether gps ethereum transactions cpp ethereum
bitcoin продам bitcoin protocol txid bitcoin bitcoin биткоин x2 bitcoin займ bitcoin nanopool monero серфинг bitcoin партнерка bitcoin новости monero
casinos bitcoin clicks bitcoin difficulty monero cryptocurrency trading bitcoin donate monero free bitcoin подтверждение bitcoin daemon bitcoin fpga monero кошелек finney ethereum bitcoin account ethereum addresses приват24 bitcoin
1 ethereum ethereum addresses
bitcoin blockchain bitcoin card
rigname ethereum
ethereum график bitcoin buying bitcoin кошелек laundering bitcoin bitcoin hyip monero dwarfpool bitcoin войти
airbitclub bitcoin ethereum stats ethereum faucets подтверждение bitcoin explorer ethereum bitcoin satoshi tether ico bitcoin alert micro bitcoin bitcoin genesis
flappy bitcoin bitcoin withdraw bitcoin работа ethereum torrent rocket bitcoin форумы bitcoin earn bitcoin monero cryptonote ethereum os bitcoin token bitcoin symbol ethereum blockchain ico ethereum rpg bitcoin
bitcoin grant p2p bitcoin bitcoin лохотрон mindgate bitcoin monero pro bitcoin робот accelerator bitcoin bitcoin игры пополнить bitcoin
bitcoin adress bitcoin virus supernova ethereum bitcoin investment konverter bitcoin monero биржи
arbitrage cryptocurrency bitcoin 10000 bitcoin advcash bitcoin currency local bitcoin antminer bitcoin A bitcoin transaction takes anywhere from a few minutes to a couple days to process, depending on the traffic in the network as well as the fee attached to that transaction.Anyone can run a node—you just download the free bitcoin software. The drawback is that it consumes energy and storage space – the network at time of writing takes hundreds of gigabytes of data. Nodes spread bitcoin transactions around the network. One node will send information to a few nodes that it knows, who will relay the information to nodes that they know, etc. That way, the pending transaction ends up getting around the whole network pretty quickly.транзакции bitcoin
bitcoin википедия bitcoin кости pools bitcoin bitcoin microsoft scrypt bitcoin фьючерсы bitcoin monero client bitcoin адрес
обналичить bitcoin nicehash ethereum bitcoin antminer
bitcoin nachrichten options bitcoin ethereum форум
настройка bitcoin tether addon github ethereum bitcoin xpub monero стоимость bitcoin sign
bitcoin rpc lootool bitcoin bitcoin подтверждение рубли bitcoin bitcoin safe bitcoin вики
cryptocurrency arbitrage bitcoin cap bitcoin торрент bitcoin rpc xpub bitcoin перевод tether кошелек ethereum bitcoin phoenix c bitcoin реклама bitcoin bitcoin swiss bitcoin книга rpg bitcoin обменники bitcoin bitcoin xyz segwit2x bitcoin bitcoin bit datadir bitcoin ethereum конвертер boom bitcoin bitcoin captcha habrahabr bitcoin
ethereum mining habrahabr bitcoin
polkadot cadaver
работа bitcoin rise cryptocurrency ethereum debian bitcoin доходность bitcoin xpub bitcoin journal bitcoin talk
bitcoin surf ethereum эфириум coinmarketcap bitcoin пример bitcoin bitcoin bubble etherium bitcoin ethereum forum reward bitcoin ethereum supernova пулы monero
simple bitcoin keepkey bitcoin проблемы bitcoin earning bitcoin
карты bitcoin accepts bitcoin nonce bitcoin ethereum логотип cryptocurrency bitcoin monero cryptonote bitcoin кредиты abi ethereum бот bitcoin
транзакции monero bitcoin сокращение
bitcoin school bitcoin crash bitcoin торги bitcoin today сбербанк bitcoin
график bitcoin зарегистрироваться bitcoin bitcoin tm
capitalization bitcoin bitcoin развитие bitcoin payeer bitcoin global
bitcoin казахстан bitcoin терминал bitcoin орг ethereum addresses bitcoin advcash bitcoin doubler bitcoin avto bitcoin доходность bitcoin generate bitcoin xt bitcoin conference bitcoin bow системе bitcoin 33 bitcoin биржа monero bitcoin elena bitcoin plus новые bitcoin bitcoin игры ethereum calc cryptocurrency mining
bitcoin кошелек bitcoin get bitcoin co monero simplewallet bitcoin markets bitcoin 5 криптовалюта ethereum bitcoin пожертвование алгоритм ethereum ethereum продать neteller bitcoin bitcoin зарабатывать monero 1070 price bitcoin
buy tether asics bitcoin ethereum обмен bitcoin nodes casinos bitcoin nicehash bitcoin
пополнить bitcoin monero coin bitcoin форум cryptocurrency tech bitcoin бизнес king bitcoin monster bitcoin bitcoin journal bitcoin iphone logo bitcoin карты bitcoin bitcoin перевод
bitcoin indonesia bitcoin выиграть micro bitcoin bitcoin расчет bitcoin mmgp nicehash monero компания bitcoin bitcoin main bitcoin phoenix использование bitcoin bitcoin news monero криптовалюта bitcoin пополнить bitcoin transaction bitcoin аналитика bitcoin s faucet bitcoin bitcoin school карты bitcoin
рулетка bitcoin bitcoin reserve bitcoin unlimited monero криптовалюта инструмент bitcoin
bitcoin bloomberg ethereum android форум bitcoin отследить bitcoin адрес bitcoin bitcoin cny bitcoin central ethereum проблемы bitcoin cz metatrader bitcoin wei ethereum bitcoin hash fpga ethereum
bitcoin analysis platinum bitcoin tether wallet monero rur iso bitcoin ethereum icon cryptocurrency calendar Exchangesbitcoin investment grayscale bitcoin ethereum decred bitcoin loan bitcoin trading 50 bitcoin paidbooks bitcoin инвестиции bitcoin instant bitcoin bitcoin options адрес bitcoin bitcoin fast 2048 bitcoin bitcoin купить ethereum покупка daemon monero bitcoin tm bitcoin crane ava bitcoin tether курс терминал bitcoin курс bitcoin 22 bitcoin настройка bitcoin спекуляция bitcoin ads bitcoin bitcoin neteller кран bitcoin
claymore monero
ethereum клиент ethereum цена ubuntu bitcoin q bitcoin nonce bitcoin my ethereum
token ethereum bitcoin transaction 2016 bitcoin bitcoin generator математика bitcoin maps bitcoin bitcoin 20 bitcoin balance bitcoin mail british bitcoin airbitclub bitcoin bitcoin easy bitcoin exchanges график monero
bitcoin masters зарегистрироваться bitcoin bitcoin автоматически loco bitcoin decred cryptocurrency tinkoff bitcoin 1070 ethereum Cons of Using a P2P Exchange:tether 2 abi ethereum отзывы ethereum make bitcoin bitcoin multiplier Blockchain also has potential applications far beyond bitcoin and cryptocurrency.bitcoin minecraft скачать tether миксер bitcoin r bitcoin bitcoin крах reddit ethereum Many experts see blockchain technology as having serious potential for uses like online voting and crowdfunding, and major financial institutions such as JPMorgan Chase (JPM) see the potential to lower transaction costs by streamlining payment processing.4 However, because cryptocurrencies are virtual and are not stored on a central database, a digital cryptocurrency balance can be wiped out by the loss or destruction of a hard drive if a backup copy of the private key does not exist. At the same time, there is no central authority, government, or corporation that has access to your funds or your personal information.Summary