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.
value bitcoin ethereum кошелька the best available worldwide.bitcoin capitalization отзывы ethereum
калькулятор ethereum
tether addon bitcoin 4 japan bitcoin bitcoin obmen bitcoin страна ethereum проблемы ethereum swarm bitcoin status ethereum упал playstation bitcoin ico ethereum view bitcoin Converting to C code...криптовалюта ethereum 1080 ethereum курс monero
проекта ethereum bitcoin ebay hd bitcoin project ethereum биржа bitcoin скрипты bitcoin
bitcoin отслеживание вклады bitcoin bitcoin cranes bitcoin multiply bitcoin store bitcoin novosti oil bitcoin
bitcoin компьютер sec bitcoin system bitcoin bitcoin иконка
bitcoin отзывы bitcoin foto отзыв bitcoin bitfenix bitcoin protocol bitcoin ethereum info обновление ethereum bitcoin баланс monero ico bitcoin код monero proxy putin bitcoin bitcoin loan bitcoin sphere tether перевод bitcoin блок debian bitcoin
asics bitcoin книга bitcoin
bitcoin biz bank cryptocurrency bitcoin air bitcoin таблица ethereum testnet bitcoin nachrichten bitcoin статья Governments have no control over the creation of cryptocurrencies, which is what initially made them so popular. Most cryptocurrencies begin with a market cap in mind, which means that their production decreases over time. This is similar to the physical monetary production of coins; production ends at a certain point and the coins become more valuable in the future.In our global economy, everyone has to learn how to 'speak money', at least on some level. If you can’t fluently speak the language of money, you’re at a disadvantage in your business and financial dealings.ico ethereum bitcoin investing earn bitcoin bitcoin china bonus bitcoin ethereum кошелька tether верификация bitcoin services форекс bitcoin bitcoin banking bitcoin 0 bitcoin мастернода new cryptocurrency wikipedia cryptocurrency spend bitcoin cryptocurrency wallet clicks bitcoin bitcoin 2020 bitcoin advcash trezor ethereum hd7850 monero новые bitcoin bitcoin оборудование the ethereum
bitcoin котировки monero продать bitcoin green bitcoin china the ethereum ethereum получить bitcoin buying demo bitcoin asics bitcoin arbitrage cryptocurrency polkadot su ethereum котировки bitcoin пополнить security bitcoin supernova ethereum ethereum go фьючерсы bitcoin майнер bitcoin bitcoin loan bitcoin com ava bitcoin bitcoin регистрации bitcoin продажа forecast bitcoin bitcoin timer
iobit bitcoin tether usdt bitcoin инвестирование фарм bitcoin bitcoin scrypt логотип bitcoin ethereum node
магазины bitcoin
bitcoin автокран neo bitcoin новости bitcoin перспектива bitcoin iobit bitcoin
bitcoin сатоши network bitcoin ethereum android start bitcoin bitcoin vip ethereum com ethereum stats bitcoin capitalization ethereum vk Many believe that Bitcoin is 'just one of thousands of cryptoassets'—this is true in the same way that the number zero is just one of an infinite series of numbers. In reality, Bitcoin is special, and so is zero: each is an invention which led to a discovery that fundamentally reshaped its overarching system—for Bitcoin, that system is money, and for zero, it is mathematics. Since money and math are mankind’s two universal languages, both Bitcoin and zero are critical constructs for civilization.best bitcoin лото bitcoin bitcoin neteller ethereum ротаторы прогнозы bitcoin coin bitcoin ethereum transactions bitcoin captcha фри bitcoin cryptonight monero exmo bitcoin ютуб bitcoin
контракты ethereum платформы ethereum bitcoin даром 2.1 Account-based modelWhy does LTC have value?Note: This is a second medium-of-exchange calculation that is worthwhile to know, but in my opinion no longer a key way to think about cryptocurrency valuation.bitcoin frog How would things be different with blockchain?Nobody did know until Satoshi emerged out of nowhere. In fact, nobody believed it was even possible.валюты bitcoin exchange ethereum bitcoin free ethereum windows проект bitcoin coffee bitcoin уязвимости bitcoin monero client bitcoin center монета ethereum ethereum продам акции ethereum bitcoin information bitcoin betting bubble bitcoin r bitcoin up bitcoin flypool ethereum connect bitcoin putin bitcoin
bitcoin gif wmx bitcoin car bitcoin
dollar bitcoin cryptocurrency air bitcoin
bitcoin zebra
bitcoin in bitcoin информация registration bitcoin blog bitcoin bitcoin torrent стоимость ethereum adc bitcoin reklama bitcoin gemini bitcoin калькулятор monero ltd bitcoin валюта tether ruble bitcoin bitcoin forex rx560 monero ethereum валюта халява bitcoin ethereum contract best cryptocurrency
*****a bitcoin dag ethereum bitcoin paypal 2 bitcoin
bitcoin безопасность logo ethereum is bitcoin bitcoin продажа blitz bitcoin bitcoin ne алгоритмы bitcoin bitcoin qiwi bitcoin linux monero faucet polkadot ico
1070 ethereum bitcoin подтверждение криптовалюта monero bitcoin бот ios bitcoin hashrate bitcoin nanopool monero
cryptocurrency market
ethereum habrahabr forecast bitcoin bitcoin segwit2x bitcoin nasdaq ethereum пул stats ethereum claim bitcoin валюта monero coin bitcoin продать bitcoin usb bitcoin bitcoin сайты bitcoin андроид High Leverage: Many forex brokers offer leverage for bitcoin trades. Experienced traders can use this to their benefit. However, such high margins should also be approached with great caution as they magnify the potential for losses.delphi bitcoin
simple bitcoin bitcoin переводчик > continued to walk, though this took increasingly creative changes of thetypes, or Coinsetter, if you enjoy trading as well.cryptocurrency calendar difficulty ethereum bitcoin trader bitcoin разделился конвертер bitcoin bitcoin selling express bitcoin
график monero bitcoin графики code bitcoin
bitcoin пул forex bitcoin alpari bitcoin
the ethereum rbc bitcoin
bitcoin rigs nxt cryptocurrency ethereum org ethereum plasma bitcoin land monero jax bitcoin
bloomberg bitcoin bitcoin java super bitcoin 1070 ethereum bitcoin обмена se*****256k1 ethereum bitcoin status bitcoin options
bitcoin plus bitcoin links trader bitcoin магазин bitcoin
bitcoin форумы bitcoin блог block bitcoin exchange ethereum windows bitcoin bitcoin биржа bitcoin япония bitcoin exchanges cryptocurrency capitalization добыча bitcoin mikrotik bitcoin bitcoin png платформы ethereum доходность ethereum tor bitcoin
20 bitcoin bitcoin database порт bitcoin monero криптовалюта top bitcoin bitcoin mine bitcoin china bitcoin like bitcoin foto bitcoin change порт bitcoin dice bitcoin dark bitcoin tether пополнение bitcoin vizit bitcoin проблемы linux bitcoin конец bitcoin bitcoin лотерея auction bitcoin
bitcoin сокращение обменники bitcoin monero fork bonus bitcoin bitcoin взлом bitcoin автомат bitcoin мастернода 1060 monero bitcoin payment bitcoin ios captcha bitcoin cryptocurrency chart bitcoin gpu Really? Why is that?форк ethereum обмен tether advent of the bitcoin mining industry in 2013 we have seen many examplesпул bitcoin
bitcoin зебра ethereum dag bitcoin пожертвование алгоритм monero ethereum serpent bitcoin capital bitcoin q bitcoin main
forum cryptocurrency cryptonator ethereum status bitcoin direct bitcoin bitcoin reddit бесплатно bitcoin bitcoin трейдинг bitcoin mac alpari bitcoin
ethereum asics капитализация bitcoin wirex bitcoin bitcoin usb claim bitcoin таблица bitcoin bitcoin robot виталий ethereum
bitcoin nachrichten 1 ethereum ethereum decred математика bitcoin The first three values (previous hash, transaction details, and nonce) are passed through a hashing function to produce the fourth value, the hash address of that particular block. Proof of Worktether верификация frog bitcoin 🏦ethereum game bitcoin компьютер Pre-mine + Block rewards + Uncle rewards + Uncle referencing rewardsThe amount is integrated into a Pedersen commitment, allowing all Monero users to confirm the validity of the transaction. Whereas it is impossible for them to verify the exact transaction amount, outputs and inputs can be independently verified to confirm whether they match.bitcoin zebra Risks of cryptocurrency spread bets and CFDsserver bitcoin кредит bitcoin moto bitcoin
bitcoin майнинга logo ethereum bitcoin софт icon bitcoin bitcoin вложения биржи monero bitcoin greenaddress registration bitcoin капитализация bitcoin
bitcoin checker ethereum кошелька bitcoin взлом bitcoin life ethereum настройка monero кран сложность monero китай bitcoin ферма bitcoin coinder bitcoin bitcoin hype bitcoin чат bitcoin faucets прогноз bitcoin tether 4pda bitcoin iso
bitcoin word обвал ethereum
добыча bitcoin wallet cryptocurrency алгоритм bitcoin platinum bitcoin bitcoin stiller time bitcoin source bitcoin king bitcoin bitcoin stiller bitcoin коллектор bitcoin weekly blockchain bitcoin bitcoin system ethereum монета bitcoin prosto bitcoin аналитика battle bitcoin bitcoin casinos daily bitcoin ethereum падает bitcoin purse electrodynamic tether coinder bitcoin bitcoin trade ethereum chaindata store bitcoin bitcoin eu daemon monero demo bitcoin цена bitcoin plasma ethereum bitcoin token скрипты bitcoin динамика ethereum bitcoin asic 6000 bitcoin
monero client solo bitcoin store bitcoin
monero amd bitcoin evolution bitcoin перевод cz bitcoin
On the other hand, technologists –- nerds — are transfixed by it. They see within it enormous potential and spend their nights and weekends tinkering with it.xbt bitcoin One of the most innovative aspects of Monero is the dynamic block size for new blocks. Monero uses the past median in the blocksize as one of the components to dynamically increase and decrease the cap on the block size.Dynamic block size prevents congestion if the network usage increases, providing room to scale over time. However, some research companies (e.g., Noncesense Research) uncovered a potential vulerability known as a 'big-bag attack.'. Since then, some changes have been introduced to protect against this potential exploit.bitcoin script bitcoin видеокарты bitcoin video collector bitcoin ethereum io 1000 bitcoin ethereum форк forecast bitcoin
bitcoin программирование bitcoin get cryptocurrency trading bitcoin valet bitcoin daily bitcoin зарегистрироваться
monero pro курсы ethereum bitcoin вложить bitcoin биржи bitcoin блоки trade bitcoin sberbank bitcoin bitcoin plus500 bitcoin фарминг асик ethereum bitcoin life moon bitcoin
market bitcoin проекта ethereum bitcoin миксеры tether bootstrap bitcoin javascript hyip bitcoin bitcoin scrypt bitcoin traffic bitcoin обналичить bitcoin auto blocks bitcoin bitcoin download clockworkmod tether bitcoin heist bitcoin кэш bitcoin мастернода
приложение tether bitcoin hunter bitcoin lion bitcoin loan ethereum картинки андроид bitcoin
bitcoin options капитализация bitcoin
bitcoin обвал nanopool ethereum
testnet bitcoin ethereum форум bitcoin сатоши ютуб bitcoin робот bitcoin Seeking lower electricity costs, some bitcoin miners have set up in places like Iceland where geothermal energy is cheap and cooling Arctic air is free. Chinese bitcoin miners are known to use hydroelectric power in Tibet to reduce electricity costs. North American companies are utilizing stranded gas as a cost effective source of energy for bitcoin mining. In West Texas, wind powers bitcoin mining.Encoding financial agreements: Manage agreements between users. Say, if one person buys insurance from an insurance company, the rules of when the insurance can be redeemed can be programmed into a smart contract.bitcoin calc trader bitcoin bitcoin окупаемость майнинга bitcoin bitcoin криптовалюта gif bitcoin accepts bitcoin кран ethereum скачать bitcoin стратегия bitcoin криптовалюту monero
программа bitcoin андроид bitcoin мастернода bitcoin cryptocurrency dash bitcoin daily
windows bitcoin bitcoin bbc мастернода bitcoin bitcoin metal all bitcoin bitcoin motherboard
bitcoin fortune crococoin bitcoin short bitcoin bitcoin 2x gadget bitcoin
bitcoin бонусы code bitcoin bitcoin автоматически The blockchain network gives internet users the ability to create value and authenticates digital information. What new business applications will result from this?12-15 secondsстоимость monero обсуждение bitcoin обвал bitcoin bitcoin reddit bitcoin trojan ethereum russia ethereum com coinmarketcap bitcoin
torrent bitcoin сколько bitcoin hd7850 monero ethereum wiki keyhunter bitcoin bitcoin торрент bitcoin сайт bitcoin bcc bitcoin flapper настройка ethereum casascius bitcoin
bitcoin farm
forex bitcoin bitcoin account app bitcoin bitcoin торговля forum cryptocurrency продам ethereum mikrotik bitcoin 99 bitcoin ethereum contracts bitcoin scripting bitcoin xbt bitcoin отследить
ethereum com
bitcoin synchronization happy bitcoin monero кошелек
777 bitcoin autobot bitcoin rush bitcoin bitcoin phoenix blogspot bitcoin Security and Hot WalletsHow the hardware game is changingantminer ethereum registration bitcoin bitcoin golden google bitcoin On 17 May 2013, it was reported that BitInstant processed approximately 30 percent of the money going into and out of bitcoin, and in April alone facilitated 30,000 transactions,куплю ethereum bitcoin background bitcoin daily
bitcoin работа monero mining tether clockworkmod основатель bitcoin bitcoin rt bitcoin начало bitcoin broker android tether machines bitcoin
pay bitcoin tera bitcoin платформ ethereum bitcoin брокеры apple bitcoin bitcoin приложения testnet ethereum s bitcoin etf bitcoin bitcoin book форумы bitcoin bitcoin pay
заработок ethereum monero прогноз monero fork расчет bitcoin bitcoin safe
bitcoin trojan bitcoin darkcoin
daemon monero ethereum доллар film bitcoin my ethereum отзыв bitcoin bitcoin tm bitcoin xyz bitcoin приложение
1070 ethereum block ethereum bitcoin блок bitcoin bot форум ethereum escrow bitcoin monero minergate сбербанк bitcoin india bitcoin bitcoin puzzle япония bitcoin система bitcoin
торрент bitcoin bitcoin страна bitcoin info программа tether bitcoin core multisig bitcoin
bitcoin конвертер bitcoin play видеокарты ethereum bitcoin валюты kaspersky bitcoin альпари bitcoin bitcoin chart
bitcoin masters система bitcoin wallets cryptocurrency mastering bitcoin bitcoin миллионеры bitcoin акции monero algorithm ethereum faucet bitcoin amazon security bitcoin wechat bitcoin bitcoin mail bitcoin wm