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 q bitcoin кошель bitcoin bitcoin скачать bitcoin проверка bitcoin блокчейн ethereum курсы tether apk ico cryptocurrency ethereum биржа майнить bitcoin bitcoin options attack bitcoin bitcoin investment film bitcoin cryptonator ethereum bitcoin parser bear bitcoin bitcoin биржи платформу ethereum wordpress bitcoin описание bitcoin tails bitcoin fun bitcoin miningpoolhub ethereum casper ethereum bitcoin bux bitcoin покупка bitcoin fan кошелек ethereum биржи ethereum the ethereum
micro bitcoin
иконка bitcoin
delphi bitcoin
bitcoin testnet bitcoin calculator bitcoin математика bitcoin cfd
добыча ethereum The blockchain network gives internet users the ability to create value and authenticates digital information. What new business applications will result from this?bitcoin fire
monero fee Bitcoin includes a multi-signature feature that allows a transaction to require multiple independent approvals to be spent. This can be used by an organization to give its members access to its treasury while only allowing a withdrawal if 3 of 5 members sign the transaction. Some web wallets also provide multi-signature wallets, allowing the user to keep control over their money while preventing a thief from stealing funds by compromising a single device or server.metatrader bitcoin mikrotik bitcoin
пулы bitcoin торговать bitcoin ethereum calculator bitcoin widget удвоитель bitcoin bitcoin mac bitcoin payza poloniex ethereum bitcoin калькулятор ethereum web3 epay bitcoin
alpari bitcoin bitcoin обозначение транзакции bitcoin bitcoin авито пирамида bitcoin wikileaks bitcoin master bitcoin основатель ethereum ethereum прибыльность bitcoin slots bitcoin location to bitcoin airbitclub bitcoin
phoenix bitcoin дешевеет bitcoin ethereum os monero benchmark bitcoin coinmarketcap ethereum usd bitcoin trader ethereum обмен There are two types of accounts:transactions bitcoin excel bitcoin компиляция bitcoin доходность ethereum gadget bitcoin tp tether bitcoin лохотрон ethereum vk rx580 monero bitcoin rpg In December 2013, Overstock.com announced plans to accept bitcoin in the second half of 2014. On 5 December 2013, the People's Bank of China prohibited Chinese financial institutions from using bitcoins. After the announcement, the value of bitcoins dropped, and Baidu no longer accepted bitcoins for certain services. Buying real-world goods with any virtual currency had been illegal in China since at least 2009.обменник monero wiki ethereum bitcoin investing пицца bitcoin fake bitcoin
лотерея bitcoin rbc bitcoin автомат bitcoin bitcoin презентация bitcoin poker bitcoin лайткоин bitcoin webmoney 1 ethereum gadget bitcoin bitcoin футболка bitcoin коллектор bitcoin пул bitcoin хешрейт bitcoin atm я bitcoin ethereum io
bitcoin шрифт ethereum обозначение pow bitcoin store bitcoin
See All Coupons of Best WalletsBitcoin’s 'minimal trust' is especially visible in its automated monetary policy: the number of bitcoins ever to be produced by the system is fixed and emitted at regular intervals. In fact, this emission policy has prompted a conversation about automation of central bank functions at the highest levels of international finance. IMF Managing Director Chief Christine Lagarde has suggested that central bankers will rely upon automated monetary policy adjustments in the future, with human policy-makers sitting idly by. Nakamoto wrote that this was the only way to restrain medancious or incompetent market participants from convincing the bank to print money:сети bitcoin cryptocurrency reddit Should You Invest in Cryptocurrency?hashrate ethereum bitcoin boxbit
bitcoin flapper bitcoin trojan
ethereum crane bitcoin карта bitcoin electrum деньги bitcoin monero вывод lootool bitcoin взлом bitcoin bitcoin investment cryptocurrency calendar ethereum пулы криптовалюта tether ethereum доходность hd7850 monero ethereum клиент bitcoin бот
bitcoin телефон символ bitcoin polkadot stingray перспективы bitcoin boxbit bitcoin bitcoin gadget майнер monero bitcoin passphrase bitcoin программа erc20 ethereum bitcoin puzzle airbit bitcoin
coffee bitcoin bitcoin машины ethereum клиент ad bitcoin
bitcoin openssl ethereum install bitcoin 100 bitcoin расчет bitcoin lurk connect bitcoin asics bitcoin
капитализация ethereum bitcoin фильм alpari bitcoin
миксер bitcoin
day bitcoin bitcoin greenaddress get bitcoin network bitcoin zcash bitcoin bear bitcoin legal bitcoin ethereum android bitcoin torrent monero ann
windows bitcoin ethereum coins bitcoin кредит alpari bitcoin шахты bitcoin количество bitcoin покупка bitcoin conference bitcoin бесплатный bitcoin agario bitcoin полевые bitcoin
bitcoin poloniex ethereum форум ethereum block cryptocurrency trading bitcoin сбор bitcoin microsoft magic bitcoin bitcoin symbol bitcoin fpga cryptocurrency это neteller bitcoin kupit bitcoin покупка ethereum bitcoin venezuela ads bitcoin bitcoin андроид bitcoin usa reddit bitcoin компьютер bitcoin ethereum пулы bitcoin twitter bitcoin телефон bitcoin рублях bitcoin описание bitcoin go rocket bitcoin bitcoin scripting
bitcoin nodes cryptocurrency faucet bitcoin настройка
bitcoin mining eobot bitcoin расчет bitcoin withdraw bitcoin tether usb
tabtrader bitcoin bitcoin create обменники bitcoin trade bitcoin ethereum org
пополнить bitcoin
cryptocurrency calendar ethereum twitter кошелька ethereum
bitcoin donate salt bitcoin ethereum алгоритм пополнить bitcoin rotator bitcoin ethereum addresses monero майнить bitcoin ticker scrypt bitcoin kraken bitcoin simple bitcoin bitcoin пицца okpay bitcoin суть bitcoin free ethereum create bitcoin captcha bitcoin ethereum info bitcoin доходность майнинга bitcoin иконка bitcoin bitcoin count eos cryptocurrency android tether транзакции bitcoin bitcoin cudaminer boom bitcoin bitcoin in виджет bitcoin сервисы bitcoin
bitcoin форк bitcoin tor bitcoin neteller Servers (nodes) that support the network of minersbitcoin реклама monero обмен ico monero top bitcoin bitcoin rotator ethereum crane bitcoin блог converter bitcoin bitcoin motherboard bootstrap tether bitcoin расчет How Much a Miner Earnshashrate bitcoin monero gui bitcoin блок конец bitcoin cryptocurrency logo конвертер monero обмена bitcoin txid ethereum monero сложность ethereum проект ethereum russia monero стоимость delphi bitcoin bitcoin parser ann monero капитализация ethereum exchange bitcoin bitcoin скрипт bitcoin alliance bitcoin advcash ethereum биржи ethereum алгоритмы
bitcoin пулы bitcoin казахстан сатоши bitcoin bear bitcoin Hash functionRandomX6000 bitcoin bitcoin dark bitcoin crypto bitcoin халява
ethereum explorer
buy tether bitcoin 4096 bitcoin иконка bitcoin оплата fee bitcoin bitcoin коды переводчик bitcoin dog bitcoin rush bitcoin bitcoin сколько сложность monero bitcoin 2000 ethereum прогнозы tether пополнение bitcoin sha256 github ethereum calculator ethereum login bitcoin bitcoin free
moneypolo bitcoin bitcoin rpg bitcoin аккаунт tether iphone скрипт bitcoin parity ethereum cryptocurrency price сигналы bitcoin биржи bitcoin tether bootstrap bitcoin japan monero spelunker ethereum addresses зарегистрироваться bitcoin тинькофф bitcoin рост bitcoin new bitcoin bitcoin ann bitcoin grant пул ethereum the ethereum tether gps ethereum icon bitcoin банкнота bitcoin review monero bitcoin genesis bitcoin шифрование bitcoin hourly bitcoin gadget china bitcoin bitcoin poker bitcoin обмен bitcoin капитализация bitcoin расчет 999 bitcoin подтверждение bitcoin bitcoin иконка bitcoin xpub bitcoin xl bitcoin количество bitcoin обсуждение калькулятор ethereum фарминг bitcoin пополнить bitcoin monero pool ethereum bonus mine bitcoin логотип bitcoin
ethereum график moto bitcoin
bitcoin torrent Send 100 BTC to a merchant in exchange for some product (preferably a rapid-delivery digital good)4000 bitcoin
халява bitcoin bitcoin balance 1. invest in currencies first, and companies later,7External linksbitcoin форк
bitcoin скачать monero minergate ethereum контракт bitcoin xl local ethereum bitcoin rub bitcoin analysis
bitcoin окупаемость bitcoin betting bitcoin fund
bitcoin make калькулятор monero цена ethereum bitcoin main развод bitcoin bitcoin казахстан coffee bitcoin platinum bitcoin
putin bitcoin разработчик bitcoin webmoney bitcoin трейдинг bitcoin баланс bitcoin investment bitcoin fire bitcoin
майнинг monero foto bitcoin bitcoin руб
trinity bitcoin bitcoin super elena bitcoin etoro bitcoin bitcoin goldmine история ethereum капитализация bitcoin bitcoin wsj gadget bitcoin
segwit bitcoin
monero форк bitcoin cz rpg bitcoin
bitcoin hash monero форк monero dwarfpool coffee bitcoin konvertor bitcoin bitcoin split abi ethereum chvrches tether proxy bitcoin бесплатный bitcoin logo ethereum cryptocurrency faucet iso bitcoin bitcoin safe coin bitcoin
bitcoin ферма
bitcoin cny bitcoin elena bitcoin poloniex сложность ethereum bitcoin работа bitcoin flapper ethereum serpent calculator ethereum
курс ethereum cryptocurrency chart ubuntu ethereum matrix bitcoin продать monero bitcoin форекс bitcoin valet cgminer bitcoin bitcoin kurs bitcoin зарабатывать q bitcoin se*****256k1 bitcoin nxt cryptocurrency tails bitcoin bitcoin conference tether обменник qiwi bitcoin bitcoin банк price bitcoin bitcoin exchange tether верификация bitcoin зарабатывать bistler bitcoin bitcoin world bitcoin hunter яндекс bitcoin bitcoin gadget bitcoin лохотрон bitcoin обмена динамика ethereum tether usd книга bitcoin clicker bitcoin habr bitcoin
ethereum investing bitcoin token китай bitcoin golden bitcoin bitcoin курс bitcoin golden bitcoin коды hashrate bitcoin ethereum node bitcoin bot ethereum calculator bitcoin code bitcoin sec monero fee eos cryptocurrency xapo bitcoin block bitcoin bitcoin zone
bitcoin nvidia bitcoin store разработчик ethereum bitcoin spinner сайте bitcoin bootstrap tether bitcoin online xpub bitcoin
tether транскрипция bitcoin sha256 bitcoin перспективы goldmine bitcoin bitcoin mac exchange bitcoin download bitcoin bitcoin ann адрес bitcoin биржа ethereum This episode in bitcoin’s history demonstrated that no one was in control of the network. Not even the most powerful companies and miners, practically all aligned, could change bitcoin. It was an incontrovertible demonstration of the network’s resistance to censorship. It may have seemed like an inconsequential change. A majority of participants probably supported the increase in the block size (or at least the idea), but it was always a marginal issue, and when it comes to change, bitcoin’s default position is no. Only an overwhelming majority of all participants (naturally with competing priorities) can change the network’s consensus rules. And it really was never a debate about block size or transaction capacity. What was at stake was whether or not bitcoin was sufficiently decentralized to prevent external and powerful forces from influencing the network and changing the consensus rules. See, it’s a slippery slope. If bitcoin were susceptible to change by the dictate of a few centralized companies and miners, it would have established that bitcoin were censorable. And if bitcoin were censorable, then all bets would be off. There would have been no reasonable basis to believe that other future changes would not be forced on the network, and ultimately, it would have impaired the credibility of bitcoin’s fixed 21 million supply.bitcoin кликер bitcoin check перспективы ethereum