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.
credit bitcoin bitcoin bazar hacking bitcoin bitcoin golden bitcoin scam bitcoin friday claim bitcoin tether комиссии bitcoin capital bitcoin coins asic bitcoin Stablecoins were worth more than $10 billion as of May 2020. In countries like Brazil, many people are turning to stablecoins as an alternative to their national currencies in uncertain economic conditions. Meanwhile, in Hong Kong, some people are using stablecoins to avoid new internet censorship in a tumultuous political climate.bitcoin russia обменник tether ethereum виталий best bitcoin оборот bitcoin bitcoin blockchain криптовалюта tether ethereum логотип bitcoin zona tether coin купить bitcoin bitcoin суть tor bitcoin bitcoin обмен bitcoin play bitcointalk bitcoin надежность bitcoin bitcoin anonymous bitcoin win bitcoin окупаемость super bitcoin pool bitcoin mmgp bitcoin bitcoin logo putin bitcoin nicehash bitcoin bitcoin сегодня ethereum farm fpga bitcoin bitcoin checker nanopool monero ccminer monero
bitcoin moneybox
bitmakler ethereum ethereum stats bitcoin hesaplama терминал bitcoin delphi bitcoin кран ethereum ethereum токены бесплатные bitcoin
1080 ethereum bitcoin change mini bitcoin
cms bitcoin транзакции ethereum ● Competitive Risk: Other cryptocurrencies could compete with Bitcoin, as could digital fiatbitcoin video bitcoin go bitcoin crush bitcoin scripting ethereum go tether обменник теханализ bitcoin ethereum serpent difficulty ethereum bitcoin nodes bitcoin passphrase bitcoin phoenix боты bitcoin new cryptocurrency калькулятор ethereum battle bitcoin bitcoin портал ropsten ethereum
generation bitcoin king bitcoin ethereum russia fields bitcoin покер bitcoin bitcoin investing bitcoin q кошель bitcoin bitcoin virus bitcoin инструкция
poloniex monero
приложение bitcoin tether программа bitcoin litecoin ethereum логотип bitcoin server bitcoin fast
перспектива bitcoin шахта bitcoin ethereum cryptocurrency js bitcoin разработчик bitcoin iso bitcoin cryptonator ethereum 16 bitcoin nodes bitcoin биржа monero ethereum forks monero nvidia инструкция bitcoin rise cryptocurrency bear bitcoin monero стоимость pool bitcoin сервера bitcoin monero майнить фьючерсы bitcoin stealer bitcoin
monero fee bitcoin сделки торрент bitcoin day bitcoin ethereum blockchain bitcoin loan обмен bitcoin
ethereum криптовалюта ethereum logo cardano cryptocurrency cryptocurrency calendar bitcoin hd bitcoin лайткоин bitcoin смесители alliance bitcoin
microsoft bitcoin bitcoin 3 ethereum биржи bitcoin microsoft delphi bitcoin
bitcoin alliance ethereum пулы
testnet bitcoin ethereum microsoft cryptocurrency price
monero cryptonote monero калькулятор dwarfpool monero 2018 bitcoin bitcoin цены arbitrage cryptocurrency подтверждение bitcoin china bitcoin
ethereum coin
tether обзор майнить bitcoin create bitcoin ethereum stats local bitcoin invest bitcoin bitcoin продам курса ethereum rate bitcoin
bitcoin trezor ethereum miner bitcoin valet ethereum обменять прогнозы bitcoin bitcoin euro генератор bitcoin bitcoin poloniex кошелек ethereum monero график bitcoin generate bitcoin green сделки bitcoin
продам bitcoin bitcoin виджет bitcoin multiply статистика ethereum бутерин ethereum bitcoin air bitcoin bow bitcoin отзывы купить bitcoin обмена bitcoin bitcoin xpub обвал bitcoin bitcoin fan casino bitcoin
statistics bitcoin кредиты bitcoin bitcoin book cryptocurrency law bitcoin safe maps bitcoin bitcoin icon сложность bitcoin minergate bitcoin валюта monero bitcoin balance bitcoin coinmarketcap bitcoin laundering
программа tether сервисы bitcoin bitcoin coinwarz bitcoin make bitcoin charts обзор bitcoin bitcoin ru
monero новости blake bitcoin bitcoin pdf trezor ethereum bitcoin tools bitcoin компьютер bitcoin wsj cryptonight monero отзыв bitcoin bitcoin compromised bitcoin plus bitcoin мошенники cgminer bitcoin
bitcoin робот bitcoin tm платформ ethereum mini bitcoin github ethereum форекс bitcoin ethereum stats
my ethereum сервисы bitcoin bitcoin зарегистрировать bitcoin local bitcoin transaction bitcoin pdf бесплатный bitcoin bitcoin forbes parity ethereum bitcointalk ethereum bitcoin халява основатель bitcoin bitcoin чат ethereum microsoft monero майнить bitcoin обзор etoro bitcoin bitcoin instant вывод bitcoin bitcoin gif bitcoin usa вывести bitcoin bank bitcoin bitcoin экспресс The answer to the question of 'Should I buy Litecoin or Ethereum?' remains the same, unless Litecoin’s purpose hits closer to home for you than either Bitcoin or Ethereum.group bitcoin bitcoin таблица
ethereum история cryptocurrency gold wallets cryptocurrency se*****256k1 ethereum bitcoin classic monero прогноз source bitcoin usb bitcoin ethereum асик bitcoin 10 bitcoin работа wirex bitcoin reddit bitcoin скрипты bitcoin ethereum пулы ethereum 4pda зарабатывать ethereum bitcoin биржи network bitcoin отслеживание bitcoin currency bitcoin bitcoin развод иконка bitcoin ethereum io go ethereum
habr bitcoin hourly bitcoin bitcoin алматы bitcoin перевести bitcoin converter bitcoin коды bitcoin center зарабатывать bitcoin goldmine bitcoin app bitcoin map bitcoin
ethereum настройка ethereum alliance bitcoin порт bitcoin ваучер buying bitcoin кредит bitcoin поиск bitcoin fake bitcoin ethereum видеокарты bitcoin транзакции bitcoin hash
bitcoin хабрахабр blocks bitcoin
favicon bitcoin difficulty bitcoin token bitcoin lazy bitcoin tether ico tradingview bitcoin bitcoin crypto blocks bitcoin okpay bitcoin обменник bitcoin bitcoin cryptocurrency polkadot store faucet bitcoin bitcoin футболка ledger bitcoin bitcoin download transaction bitcoin ethereum stratum ethereum node депозит bitcoin bitcoin analytics портал bitcoin боты bitcoin отзыв bitcoin приват24 bitcoin
tether usb bitcoin euro
accepts bitcoin форк bitcoin bitcoin автоматически blocks bitcoin bitcoin исходники litecoin bitcoin отзывы ethereum bitcoin клиент получить bitcoin net bitcoin история ethereum картинка bitcoin
rinkeby ethereum проблемы bitcoin bitcoin криптовалюта key bitcoin dogecoin bitcoin bitcoin location ethereum заработок ethereum coin puzzle bitcoin coingecko ethereum компьютер bitcoin bitcoin gif bitcoin exchanges gift bitcoin tether приложение moneybox bitcoin
rotator bitcoin bitcoin pdf bitcoin казахстан ethereum asics bitcoin investment ethereum transaction bitcoin desk майнинга bitcoin bitcoin paper moneybox bitcoin
блог bitcoin
monero майнить bitcoin смесители fields bitcoin bitcoin котировки bitcoin status q bitcoin bitcoin new bitcoin ann poloniex ethereum bitcoin генераторы bitcoin проверка bubble bitcoin сайте bitcoin swiss bitcoin ethereum plasma monero windows reverse tether poloniex ethereum bitcoin withdrawal bitcoin capital
bitcoin компания сколько bitcoin
bitcoin стоимость coin bitcoin vps bitcoin bitcoin авто bitcoin bestchange фильм bitcoin bitcoin рубль bitcoin get best cryptocurrency bitcoin monkey bitcoin виджет bitcoin dance monero пулы bitcoin dogecoin tether app why cryptocurrency Instead of having a central authority, Ethereum depends on a network of volunteers running 'nodes,' each of which stores the entire transaction history and the current 'state,' consisting of all of the account balances, contracts, and storage. This is a cumbersome task, especially since the total number of transactions is increasing all the time as more transactions come in.cronox bitcoin erc20 ethereum обмен monero georgia bitcoin платформы ethereum видеокарты bitcoin обменник bitcoin calculator bitcoin bitcoin 4000 1070 ethereum bitcoin google monero gui android tether порт bitcoin lamborghini bitcoin
bitcoin мошенничество mikrotik bitcoin bitcoin loto tether пополнение bitcoin криптовалюта разработчик ethereum ethereum биржа bitcoin flex bitcoin государство ethereum usd bitcoin россия bitcointalk monero bitcoin froggy polkadot su проект ethereum foto bitcoin bitcoin фермы расширение bitcoin ethereum кошельки монеты bitcoin bitcoin bio if the transaction is a contract-creating transaction, an additional 32,000 gasnodes bitcoin дешевеет bitcoin polkadot su monero xeon bitcoin 2000 cryptocurrency dash addnode bitcoin bitcoin token ethereum node ethereum алгоритмы bitcoin magazin bitcoin poker bitcoin bounty testnet bitcoin bitcoin payza
matrix bitcoin bitcoin eth bitcoin invest ethereum twitter доходность bitcoin monero price billionaire bitcoin ethereum casino polkadot ico tether coin blitz bitcoin bitcoin магазины bitcoin бумажник people bitcoin bitcoin pools json bitcoin bitcoin valet bitcoin p2p
monero logo microsoft bitcoin bitcoin программа bitcoin compare bitcoin кошельки iso bitcoin python bitcoin конвертер bitcoin eobot bitcoin
bitcoin рублях avto bitcoin автосборщик bitcoin ann monero ethereum картинки bitcoin favicon zcash bitcoin bitcoin mac ethereum пулы apple bitcoin bitcoin clouding bitcoin sha256
bitcoin книга bitcoin конвертер bitcoin rus рулетка bitcoin bitcoin google habrahabr bitcoin bitcoin aliexpress supernova ethereum bitcoin dark банк bitcoin bitcoin уязвимости ethereum заработок boom bitcoin bitcoin valet 9. Combining and Splitting ValueHow Ethereum mining worksmonero xmr bitcoin блоки bitcoin рбк часы bitcoin
analysis bitcoin
kurs bitcoin bitcoin bcc bitcoin symbol bitcoin captcha аналоги bitcoin chaindata ethereum платформ ethereum joker bitcoin sgminer monero
bitcoin mine ninjatrader bitcoin bitcoin froggy metal bitcoin chart bitcoin In August 2016, hackers stole some $72 million in customer bitcoin from the Hong Kong–based exchange Bitfinex.ethereum покупка my bitcoin ethereum форк monero proxy Anti-money laundering (AML) and know your customer (KYC) practices have a strong potential for being adapted to the blockchain. Currently, financial institutions must perform a labor-intensive multi-step process for each new customer. KYC costs could be reduced through cross-institution client verification and at the same time increase monitoring and analysis effectiveness.payoneer bitcoin bitcoin steam bitcoin alliance
bitcoin convert moto bitcoin bitcoin аккаунт abc bitcoin monero btc mine ethereum masternode bitcoin bitcoin info
история ethereum tether limited
doge bitcoin de bitcoin bitcoin trend bitcoin chains ethereum android All these are exchanged through a distributed network of trust that does not require or rely upon a central intermediary like a bank or broker. And all in a way where only the owner of an asset can send it, only the intended recipient can receive it, the asset can only exist in one place at a time, and everyone can validate transactions and ownership of all assets anytime they want.xpub bitcoin paidbooks bitcoin vps bitcoin bitcoin luxury bitcoin шифрование
bitcoin сервера app bitcoin bitcoin зебра майнить bitcoin microsoft ethereum биржа bitcoin
bitcoin forum ethereum logo bitcoin 20 bitcoin прогноз bitcoin автосерфинг bitcoin escrow
заработок bitcoin bitcoin hash wikipedia bitcoin golden bitcoin bitcoin войти tor bitcoin bitcoin mixer antminer ethereum abi ethereum bitcoin wmx bitcoin etf bitcoin 2017 airbit bitcoin bitcoin брокеры total cryptocurrency bitcoin knots Process:At the point when your bitcoins are sent, there's no getting them back, unless the beneficiary returns them to you. They're gone until the end of time.mining monero widget bitcoin bitcoin friday рынок bitcoin bitcoin algorithm supernova ethereum валюта tether майнить bitcoin bitcoin video
create bitcoin bitcoin hype monero pro добыча ethereum gambling bitcoin майнинга bitcoin bitcoin майнер bitcoin etf bitcoin millionaire 1000 bitcoin tether apk aml bitcoin pay bitcoin cryptocurrency prices dance bitcoin calculator bitcoin bitcoin книги c bitcoin
bitcoin java
pixel bitcoin
bitcoin vip
ethereum blockchain bitcoin динамика claim bitcoin ethereum icon токен bitcoin bitcoin сложность bitcoin рублей вебмани bitcoin bitcoin testnet анализ bitcoin bit bitcoin виталий ethereum monero faucet java bitcoin
bitcoin информация bitcoin direct faucets bitcoin youtube bitcoin часы bitcoin пузырь bitcoin money bitcoin bitcoin китай bitcoin testnet
пулы ethereum bitcoin lion Instead, the ledger is broken up into blocks: discrete transaction logs that contain 10 minutes worth of bitcoin activity apiece. Every block includes a reference to the block that came before it, and you can follow the links backward from the most recent block to the very first block, when bitcoin creator Satoshi Nakamoto conjured the first bitcoins into existence.токен bitcoin bitcoin cny bitcoin эмиссия bitcoin оборудование reklama bitcoin кошельки bitcoin bitcoin daily
bitcoin favicon алгоритмы ethereum email bitcoin mail bitcoin курса ethereum antminer ethereum bitcoin 20 view bitcoin armory bitcoin
bitcoin мониторинг bitcoin cash bitcoin cny magic bitcoin список bitcoin
краны monero ethereum ann bitcoin convert bitcoin ira nvidia monero wikileaks bitcoin bitcoin обозначение bitcoin cap bitcointalk monero описание bitcoin bitcoin paw ropsten ethereum mine ethereum ethereum gas abi ethereum цена ethereum casinos bitcoin уязвимости bitcoin icons bitcoin video bitcoin hosting bitcoin kurs bitcoin bitcoin карта краны monero монет bitcoin monero обменять the ethereum neo bitcoin So, Satoshi set the rule that the miners need to invest some work of their computers to qualify for this task. In fact, they have to find a hash – a product of a cryptographic function – that connects the new block with its predecessor. This is called the Proof-of-Work. In Bitcoin, it is based on the SHA 256 Hash algorithm.bitcoin гарант Buying and sellingлотерея bitcoin js bitcoin bitcoin зарегистрироваться
bitcoin fpga mini bitcoin okpay bitcoin стоимость bitcoin bitcoin legal bitcoin видео forum ethereum ethereum краны bitcoin maps reward bitcoin dash cryptocurrency ethereum miner ethereum io исходники bitcoin cryptocurrency news byzantium ethereum bitcoin автосборщик
ethereum пул ads bitcoin safe bitcoin prune bitcoin генераторы bitcoin bitcoin suisse часы bitcoin monero address bitcoin euro bitcoin bloomberg
bitcoin make bitcoin capital panda bitcoin bitcoin выиграть рубли bitcoin bitcoin download bitcoin баланс ethereum info electrum bitcoin dwarfpool monero eobot bitcoin токен ethereum фильм bitcoin
дешевеет bitcoin зарегистрировать bitcoin
p2pool ethereum
bitcoin playstation ethereum покупка bitcoin hacker bitcoin adress rigname ethereum майнеры monero bitcoin plus инструкция bitcoin ecdsa bitcoin
bitcoin card ethereum обвал bitcoin gold bitcoin grant bitcoin в LINKEDIN