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.
fork bitcoin
bitcoin capital
bitcoin qr bitcoin china bitcoin project exchange ethereum bitcoin ваучер ethereum vk купить monero bitcoin loan anomayzer bitcoin bitcoin бесплатные сбор bitcoin bitcoin strategy bitcoin логотип bitcoin отзывы is bitcoin production cryptocurrency bitcoin капча bazar bitcoin billionaire bitcoin покупка ethereum bitcoin reddit blocks bitcoin bitcoin эмиссия keystore ethereum bitcoin fork bitcoin s bitcoin zone bitcoin future tether ico
bitcoin 2016 seed bitcoin bitcoin bitminer instaforex bitcoin up bitcoin community bitcoin community bitcoin cryptocurrency magazine planet bitcoin
bitcoin rpg monero новости взломать bitcoin bitcoin blockstream
bitcoin payment bitcoin favicon bio bitcoin nem cryptocurrency monero обменять 6000 bitcoin сколько bitcoin bitcoin fork doge bitcoin bitcoin captcha bitcoin dance дешевеет bitcoin
hosting bitcoin datadir bitcoin миллионер bitcoin блог bitcoin bitcoin лохотрон ethereum coingecko иконка bitcoin download tether clicks bitcoin прогноз bitcoin It’s the way cryptocurrency networks like Bitcoin verify and confirm new transactions. It stops double spending without the need to trust centralized accounting as banks do. Cryptocurrency blockchains aren’t secured by trust or people. They are secured by math done by computers!Resources: BIP16, BIP30, and BIP34 were implemented as changes which might have lead to soft forks. BIP50 describes both an accidental hard fork, resolved by temporary downgrading the capabilities of upgraded nodes, and an intentional hard fork when the temporary downgrade was removed. A document from Gavin Andresen outlines how future rule changes may be implemented.bitcoin кошелька bitcoin novosti поиск bitcoin bitcoin вложения bitcoin майнер homestead ethereum сети bitcoin ethereum сайт bitcoin удвоитель акции bitcoin bitcoin миллионеры кошелек tether bitcoin fields ethereum пулы
bitcoin автомат ethereum кран bitcoin гарант bitcoin hesaplama bitcoin community wmz bitcoin metatrader bitcoin биржа bitcoin bitcoin обсуждение ethereum форум qtminer ethereum bitcoin win валюта bitcoin ethereum vk bitcoin script tor bitcoin bitcoin коллектор ninjatrader bitcoin asus bitcoin карты bitcoin ethereum кошельки хардфорк bitcoin надежность bitcoin arbitrage cryptocurrency bitcoin demo разработчик bitcoin
billionaire bitcoin инвестиции bitcoin bitcoin express bitcoin коллектор bitcoin pps тинькофф bitcoin wallets cryptocurrency koshelek bitcoin flappy bitcoin parity ethereum london bitcoin bitcoin основатель electrodynamic tether zebra bitcoin bitcoin 2017 bitcoin froggy bitcoin 1000 раздача bitcoin sgminer monero cryptocurrency dash mikrotik bitcoin теханализ bitcoin bitcoin pos bitcoin project bitcoin рбк ethereum dao get bitcoin адрес bitcoin transactions bitcoin Blockchain ExplainedTrust %trump2% Transparencybitcoin maps окупаемость bitcoin Bitcoin is a new monetary asset that is climbing an adoption curve. Although it is not yet abitcoin auto bitcoin habrahabr tether yota ethereum forum обменник bitcoin андроид bitcoin monero news bitcoin dance
tether provisioning bitcoin red chvrches tether kurs bitcoin se*****256k1 ethereum monero gui bitcoin лохотрон kinolix bitcoin bitcoin com nicehash bitcoin форумы bitcoin best cryptocurrency bitcoin daemon
bitcoin динамика стоимость bitcoin bitcoin hd ethereum org cubits bitcoin rbc bitcoin будущее ethereum прогноз bitcoin bitcoin datadir payoneer bitcoin компиляция bitcoin bitcoin charts bitcoin официальный iota cryptocurrency bank bitcoin ethereum валюта Ключевое слово bitcoin galaxy Owing to Bitcoin’s 10-year head start and brilliant contributor base, its development will out-pace all but a few exceptionally competent projects. The few projects which survive will do so by innovating on top Bitcoin’s incentive model to speed development velocity without introducing technical debt, 'catching up' with Bitcoin in functionality and network security.bitcoin лохотрон bitcoin valet se*****256k1 ethereum халява bitcoin зарабатывать bitcoin monero пул bitcoin gold bitcoin price bitcoin технология сигналы bitcoin
bitcoin краны капитализация bitcoin bitcoin apple ethereum cgminer bitcoin symbol bitcoin mac bitcoin php ферма ethereum bitcoin knots покупка ethereum bitcoin sec
bitcoin прогноз обмен monero bitcoin торги bitcoin zona зарегистрироваться bitcoin bitcoin flapper
bitcoin рубль уязвимости bitcoin redex bitcoin bitcoin php 1 ethereum bitcoin loto monero вывод
bitcoin автоматический logo bitcoin love bitcoin кран ethereum bitcoin weekly monero algorithm bitcoin haqida ethereum metropolis bitcoin страна asics bitcoin q bitcoin
ads bitcoin monero пулы новые bitcoin bitcoin описание карты bitcoin dog bitcoin bitcoin icons ethereum parity bitcoin биржи ico bitcoin bitcoin телефон ropsten ethereum ethereum clix
bitcoin capitalization ethereum cryptocurrency шахты bitcoin количество bitcoin cran bitcoin
ethereum стоимость rx470 monero blogspot bitcoin программа tether
bitcoin plus bitcoin hesaplama bitcoin bitcoin лохотрон bitcoin instant maining bitcoin
talk bitcoin
the ethereum
token ethereum
bitcoin япония bitcoin информация testnet bitcoin сервера bitcoin platinum bitcoin настройка monero surf bitcoin сети ethereum ethereum видеокарты bitcoin инструкция bitcoin dogecoin bitcoin media
ютуб bitcoin bitcoin value bitcoin торги 1 monero bio bitcoin обновление ethereum ethereum habrahabr asrock bitcoin bounty bitcoin bitcoin оборот ethereum сегодня trade cryptocurrency In early 2020, I revisited Bitcoin and became bullish. I recommended it as a small position in my premium research service on April 12th, and bought some bitcoins for myself on April 20th. The price was around $6,900 for that stretch of time. Since that period in April, Bitcoin quickly shot up to the $9,000+ range with 30%+ returns, but its price is highly volatile, so those gains may or may not be durable.demo bitcoin bitcoin деньги
bitcoin 2018 frog bitcoin us bitcoin wei ethereum ethereum акции bitcoin комбайн
up bitcoin bitcoin брокеры bitcoin biz bitcoin покупка bitcoin favicon ethereum mist cryptocurrency tech tether wallet
bitcoin co video bitcoin взломать bitcoin monero nicehash bitcoin froggy pool bitcoin delphi bitcoin bitcoin artikel coinmarketcap bitcoin bitcoin ukraine
форум bitcoin trade cryptocurrency The resulting hashes themselves are each paired with one other hash and hashed together. Any hash without a partner is hashed with itself. The process repeats until only one hash remains, the merkle root.As discussed in the Simplified Payment Verification (SPV) subsection, the merkle tree allows clients to verify for themselves that a transaction was included in a block by obtaining the merkle root from a block header and a list of the intermediate hashes from a full peer. The full peer does not need to be trusted: it is expensive to fake block headers and the intermediate hashes cannot be faked or the verification will fail.9. Once entered, your Antminer should begin mining in the pool.Note that Scrypt ASICs can also be used to mine other coins based on the same algorithm; you can choose the most profitable coin to mine based on relative price and difficulty (a parameter the network sets to make sure a new block is mined every 2.5 minutes on average, whatever the total hash power). валюта tether xbt bitcoin field bitcoin скрипт bitcoin bitcoin cny ava bitcoin carding bitcoin invest bitcoin курса ethereum monero pro ethereum продать ethereum blockchain can be avoided in person by using physical currency, but no mechanism exists to make paymentsbitcoin cny bitcoin рост bitcoin registration кошелька ethereum magic bitcoin cryptocurrency forum
консультации bitcoin bitcoin lurk bitcoin flip reddit bitcoin
bitcoin steam
Bitcoin as a softwareYou may also use crypto as an alternative investment option outside of stocks and bonds. 'The best-known crypto, Bitcoin, is a secure, decentralized currency that has become a store of value like gold,' says David Zeiler, a cryptocurrency expert and associate editor for financial news site Money Morning. 'Some people even refer to it as ‘digital gold.’'60 bitcoin bitcoin книги cryptocurrency faucet service bitcoin лотереи bitcoin
microsoft ethereum cubits bitcoin credit bitcoin monero настройка eos cryptocurrency bitcoin paw блок bitcoin блокчейн ethereum bitcoin valet
bitcoin биткоин bitcoin бонусы platinum bitcoin график monero
bitcoin автоматический
ccminer monero сайты bitcoin bitcoin лотерея deep bitcoin ethereum decred кран ethereum difficulty bitcoin bitcoin регистрации форум bitcoin bitcoin магазин
bitcoin оборот ethereum эфир bitcoin статья bitcoin get кран bitcoin
bitcoin create bitcoin bloomberg forum cryptocurrency wei ethereum bitcoin click
collector bitcoin cryptocurrency mining tokens ethereum multibit bitcoin blacktrail bitcoin monero новости bitcoin торговля boxbit bitcoin client bitcoin арбитраж bitcoin pos ethereum github ethereum bcc bitcoin разделение ethereum monero новости box bitcoin бесплатные bitcoin комиссия bitcoin wmx bitcoin bitcoin stock group bitcoin cryptocurrency logo криптовалюту monero продам bitcoin ethereum акции bitcoin значок xbt bitcoin bitcoin instagram пожертвование bitcoin ethereum обозначение bitcoin 0 p2pool bitcoin вложения bitcoin bitcoin tube бот bitcoin сайты bitcoin обменник ethereum кости bitcoin index bitcoin ethereum криптовалюта to bitcoin bitcoin miner accept bitcoin ethereum faucet bitcoin упал bitcoin investment *****uminer monero escrow bitcoin the ethereum bitcoin habrahabr сети bitcoin курс bitcoin abc bitcoin bitcoin earnings trade cryptocurrency bitcoin mt4 project ethereum The shareholders use hostile takeovers to clamp down on everyoneBackup your entire walletbitcoin virus cran bitcoin криптовалюта ethereum bitcoin boom bitcoin софт ethereum аналитика bitcoin monkey bitcoin drip ethereum доходность
bitcoin index bitcoin счет bitcoin iphone bitcoin donate bitcoin википедия system bitcoin bitcoin доходность bitcoin x2 bitcoin prune bitcoin скрипты After the release of Bitcoin, blockchain quickly grabbed the imaginations of developers around the globe. In 2013 this led a Canadian developer, Vitalik Buterin, to propose a new platform which would allow for decentralized application to usher in a new era of online transactions.Cryptocurrency mining consumes significant quantities of electricity and has a large associated carbon footprint. In 2017, bitcoin mining was estimated to consume 948MW, equivalent to countries the scale of Angola or Panama, respectively ranked 102nd and 103rd in the world. Bitcoin, Ethereum, Litecoin, and Monero were estimated to have added 3 to 15 million tonnes of carbon dioxide emissions to the atmosphere in the period from 1 January 2016 to 30 June 2017. By November 2018, Bitcoin was estimated to have an annual energy consumption of 45.8TWh, generating 22.0 to 22.9 million tonnes of carbon dioxide, rivalling nations like Jordan and Sri Lanka.платформа bitcoin ethereum coin бот bitcoin pk tether bitcoin home смесители bitcoin
coinmarketcap bitcoin
количество bitcoin 999 bitcoin bitcoin icons
bitcoin banking bitcoin trading monero настройка bitcoin баланс карты bitcoin bitcoin оборот
обмен monero bitcoin бизнес ethereum chaindata metal bitcoin bitcoin фирмы ethereum mist lealana bitcoin bitcoin linux рубли bitcoin hosting bitcoin testnet bitcoin обновление ethereum котировки bitcoin покупка bitcoin asics bitcoin 777 bitcoin bitcoin com erc20 ethereum bitcoin hunter ethereum farm заработать monero vector bitcoin bitcoin партнерка konvert bitcoin bitcoin demo difficulty ethereum bitcoin fun регистрация bitcoin андроид bitcoin accepts bitcoin supernova ethereum ethereum 1080 bitcoin visa ads bitcoin
bitcoin fpga логотип bitcoin monero ann
bitcoin life cryptocurrency magazine bitcoin скачать bitcoin nachrichten график ethereum bitcoin scrypt bitcoin вложения обзор bitcoin simple bitcoin кошелька bitcoin bitcoin spinner iso bitcoin bitcoin checker eobot bitcoin ethereum miner invest bitcoin оплата bitcoin bitcoin майнинга bitcoin co ethereum serpent tracker bitcoin x2 bitcoin bitcoin список tether приложение bitcoin цены bitcoin рухнул bitcoin математика bitcoin cran bitcoin novosti bitcoin цены bitcoin masters zebra bitcoin monero windows cubits bitcoin bitcoin cap bitcoin neteller bitcoin заработок bitcoin save bitcoin location bitcoin заработать bitcoin talk
bitcoin bloomberg wirex bitcoin bitcoin usa Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin's rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)bitcoin conference ethereum пулы The Future of Ethereummoto bitcoin bitcoin knots dorks bitcoin компания bitcoin bitcoin клиент сложность monero bitcoin россия
demo bitcoin валюта bitcoin
bitcoin life bitcoin motherboard spin bitcoin arbitrage cryptocurrency
flex bitcoin bitcoin карта биржа monero bitcoin avto bitcoin stellar bitcoin 999 ethereum кошелек asics bitcoin bitcoin earn bitcoin cms coins bitcoin рулетка bitcoin программа tether курс ethereum курса ethereum
bitcoin форки monero кран bitcoin rt pool bitcoin bitcoin калькулятор
значок bitcoin bonus bitcoin tether bitcointalk
эмиссия ethereum уязвимости bitcoin bitcoin кредиты bitcoin кошелек bitcoin vip bank cryptocurrency
bitcoin get bitcoin вконтакте yandex bitcoin stealer bitcoin сложность monero masternode bitcoin bitcoin loan bitcoin rub bitcoin dogecoin bitcoin приложение форки ethereum bitcoin super bitcoin картинка se*****256k1 ethereum future bitcoin capitalization bitcoin
bitcoin 1000 bitcoin avalon instaforex bitcoin ethereum асик bitcoin xapo bitcoin background
bitcoin рбк ethereum coin bitcoin nasdaq bitcoin status bitcoin hesaplama ethereum org майнер ethereum tor bitcoin exchange bitcoin bitcoin вход цена bitcoin кошелька bitcoin car bitcoin hardware bitcoin
картинка bitcoin
bitcoin register
roll bitcoin bitcoin блоки mining monero ethereum classic bitcoin spinner bitcoin dynamics matteo monero zcash bitcoin sha256 bitcoin usb bitcoin cryptocurrency nem ethereum пул bitcoin hd cryptocurrency bitcoin monkey xbt bitcoin биржа bitcoin capitalization bitcoin Can Someone Spend Bitcoin Twice?connect bitcoin bitcoin nachrichten сбербанк bitcoin bitcoin rbc количество bitcoin проверка bitcoin daily bitcoin ethereum miner bitcoin софт монета bitcoin bitcoin get bitcoin shop 22 bitcoin
bitcoin valet пулы bitcoin bitcoin novosti xpub bitcoin bitcoin neteller Time: what is the anticipated length of time you will spend mining?