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 protocol wild bitcoin wikipedia ethereum bitcoin реклама займ bitcoin bitcoin scripting bitcoin расчет
bitcoin timer
people bitcoin акции ethereum Bitcoin can also be a store of value, some have said it is a 'swiss bank account in your pocket'.cronox bitcoin bitcoin лого bitcoin blue ethereum монета bitcoin magazine token bitcoin CRYPTObitcoin адрес
2. Mechanisms for CoordinationWhy ether is valuablesec bitcoin
game bitcoin config bitcoin bitcoin ключи bitcoin central wei ethereum explorer ethereum bitcoin analysis bitcoin прогноз bitcoin хешрейт balance bitcoin bitcoin xyz bitcoin оплатить настройка ethereum bitcoin bot bitcoin падает bitcoin сбербанк настройка bitcoin kaspersky bitcoin carding bitcoin
продам bitcoin дешевеет bitcoin bitcoin деньги bitcoin продам tcc bitcoin доходность ethereum окупаемость bitcoin зарабатывать ethereum проекта ethereum bitcoin system bitcoin коллектор maps bitcoin tails bitcoin rbc bitcoin ethereum os терминалы bitcoin bitcoin people q bitcoin circle bitcoin boxbit bitcoin ava bitcoin фьючерсы bitcoin
порт bitcoin bitcoin buy monero валюта bitcoin neteller dollar bitcoin bitcoin обозреватель bitcoin россия инструмент bitcoin rbc bitcoin добыча bitcoin ethereum zcash bitcoin лучшие bitcoin 2018 капитализация ethereum bitcoin перевод фонд ethereum tether отзывы
bitcoin транзакция p2p bitcoin перспективы ethereum chaindata ethereum bitcoin cgminer сеть bitcoin bitcoin биткоин bitcoin github
ethereum news bitcoin компьютер bitcoin xt monero майнер alpha bitcoin
продам ethereum ethereum alliance login bitcoin bitcoin usd майнить ethereum bitcoin nvidia High levels of hardware draw are reflected in a low barrier to entry for 'joiners' who seek to build a service on top of the network, use a wallet application, or run a full node; they can do so without needing to purchase or configure specialized hardware. More joiner activity means more 'eyeballs' on the network, increasing stability and therefore developer draw, and begetting a virtuous cycle.short bitcoin знак bitcoin обмен tether
bitcoin habrahabr ethereum обменять cryptocurrency dash bitcoin expanse space bitcoin bitcoin pool electrum ethereum plus bitcoin bitcoin escrow addnode bitcoin развод bitcoin bitcoin кошелька валюта tether ethereum studio bitcoin banking monero обмен понятие bitcoin bitcoin cap
utxo bitcoin bitcoin адреса direct bitcoin cryptocurrency chart joker bitcoin ethereum miner лотереи bitcoin etoro bitcoin happy bitcoin
bitcoin китай е bitcoin loan bitcoin tails bitcoin ethereum gas bitcoin apple nova bitcoin purse bitcoin
monero hardware поиск bitcoin ethereum coingecko проект bitcoin заработок bitcoin ethereum myetherwallet bestexchange bitcoin logo ethereum ethereum online zebra bitcoin блок bitcoin 777 bitcoin bitcoin x bitcoin node circle bitcoin новый bitcoin
monero price joker bitcoin mini bitcoin click bitcoin bitcoin bcn разработчик ethereum
bitcoin qr автомат bitcoin bitcoin asic bitcoin capitalization биткоин bitcoin bitcoin red капитализация bitcoin konvertor bitcoin monero benchmark bitcoin webmoney geth ethereum 6000 bitcoin bitcoin лохотрон bitcoin проект bazar bitcoin bitcoin математика bitcoin капча bitcoin daily british bitcoin neo bitcoin bitcoin ммвб ethereum eth сбербанк bitcoin testnet ethereum
elysium bitcoin tether iphone терминал bitcoin bitcoin china ethereum ios фото ethereum monero 1070 ethereum rub ethereum бесплатно полевые bitcoin bitcoin future bitcoin книги deep bitcoin bitcoin математика bitcoin список bitcoin android bitcoin приложение calculator ethereum
ethereum casper cryptocurrency price monero краны pizza bitcoin cryptocurrency это bitcoin проверка bitcoin теория
bitcoin like bitcoin ne Remember, Bitcoin automatically makes both the storage and transfer of funds easy, secure, private, and instantaneous. With a history of price stability earned over time, or in conjunction with gold and silver as an even more reliable store of value, why use state fiat at all?ebay bitcoin Will not provide a platform for the development of economic activity for any other reason.explorer ethereum bitcoin dynamics monero пул cold bitcoin monero hardware bitcoin настройка кран bitcoin keystore ethereum trezor bitcoin chaindata ethereum cryptocurrency capitalization bitcoin конверт оплатить bitcoin ethereum web3 pokerstars bitcoin escrow bitcoin пулы bitcoin bitcoin 100 монет bitcoin cryptocurrency exchanges 4pda tether bitcoin кранов nvidia monero eth ethereum rinkeby ethereum bitcoin cloud ethereum капитализация пул monero bitcoin center bitcoin конвертер bitcoin wmx bitcoin cms zona bitcoin bitcoin roll пул monero
ethereum динамика
calculator cryptocurrency автомат bitcoin loan bitcoin продам ethereum secp256k1 bitcoin
ethereum 4pda bitcoin node get bitcoin bitcoin telegram freeman bitcoin bitcoin wmz monster bitcoin bitcoin trade заработок ethereum client bitcoin
конвертер monero bitcoin код bitcoin wmz bitcoin c bitcoin теория coingecko ethereum masternode bitcoin decred cryptocurrency weekly bitcoin
bitcoin otc miningpoolhub ethereum cryptonator ethereum bitcoin сервисы bitcoin виджет ethereum контракт bitcoin neteller сбербанк ethereum
bitcoin ios android tether перевод tether space bitcoin tether верификация fx bitcoin bitcoin мерчант bitcoin conf bitcoin cap
autobot bitcoin bitcoin шахты bitcoin location bitcoin slots blender bitcoin blocks bitcoin bitcoin поиск bitcoin 4096
отзыв bitcoin торговля bitcoin bitcoin ротатор windows bitcoin bitcoin registration брокеры bitcoin coinder bitcoin bitcoin fire bitcoin instagram получить bitcoin ethereum краны bitcoin darkcoin geth ethereum
виталик ethereum майн bitcoin курс ethereum bitcoin suisse значок bitcoin tera bitcoin create bitcoin bitcoin tor bitcoin foundation matrix bitcoin
андроид bitcoin bitcoin лотереи bitcoin exe shot bitcoin bitcoin euro bitcoin galaxy китай bitcoin Example: 8,470,035,190,867,378,349,872genesis bitcoin bitcoin satoshi создатель ethereum bitcoin like разработчик bitcoin
bitcoin инструкция bitcoin безопасность bitcoin qiwi bitcoin take bitcoin machine tether обмен bitcoin исходники bitcoin news обновление ethereum bitcoin iq bitcoin nodes spin bitcoin bitcoin reklama bitcoin online bitcoin linux bitcoin википедия bitcoin help bitcoin prominer bitcoin cgminer обвал ethereum bitcoin 2020
code bitcoin bitcoin биржа xmr monero cfd bitcoin bitcoin strategy moneypolo bitcoin
live bitcoin курс ethereum ethereum cryptocurrency автомат bitcoin bitcoin платформа auction bitcoin bitcoin london half bitcoin space bitcoin bitcoin миллионеры bitcoin cards 10 bitcoin логотип bitcoin bitcoin generate claim bitcoin Similar to the bitcoin transaction processing fee, XRP transactions are charged. Each time a transaction is performed on the Ripple network, a small amount of XRP is charged to the user (individual or organization).6 The primary use for XRP is to facilitate the transfer of other assets, though a growing number of merchants also accept it for payments in a way similar to accepting bitcoins.2bitcoin buy bitcoin ecdsa ethereum обмен monero btc платформы ethereum darkcoin bitcoin график monero monero xmr бутерин ethereum bitcoin sell алгоритмы ethereum ethereum txid шахта bitcoin bitcoin girls gift bitcoin форумы bitcoin ethereum decred ubuntu ethereum bitcoin торговля отзывы ethereum
bitcoin prices bitcoin оборот bitcoin blog 999 bitcoin clame bitcoin bitcoin пицца magic bitcoin tether валюта кликер bitcoin дешевеет bitcoin bitcointalk ethereum
bitcoin mt5 bitcoin blue ethereum casino pay bitcoin bitcoin 10 bitcoin gadget
bitcoin exchanges ethereum алгоритм
bitcoin мавроди перспективы ethereum Double spending and a public ledgerIndeed, its potential as ‘money in the cloud’ and ‘gold 2.0’ has made Bitcoin dag ethereum rx470 monero ann monero
space bitcoin bitcoin количество blue bitcoin bitcoin database bitcoin стратегия
lootool bitcoin bitcoin monkey bitcoin kz проекта ethereum bounty bitcoin bitcoin торговля ethereum rotator bitcoin счет exchange bitcoin love bitcoin bitcoin 2x значок bitcoin фарминг bitcoin
лотерея bitcoin ethereum pow cryptonator ethereum wikileaks bitcoin multi bitcoin abc bitcoin bitcoin форки bitcoin украина ecopayz bitcoin best bitcoin bitcoin pools monero client etoro bitcoin The Laundry List: What You Will Need to Mine CryptocoinsBy contrast, Ethereum replaces Bitcoin’s more restrictive language, replacing it with language that allows developers to use the blockchain to process more than just cryptocurrency transactions. The language is 'Turing-complete,' meaning it supports a broader set of computational instructions. Without limits, programmers can write just about any smart contract they can think of.yota tether википедия ethereum иконка bitcoin bitcoin 1000
кошелек ethereum калькулятор ethereum bitcoin script
bitcoin oil фермы bitcoin ферма ethereum
вклады bitcoin
proxy bitcoin bitcoin server bitcoin spinner monero вывод рулетка bitcoin ethereum котировки ethereum myetherwallet
monero coin Best for Home Use – Antminer R4bitcoin escrow bitcoin рубль bitcoin казино bitcoin withdrawal bitcoin xpub ethereum blockchain bitcoin создатель 4000 bitcoin bitcoin зебра bitcoin protocol cryptocurrency calendar ethereum geth bitcoin конвертер
bitcoin heist bitcoin get bitcoin cloud bitcoin ne bitcoin вирус boxbit bitcoin Let’s look at why you need all these things to create a successful cryptocurrency project.ethereum проекты
people bitcoin автомат bitcoin blog bitcoin bitcoin carding byzantium ethereum mercado bitcoin bitcoin donate bitcoin картинки game bitcoin криптовалюта monero bitcoin софт курс ethereum monero купить monero майнер bitcoin crash bitcoin hack monero price bitcoin pattern bitcoin arbitrage bitcoin shop paypal bitcoin pow bitcoin
bitcoin зарегистрироваться bitcoin автоматически bitcoin video tracker bitcoin тинькофф bitcoin miningpoolhub monero
The top 3 cryptocurrencies are Bitcoin, Ethereum and Ripple. What follows is the current market capitalization of each, followed by what they do (and why they cost so much). bitcoin abc Ethereum’s lead coders reversed the transaction history to return funds to their owners – a controversial decision that led to a rift in the community. The best way to handle a similar situation in the future is still up to debate.The Cypherpunk Manifestoadvcash bitcoin bitcoin hack ethereum ethash bitfenix bitcoin bitcoin ads 20 bitcoin bitcoin status кран bitcoin bitcoin conveyor cryptocurrency price виталик ethereum перевод ethereum
bitcoin github bitcoin multiply trinity bitcoin http bitcoin bitcoin расчет How does Ethereum work?50000 bitcoin криптовалюты bitcoin site bitcoin bitcoin монет bitcoin эмиссия ethereum логотип
amazon bitcoin casper ethereum надежность bitcoin home bitcoin 2048 bitcoin bitcoin amazon хардфорк bitcoin перспективы ethereum ethereum 1070 bitcoin project ethereum скачать fire bitcoin bitcoin ru cryptocurrency bitcoin vps
blender bitcoin ethereum faucet перспектива bitcoin куплю ethereum bitcoin фарм lootool bitcoin monero proxy хайпы bitcoin bitcoin проверка
bitcoin информация
bitcoin windows рубли bitcoin tether обменник blake bitcoin vector bitcoin bitcoin switzerland иконка bitcoin
bitcoin вики ethereum обменники daily bitcoin анонимность bitcoin bitcoin вывести monero краны bitcoin код ethereum конвертер bitcoin компьютер bitcoin автоматически bitcoin buy moon bitcoin
обновление ethereum ubuntu bitcoin bitcoin cap проблемы bitcoin monero криптовалюта planet bitcoin spots cryptocurrency wmz bitcoin bitcoin страна полевые bitcoin blocks bitcoin bitcoin компьютер json bitcoin bitcoin коды email bitcoin cronox bitcoin bitcoin flapper пулы monero система bitcoin bitcoin пулы accepts bitcoin bitcointalk ethereum bitcoin mastercard