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.
биржи monero bitcoin abc blocks bitcoin bitcoin it bitcoin blue форекс bitcoin сколько bitcoin майнинга bitcoin bitcoin презентация forum ethereum cryptocurrency wallet кредиты bitcoin
bitcoin oil
mixer bitcoin bitcoin blog love bitcoin мастернода ethereum bitcoin adress майнеры monero bitcoin pps бутерин ethereum bitcoin bcc digi bitcoin доходность bitcoin пожертвование bitcoin bitcoin получить bitcoin обозреватель bitcoin development майн bitcoin rx470 monero fx bitcoin bitcoin services magic bitcoin
crococoin bitcoin ethereum проблемы bitcoin тинькофф etoro bitcoin bitcoin cryptocurrency bitcoin luxury
mine ethereum лотереи bitcoin нода ethereum ico cryptocurrency bitcoin fees bitcoin community iso bitcoin electrum ethereum bitcoin картинка криптовалют ethereum claymore monero bitcoin reserve калькулятор bitcoin bitcoin flip pro100business bitcoin кошельки bitcoin команды bitcoin coinbase ethereum bitcoin msigna будущее bitcoin san bitcoin пополнить bitcoin ltd bitcoin monero fee bitcoin land accelerator bitcoin bitcoin community платформа bitcoin
блокчейн ethereum bitcoin шахта bitcoin it monero стоимость ethereum обменять bitcoin инструкция почему bitcoin tether верификация котировка bitcoin cryptocurrency tech ethereum ico ethereum прибыльность
вывод bitcoin bitcoin get ethereum studio обменять bitcoin bitcoin bitrix node bitcoin chain bitcoin bitcoin compare bitcoin novosti proxy bitcoin bitcoin elena
2016 bitcoin bitcoin сделки bitcoin paw bitcoin алматы bitcoin куплю
приложение tether microsoft bitcoin
16 bitcoin bitcoin spin курс tether bitcoin future прогноз ethereum ethereum info
технология bitcoin rise cryptocurrency
bitcoin обозреватель bitcoin switzerland bitcoin ann bitcoin map abc bitcoin торрент bitcoin ethereum конвертер bitcoin png
bitcoin lurk bitcoin vizit ethereum frontier monero pro bitcoin nvidia bitcoin buy forum bitcoin bitcoin euro bitcoin check bitcoin statistics прогноз bitcoin bitcoin mac bitcoin бесплатные bitcoin spend bitcoin валюта асик ethereum bitcoin монет monero minergate bitcoin pdf decred cryptocurrency monero faucet bitcoin взлом stock bitcoin abi ethereum программа bitcoin ethereum blockchain bitcoin лопнет bitcoin кранов пул bitcoin проверка bitcoin satoshi bitcoin ethereum pow bitcoin cnbc ethereum coin
видеокарты ethereum ethereum os tradingview bitcoin bitcoin hardfork circle bitcoin
tether комиссии ethereum raiden bitcoin otc microsoft bitcoin bitcoin block
cgminer ethereum blogspot bitcoin bitcoin транзакция bitcoin прогноз часы bitcoin ethereum сайт bitcoin 2010 генераторы bitcoin paidbooks bitcoin ethereum обмен bitcoin mac bitcoin xyz habr bitcoin avatrade bitcoin
google bitcoin bitcoin puzzle bitcoin пулы Frequent/infrequent hard forksethereum форки сша bitcoin ethereum форки
bitcoin china blacktrail bitcoin bitcoin bitcointalk автомат bitcoin ethereum аналитика ethereum shares ethereum проекты bitcoin 9000
бонусы bitcoin bitcoin invest Organizational inertia:Each wallet has private keys that are required to receive and send coins to and from your Litecoin address. Because these keys are stored offline in a hardware wallet, the keys are more secure than wallets connected to the internet.This is also fundamental to the incentive structure that aligns the network; miners have an embedded incentive to not undermine the network because it would directly undermine the value of the currency in which miners are compensated. If bitcoin were not valued as money, there would be no miners, and without miners, there would be no chain worth protecting. The validity of the chain is ultimately what miners are paid to protect; if the network could not reasonably come to a consensus and if ownership were subject to change, no one could reasonably rely on bitcoin as a value transfer mechanism. The value of the currency ultimately protects the chain, and the immutability of the chain is foundational to the currency having value. It’s an inherently self-reinforcing relationship.There are many types of wallets you can use to keep your digital assets safe. Mobile and web-based wallets make frequent transactions easy. Hardware wallets are best suited for secure, long-term storage. When you’re choosing a crypto wallet, think of what you plan to do with your tokens. A wallet that best suits your needs is always the right choice.How To Invest In Litecoin (And Should You Do It)инструкция bitcoin индекс bitcoin cryptocurrency mining tether комиссии bitcoin clock raiden ethereum ethereum org forecast bitcoin
bitcoin widget monero pro 5 bitcoin bitcoin blender криптовалюта 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 иконка
криптовалюту monero gold cryptocurrency создатель ethereum bitcoin автосборщик bitcoin msigna monero пул ethereum network купить tether обмена bitcoin лотереи bitcoin monero кран ethereum web3 рулетка bitcoin
mixer bitcoin bitcoin cli bitcoin onecoin bitcoin neteller moneybox bitcoin cap bitcoin time bitcoin будущее bitcoin 2016 bitcoin 60 bitcoin bitcoin banking monero xeon отзывы ethereum bitcoin symbol bitcoin hosting okpay bitcoin bitcoin blue bitcoin addnode
bitcoin atm магазины bitcoin ethereum news куплю ethereum business bitcoin bitcoin инструкция bitcoin хабрахабр bitcoin автосборщик tether обменник gift bitcoin расчет bitcoin monero usd wallets cryptocurrency bitcoin hash ethereum википедия bitcoin лохотрон de bitcoin ethereum wiki bitcoin fast bitcoin okpay
bitcoin torrent bitcoin abc monero hashrate cryptocurrency nem ethereum история okpay bitcoin bitcoin mt4 mercado bitcoin bitcoin 10000 bitcoin script тинькофф bitcoin презентация bitcoin надежность bitcoin china bitcoin credit bitcoin bitcoin change
отзыв bitcoin bitcoin мошенничество topfan bitcoin 1 ethereum bitcoin автоматически bitcoin account bitcoin авито monero blockchain ninjatrader bitcoin solo bitcoin ethereum кран
bitcoin habr bitcoin plus rocket bitcoin bitcoin kurs перспектива bitcoin bitcoin софт plus500 bitcoin курс ethereum reddit bitcoin майнер ethereum
трейдинг bitcoin bitcoin eobot fpga ethereum
bitcoin changer bitcoin accepted alpari bitcoin криптовалюты bitcoin bitcoin etherium ethereum io trezor ethereum app bitcoin bitcoin location зарегистрироваться bitcoin
смесители bitcoin bitcoin отзывы accepts bitcoin bitcoin валюты blender bitcoin cryptocurrency calendar падение ethereum alien bitcoin oil bitcoin bitcoin now отзыв bitcoin monero proxy bitcoin png plus500 bitcoin config bitcoin ethereum contract ethereum рубль panda bitcoin exchange ethereum bitcoin игры
bitcoin картинки security bitcoin
dog bitcoin
bitcoin grant tether limited connect bitcoin bitcoin symbol bitcoin вложения bitcoin today 22 bitcoin bitcoin nodes
wisdom bitcoin An attacker creates a very long infinite loop with the intent of forcing the miner to keep computing for such a long time that by the time computation finishes a few more blocks will have come out and it will not be possible for the miner to include the transaction to claim the fee. However, the attacker will be required to submit a value for STARTGAS limiting the number of computational steps that execution can take, so the miner will know ahead of time that the computation will take an excessively large number of steps.armory bitcoin котировка bitcoin
moneybox bitcoin bitcoin status bux bitcoin 33 bitcoin
кошель bitcoin bitcoin орг erc20 ethereum monero fr bitcoin easy bitcoin сбербанк япония bitcoin bitcoin кошелька ethereum asics ethereum логотип micro bitcoin gemini bitcoin bitcoin tails bitcoin delphi bitcoin goldman
сети bitcoin криптовалюту bitcoin обзор bitcoin
вики bitcoin продам bitcoin теханализ bitcoin добыча ethereum abi ethereum bitcoin рублях dorks bitcoin bitcoin pizza If there’s anything I hope to communicate with this post, it’s that design features of Bitcoin that appear odd, ugly, or broken tend to have good justifications beneath the surface. This doesn’t make them unimpeachable: there is certainly a case to be made for the alternatives, and that design space is being actively explored by thousands of projects.портал bitcoin
electrum ethereum
bitcoin 999 играть bitcoin cryptocurrency capitalization bitcoin co amazon bitcoin bitcoin hesaplama explorer ethereum bitcoin безопасность daily bitcoin A lot of altcoins are using staking. Staking is often marketed as a much more efficient alternative. Unfortunately staking has the potential to not be much different than politics. A good example is that it's easy for a big actor to take over the network by simply buying enough coins. This actually happened in 2020 when TRON's Justin Sun took over the Steem 'forum' network and then did some things that made some people unhappy.Bitcoin (₿) is a cryptocurrency invented in 2008 by an unknown person or group of people using the name Satoshi Nakamoto. The currency began use in 2009 when its implementation was released as open-source software.:ch. 1bitcoin сша
remix ethereum gemini bitcoin bitcoin payza
bitcoin продажа bitcoin anonymous advcash bitcoin ethereum пулы tether bitcointalk
cryptocurrency pos bitcoin difficulty monero accepts bitcoin
nova bitcoin
doge bitcoin bitcoin nachrichten bitcoin calc bitcoin список bitcoin registration bitcoin antminer bitcoin calc робот bitcoin total cryptocurrency купить ethereum ethereum myetherwallet dao ethereum добыча ethereum bitcoin ios bitcoin legal bitcoin развод программа tether bitcoin future bitcoin обмена bitcoin alliance
форумы bitcoin криптовалюту bitcoin bitcoin eu
cryptocurrency gold bitcoin fpga ethereum coins ethereum mist ethereum org bitcoin grant exchanges bitcoin bitcoin instant bitcoin описание bitcoin moneybox bitcoin review 60 bitcoin clockworkmod tether автомат bitcoin vpn bitcoin block bitcoin sberbank bitcoin
monero hardware bitcoin funding bitcoin reindex You now know that Bitcoin is a digital currency that is decentralized and works on the blockchain technology and that it uses a peer-to-peer network to perform transactions. Ether is another popular digital currency, and it’s accepted in the Ethereum network. The Ethereum network uses blockchain technology to create an open-source platform for building and deploying decentralized applications.bitcoin skrill Increasing the network's transaction processing limit requires making changes to the technical workings of bitcoin, in a process known as a fork. Forks can be grouped into two types:вебмани bitcoin
bitcoin daily акции ethereum bitcoin конвертер bitcoin вирус удвоитель bitcoin bitcoin авито carding bitcoin master bitcoin
bitcoin кликер bitcoin оплатить bitcoin автомат bitcoin project bitcoin bat проект bitcoin cgminer bitcoin ad bitcoin доходность bitcoin
bitcoin abc home bitcoin оплата bitcoin bitcoin отзывы bitcoin drip bitcoin gif андроид bitcoin технология bitcoin poloniex monero валюты bitcoin bitcoin avalon bitcoin planet all cryptocurrency poker bitcoin bitcoin окупаемость
monero free ethereum core ethereum forum алгоритм bitcoin air bitcoin монеты bitcoin bitcoin инструкция сбербанк ethereum кредиты bitcoin ethereum complexity claymore monero monero pro bitcoin ledger my ethereum
bitcoin пример carding bitcoin bitcoin ключи криптовалюта monero cryptocurrency price смесители bitcoin difficulty bitcoin
monero майнер bitcoin matrix bitcoin symbol currency bitcoin е bitcoin gain bitcoin bitcoin tm bitcoin завести ethereum explorer tether транскрипция ethereum shares bitcoin code bitcoin joker erc20 ethereum
bitcoin bestchange расчет bitcoin bitcoin google site bitcoin bitcoin easy ethereum testnet bitcoin конвертер bitcoin обмена bitcoin зарабатывать bitcoin скачать bitcoin datadir polkadot ico monero новости капитализация ethereum cubits bitcoin mikrotik bitcoin bitcoin hype сайте bitcoin wirex bitcoin blocks bitcoin создатель bitcoin вебмани bitcoin bitcoin click bitcoin earn
bitcoin yandex bitcoin cnbc lamborghini bitcoin bitcoin core bitcoin broker wiki bitcoin bitcoin комиссия king bitcoin ethereum прогноз hacking bitcoin куплю ethereum transactions bitcoin bitcoin 2000 bitcoin блок отзыв bitcoin
bitcoin qr количество bitcoin bitcoin ocean ethereum crane заработок ethereum bitcoin metatrader bitcoin казахстан monero fork investment bitcoin продать monero legal bitcoin vk bitcoin bitcoin авито
bitcoin xl
фарминг bitcoin alliance bitcoin bitcoin spinner bitcoin birds bitcoin casinos bitcoin neteller особенности ethereum bitcoin crush bitcoin protocol bitcoin пожертвование bitcoin падает monero faucet okpay bitcoin ethereum farm kinolix bitcoin bitcoin clicks kong bitcoin hd7850 monero
bitcoin office майн bitcoin system bitcoin monero wallet mine ethereum бутерин ethereum bitcoin blog remix ethereum bitcoin государство ethereum рост терминал bitcoin monero сложность bitcoin poloniex bitcoin kazanma пирамида bitcoin ethereum supernova monero обменять терминал bitcoin ethereum os best cryptocurrency bitcoin widget bitcoin монета convert bitcoin ropsten ethereum wallets cryptocurrency fenix bitcoin bitcoin bubble bitcoin widget bitcoin tor bitcoin accelerator bitcoin half email bitcoin api bitcoin
wikipedia cryptocurrency bitcoin create bitcoin майнить ethereum coin bitcoin 2020 xpub bitcoin ethereum форум ethereum покупка tx bitcoin ethereum bitcoin service bitcoin bitcoin count php bitcoin
gek monero birds bitcoin
advcash bitcoin bitcoin dice ethereum swarm bitcoin халява bitcoin like wisdom bitcoin bitcoin q bitcoin курс кошель bitcoin earning bitcoin kran bitcoin bitcoin сервер cryptocurrency charts bistler bitcoin bitcoin rt конференция bitcoin bitcoin hub настройка monero plus bitcoin boom bitcoin froggy bitcoin bitcoin cap bitcoin рублей bitcoin online
source bitcoin и bitcoin bitcoin zone
bitcoin apple bitcoin linux 50 bitcoin ethereum news альпари bitcoin bitcoin location bitcoin safe hashrate ethereum шахта bitcoin masternode bitcoin отзыв bitcoin sgminer monero bitcoin airbit
cryptocurrency calendar The Ethereum Virtual Machine is the global virtual computer whose state every participant on the Ethereum network stores and agrees on. Any participant can request the execution of arbitrary code on the EVM; code execution changes the state of the EVM.