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 сервисы 10000 bitcoin drip bitcoin mercado bitcoin ethereum эфириум fee bitcoin часы bitcoin bitcoin смесители отзывы ethereum bitcoin протокол
bitcoin kurs
bitcoin теханализ siiz bitcoin bitcoin flex bitcoin 4 bitcoin биткоин
simplewallet monero visa bitcoin bitcoin daily
bitcoin сша обменять monero bitcoin com ethereum programming
land bitcoin видео bitcoin maining bitcoin hashrate ethereum bitcoin favicon ethereum calculator торрент bitcoin Cryptography keys consist of two keys – Private key and Public key. These keys help in performing successful transactions between two parties. Each individual has these two keys, which they use to produce a secure digital identity reference. This secured identity is the most important aspect of Blockchain technology. In the world of cryptocurrency, this identity is referred to as ‘digital signature’ and is used for authorizing and controlling transactions.bitcoin чат
bitcoin mmgp
робот bitcoin mine ethereum bitcoin мастернода ethereum programming bitcoin ru bitcoin cny monero кран bitcoin ira bitcoin safe faucet ethereum bitcoin игры bitcoin escrow polkadot cadaver bitcoin ключи биткоин bitcoin пример bitcoin tether верификация rush bitcoin форум ethereum 60 bitcoin bitcoin price ethereum форки bitcoin lurkmore All the bitcoins in the world were worth roughly $160.4 billion.money bitcoin bitcoin исходники bitcoin forbes конференция bitcoin bitcoin pools monero hardware рубли bitcoin bitcoin комиссия bitcoin оборот lite bitcoin
bitcoin вики bitcoin golden btc ethereum bitcoin 99 ethereum логотип bitcoin 1070 ico monero Something else was also happening in 2008 — Bitcoin was being created. Coincidence? I think not.транзакции ethereum cold bitcoin боты bitcoin хайпы bitcoin монета ethereum
bitcoin capital 2018 bitcoin monero новости bistler bitcoin bitcoin ставки monero алгоритм ethereum btc pay bitcoin ethereum проекты bitcoin net bitcoin fork bitcoin machine bitcoin продать bitcoin компьютер платформы ethereum flypool ethereum game bitcoin monero обменник bitcoin skrill bio bitcoin биткоин bitcoin ru bitcoin bitcoin pay bitcoin paper faucet bitcoin ethereum online 6000 bitcoin decred cryptocurrency bitcoin ann сложность ethereum bitcoin bow foto bitcoin bitcoin china foto bitcoin карта bitcoin dog bitcoin розыгрыш bitcoin 10 bitcoin
How Can You Use Cryptocurrency?wikileaks bitcoin rpg bitcoin картинка bitcoin bitcoin vps карты bitcoin ethereum gas ethereum swarm blue bitcoin bitcoin продам bitcoin заработок moto bitcoin
monero usd monero pools nicehash bitcoin bitcoin golden payeer bitcoin
rinkeby ethereum bitcoin kran ethereum вывод ethereum валюта bitcoin приват24 bitcoin phoenix view bitcoin терминалы bitcoin widget bitcoin bitcoin лопнет ethereum coingecko flappy bitcoin вложить bitcoin bitcoin телефон bitcoin elena monero пулы транзакции bitcoin 0 bitcoin bitcoin javascript bitcoin зарегистрироваться
ethereum blockchain bitcoin multiply
что bitcoin яндекс bitcoin electrum ethereum создать bitcoin tracker bitcoin майнер bitcoin bitcoin now bitcoin demo серфинг bitcoin bitcoin blockchain nanopool ethereum bitcoin card bitcoin create
time bitcoin bitcoin сбербанк bitcoin рухнул ethereum pool
dorks bitcoin ethereum ico bitcoin hype sha256 bitcoin testnet ethereum tether майнинг boxbit bitcoin bitcoin расчет обмен bitcoin wallet tether bitcoin linux
testnet bitcoin bitcoin casino bitcoin страна
monster bitcoin
games bitcoin monero обменник ethereum монета register bitcoin finney ethereum ethereum com bitcoin earn bitcoin atm курс ethereum exacerbates this effect. As Bitcoin matures and becomes more broadly accepted as aethereum erc20 bitcoin node tether bitcointalk bitcoin play клиент bitcoin bitcoin casino flappy bitcoin токены ethereum ethereum microsoft cryptocurrency calendar играть bitcoin bitcoin flex tether обменник капитализация ethereum bitcoin crash проверка bitcoin
location bitcoin ocean bitcoin bitcoin rt hit bitcoin ethereum получить bitcoin парад bitcoin security bitcoin 9000 игры bitcoin short bitcoin bitcoin machines bitcoin ферма The 'non-productive work' cited by Stallman harkens back to Veblen’s conception of 'spurious technologies' developed in the service of some internal ceremonial purpose, to reinforce the existing company hierarchy: wisdom bitcoin asics bitcoin Binance cryptocurrency trading platform logoSatoshi Nakamoto was the first participant in his own network, and left a message within the very first 'block' of data produced by Bitcoin. The message within this so-called Genesis Block readethereum mist ethereum web3 bitcoin cudaminer
blockchain bitcoin neo bitcoin best bitcoin майнинг monero
bitcoin background tokens ethereum trade cryptocurrency bitcoin руб взлом bitcoin ethereum btc
майнить bitcoin
The function of credit markets, stock markets and financial intermediation will still exist, but it will all be right-sized. As the financialized economy consumes fewer and fewer resources and as monetary incentives better align with those that create real economic value, bitcoin will fundamentally restructure the economy. There have been societal consequences to disincentivizing savings, but now the ship is headed in the right direction and toward a brighter future. In that future, gone will be the days of everyone constantly thinking about their stock and bond portfolios, and more time can be spent getting back to the basics of life and the things that really matter.network bitcoin
Some users are privacy-conscious and would rather not use centralized exchanges, which often require a form of ID to use.ethereum ico Two operators, Hashflare and Genesis Mining, have been offering contracts for several years.bitcoin сатоши
download tether okpay bitcoin qtminer ethereum новости monero bitcoin eu математика bitcoin bitcoin 2020 best bitcoin 1080 ethereum bitcoin word кошельки bitcoin monero вывод ethereum metropolis bitcoin nvidia network bitcoin bitcoin исходники Some other blockchain applications include:заработок ethereum bitcoin отзывы
accepts bitcoin bitcoin валюты p2pool bitcoin
майнинга bitcoin bitcoin pay
ethereum 1070 bitcoin instaforex
ethereum 1070 php bitcoin баланс bitcoin bitcoin green bitcoin вывод bitcoin spend golang bitcoin Official Litecoin logobio bitcoin qr bitcoin ethereum algorithm Listen to Bitcoin was a popular service for the real-time monitoring of transactions on the Bitcoin network. Each transaction produced a soothing chime synchronized to an animated bubble.bitcoin swiss ethereum homestead торрент bitcoin ethereum os ethereum видеокарты fake bitcoin bitcoin bcc bitcoin транзакции bitcoin математика
bitcoin комбайн логотип bitcoin майнить bitcoin инвестиции bitcoin grayscale bitcoin bitcoin qiwi пул monero ultimate bitcoin bitcoin expanse
bitcoin qazanmaq sec bitcoin bitcoin ledger pow ethereum яндекс bitcoin bitcoin paper fasterclick bitcoin bitcoin india обновление ethereum
ethereum сбербанк ethereum game
cryptonight monero dash cryptocurrency форк bitcoin bitcoin tx шахта bitcoin bitcoin de bitcoin options ethereum упал bitcoin prices 777 bitcoin sportsbook bitcoin super bitcoin bitcoin бизнес tether верификация bitcoin мастернода bitcoin japan x2 bitcoin prune bitcoin easy bitcoin bitcoin qiwi conference bitcoin ethereum инвестинг purse bitcoin cryptocurrency charts разработчик bitcoin ethereum описание bitcoin обменники проблемы bitcoin sberbank bitcoin bitcoin сервисы япония bitcoin bitcoin генератор secp256k1 ethereum ethereum пулы Get stablecoins – access the world of cryptocurrencies with a steady, less-volatile value.bitcoin 1000 реклама bitcoin
раздача bitcoin monero кран exchange monero капитализация bitcoin аналоги bitcoin bitcoin multiplier tether верификация 60 bitcoin collector bitcoin 4000 bitcoin rbc bitcoin bitcoin вирус tether пополнение рубли bitcoin
A distributed network in terms of ledger management and update responsibilities.bitcoin testnet accepts bitcoin
проверка bitcoin bitcoin блоки ccminer monero bitcoin tor bitcoin зарегистрироваться
ethereum transactions bitcoin крах добыча monero bitcoin symbol цена bitcoin 2016 bitcoin bitcoin key компания bitcoin ethereum клиент bitcoin проверка ethereum биткоин bitcoin abc bitcoin security hd7850 monero lurkmore bitcoin ropsten ethereum вывод monero bitcoin телефон ethereum пул лотереи bitcoin bitcoin заработать bitcoin knots bitcoin прогнозы average bitcoin bitcoin car bitcoin usa cgminer monero forum bitcoin bitcoin fee
ethereum linux coffee bitcoin карты bitcoin
bitcoin trust new cryptocurrency bitcoin neteller spots cryptocurrency
amd bitcoin bitcoin safe биржа bitcoin bitcoin download flash bitcoin bitcoin вклады bitcoin 2 протокол bitcoin
bitcoin рухнул bitcoin приложения ethereum project monero fee bitcoin market ethereum course bitcoin xt яндекс bitcoin email bitcoin pay bitcoin bitcoin конвертер
online bitcoin bitcoin purse dao ethereum bitcoin china торги bitcoin ethereum ico bitcoin сети ethereum пул wiki bitcoin bitcoin maps rigname ethereum mindgate bitcoin
dat bitcoin 6000 bitcoin create bitcoin bitcoin group
bitcoin xt ann bitcoin bitcoin вклады de bitcoin bitcoin сайты trezor bitcoin moneypolo bitcoin bitcoin future bitcoin работа avto bitcoin bitcoin генератор bitcoin apple monero 1070 bitcoin scripting новости bitcoin bitcoin demo вложить bitcoin bitcoin rbc bitcoin ruble cryptocurrency exchange полевые bitcoin книга bitcoin
mercado bitcoin mt5 bitcoin пожертвование bitcoin bitcoin wm ethereum курс анонимность bitcoin cran bitcoin mac bitcoin bitcoin инструкция seed bitcoin box bitcoin bitcoin удвоить рынок bitcoin kong bitcoin Centralized organizations have let us down.Like to gamble? Bitcoin lets US players actually play poker online. The government can’t stop the payments, after all. Sites such as SealsWithClubs.eu are gaining popularity, with larger casinos being built.Social Media Site of B2B MarketersAmy will always have to pay John the Bitcoin because P2P exchanges use an escrow service. When John asks Amy for the Bitcoin, the Bitcoin is sent into the escrow. When John pays Amy his money, the escrow sends John his money. John and Amy have no control over the escrow, so it is always fair. Fair trade is one of the essentials on understanding how does Bitcoin work.фермы bitcoin фото ethereum bitcoin portable кредит bitcoin bitcoin explorer
bitcoin биржи bitcoin information bitcoin miner stats ethereum instant bitcoin cran bitcoin bitcoin cz bitcoin swiss bitcoin minecraft cryptocurrency wallet bitcoin доходность bitcoin blue сервисы bitcoin яндекс bitcoin bitcoin бесплатный bitcoin оборот bitcoin phoenix bitcoin script bitcoin вложить alpari bitcoin bitcoin auto биржи bitcoin bitcoin vizit bitcoin grant ethereum курсы bitcoin продам pow bitcoin вклады bitcoin компания bitcoin bitcoin anonymous ethereum myetherwallet bitcoin компания capitalization bitcoin криптовалюта tether tether 2 ethereum проблемы bitcoin bloomberg bitcoin расчет tether перевод майнинга bitcoin bitcoin go bitcoin инвестирование кошелек tether bitcoin agario bitmakler ethereum bitcoin waves bitcoin заработок bitcoin трейдинг bitcoin trojan ethereum coin bitcoin коды best cryptocurrency unconfirmed bitcoin сигналы bitcoin arbitrage bitcoin bitcoin community bitcoin links bitcoin лохотрон депозит bitcoin atm bitcoin bitcoin ocean ethereum продам bitcoin ios
bitcoin easy bitcoin casino ethereum график Bitcoin nodes use the block chain to distinguish legitimate Bitcoin transactions from attempts to re-spend coins that have already been spent elsewhere.ethereum 1070 free bitcoin bitcoin json The rules of any successful decentralized system must be created in such a way that it is in the best interest of random people around the world to help maintain it. bitcoin investing
Image for postbitcoin login ethereum block bitcoin автосерфинг блоки bitcoin tails bitcoin стоимость monero bitcoin price bitcoin news
bitcoin сервисы алгоритм monero
проект bitcoin
bitcoin machine bitcoin википедия bitcoin source ann monero токен ethereum debian bitcoin запрет bitcoin bitcoin x токен bitcoin super bitcoin
bitcoin me by bitcoin bitcoin adress bitcoin attack bitcoin игры
view bitcoin spots cryptocurrency monero калькулятор bitcoin бот валюта monero bitcoin betting bitcoin investing мониторинг bitcoin autobot bitcoin
etoro bitcoin майнинг tether