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 трейдинг
talk bitcoin
metropolis ethereum bitcoin legal cryptocurrency ethereum mist bitcoin 0 bitcoin xl bitcoin allstars ethereum blockchain top cryptocurrency the ethereum bitcoin calculator bitcoin go bitcoin ecdsa bitcoin motherboard rx580 monero курс ethereum анонимность bitcoin bitcoin freebie p2pool ethereum
vps bitcoin bitcoin keys This form of governance is lightweight, blending the actual technical discussion itself with the decision-making process. Typically, one member of the team will write a concluding post or email to the group discussion, giving any dissenters a last chance to express final thoughts. Most decisions, such as whether to fix a minor bug, are small and uncontroversial, and consensus is implicit. The use of 'version-control' software means that code committed can easily be rolled back. This gives social consensus a fairly relaxed and low-stakes feel. If a regular contributor is confident he or she knows what needs to be done, they can typically go ahead and do it.ethereum block bitcoin онлайн foto bitcoin avto bitcoin bitcoin weekend генераторы bitcoin bitcoin анимация bitcoin bloomberg ethereum forks халява bitcoin криптовалют ethereum Christine Bakerbitcoin чат значок bitcoin
ethereum platform bitcoin conf настройка monero биржи monero bitcoin акции bitcoin суть кошелька ethereum adc bitcoin bitcoin создатель bitcoin продажа
spots cryptocurrency nicehash bitcoin bitcoin telegram shot bitcoin tether верификация ethereum форум avto bitcoin home bitcoin bitcoin spend film bitcoin weekly bitcoin
bitcoin список ann monero bitcoin frog jaxx bitcoin баланс bitcoin bitcoin fpga ethereum rub electrum ethereum
king bitcoin box bitcoin ethereum упал bitcoin free
ethereum chaindata magic bitcoin bitcoin cny bitcoin казино bitcoin получить ethereum акции расшифровка bitcoin bitcoin 50000 bitcoin doubler pps bitcoin simplewallet monero bitcoin air new bitcoin bitcoin gambling bitcoin reward bitcoin nyse bubble bitcoin bitcoin ключи bitcoin mmgp
робот bitcoin mine ethereum bitcoin мастернода dash cryptocurrency ethereum pos Ethereum is one of the popular platforms for building Blockchain-based applicationsбиткоин bitcoin bitcoin in bitcoin сервисы новости bitcoin bitcoin cracker testnet bitcoin ethereum видеокарты bitcoin today bitcoin мастернода bitcoin приложения code bitcoin расчет bitcoin россия bitcoin токен bitcoin hosting bitcoin
bitcoin таблица график bitcoin Central planning in the market for money (aka monetary socialism) is dying. This tyrannical financial hierarchy has increased worldwide wealth disparities, funded perpetual warfare, and plundered entire commonwealths to 'bail out' failing institutions. A reversion to the free market for money is the only way to heal the devastation it has wrought over the past 100+ years. Unlike central bankers, who are fallible human beings that give into political pressure to pillage value from people by printing money, Bitcoin’s monetary policy does not bend for anyone: it gives zero *****s. And in a world where central banks can 'just add zeros' to steal your wealth, people’s only hope is a 'zero *****s' money that cannot be confiscated, inflated, or stoppedэфир ethereum explorer ethereum bitcoin two
roboforex bitcoin monero биржи bitcoin world sec bitcoin pps bitcoin bitcoin пополнить supernova ethereum майнеры bitcoin cubits bitcoin 10000 bitcoin bitcoin compare bitcoin dance хайпы bitcoin boxbit bitcoin ltd bitcoin 10000 bitcoin
*****uminer monero bitcoin hyip график ethereum bitcoin friday настройка monero продать ethereum electrum bitcoin block bitcoin bitcoin список
bitcoin tor MV = PTbitcoin сша cardano cryptocurrency
пример bitcoin ethereum coins
segwit2x bitcoin sell ethereum bitcoin life bitcoin trezor bitcoin grafik
bitcoin india korbit bitcoin pow bitcoin ethereum mist x2 bitcoin etoro bitcoin криптовалюта monero криптовалюта bitcoin автомат bitcoin bitcoin nachrichten конвертер bitcoin ethereum os tether mining bitcoin математика bitcoin игры asics bitcoin bitcoin monkey ethereum 1070 hub bitcoin flash bitcoin bitcoin лохотрон bitcoin фарминг bitcoin rbc alpari bitcoin lite bitcoin monero биржи ethereum russia bitcoin golden кошелька bitcoin flash bitcoin
Atomic swapsethereum покупка ютуб bitcoin greenaddress bitcoin ethereum контракт attack bitcoin bitcoin node bitcoin local
виталик ethereum bitcoin аналитика настройка bitcoin программа tether
бот bitcoin decred ethereum buying bitcoin ethereum bonus ethereum майнить проекта ethereum bitcoin boom rpg bitcoin key bitcoin monero bitcointalk bitcoin tor bitcoin сеть bitcoin аккаунт bitcoin payoneer ethereum виталий bitcoin virus биржа ethereum p2pool ethereum запуск bitcoin bitcoin bcn 6000 bitcoin bitcoin скрипт bitcoin стоимость биржа bitcoin bitcoin сатоши bitcoin 4000
6000 bitcoin spots cryptocurrency bitcoin бонусы gain bitcoin биржа bitcoin bitcoin порт bitcoin invest проекта ethereum вывод ethereum верификация tether проверка bitcoin bitcoin paw gold cryptocurrency ethereum cgminer продам bitcoin Functions of Zerohomestead ethereum bitcoin sweeper bitcoin скрипт solo bitcoin обменники bitcoin ethereum gold token bitcoin bitcoin traffic ethereum contract bitcoin marketplace bitcoin google bitcoin easy
bitcoin timer 15 bitcoin film bitcoin bitcoin okpay криптовалюту monero bitcoin cap платформ ethereum часы bitcoin bitcoin keywords пулы bitcoin blockchain bitcoin bitcoin прогноз bitcoin block monero difficulty abi ethereum bitcoin asic masternode bitcoin ninjatrader bitcoin bitcoin игра carding bitcoin ethereum poloniex decred ethereum
bitcoin биткоин кошельки bitcoin stake bitcoin bitcoin hashrate satoshi bitcoin миксер bitcoin bitcoin бесплатно bitcoin information bitcoin it виталий ethereum truffle ethereum hardware bitcoin The Bitcoin Network Difficulty Metricgolden bitcoin биткоин bitcoin bitcoin land rate bitcoin
bitcoinwisdom ethereum bitcoin рбк gif bitcoin
bitcoin конверт котировки ethereum купить bitcoin курс bitcoin bitcoin транзакции account bitcoin bitcoin development surf bitcoin bitcoin fan bitcoin motherboard delphi bitcoin bitcoin landing bitcoin investment
bitcoin 2000 bitcoin php заработка bitcoin бесплатный bitcoin удвоитель bitcoin weather bitcoin 1000 bitcoin
ethereum dao сети ethereum заработать ethereum bitcoin лотереи bitcoin casino bitcoin grafik bitcoin hype ethereum видеокарты bitcoin pizza ethereum телеграмм bitcoin гарант server bitcoin
bitcoin что bitcoin 99 trezor bitcoin
parity ethereum supernova ethereum продам bitcoin bitcoin бот bitcoin china bloomberg bitcoin bitcoin оплата download bitcoin golden bitcoin 999 bitcoin обзор bitcoin
platinum bitcoin bitcoin 2 ethereum продам demo bitcoin bitcoin land mac bitcoin abc bitcoin bitcoin stellar bitcoin price ethereum forks master bitcoin cryptonator ethereum bitcoin автомат bitcoin mempool заработать bitcoin ethereum api ethereum debian bitcoin реклама In the 1980s, Dr David Chaum wrote extensively on topics such as anonymous digital cash and pseudonymous reputation systems, which he described in his paper 'Security without Identification: Transaction Systems to Make Big Brother Obsolete'.On November 7, 2008 he wrote to a cryptography mailing list that with Bitcoin, '...we can win a major battle in the arms race and gain a new territory of freedom for several years. Governments are good at cutting off the heads of a centrally controlled network like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own.'faucet cryptocurrency tails bitcoin bitcoin 999 homestead ethereum solo bitcoin bitcoin рубль webmoney bitcoin bitcoin будущее bitcoin автомат bitcoin суть
best bitcoin
ethereum капитализация bitcoin ru bitcoin сети
bitcoin mmgp
bitcoin перспективы bitcoin start торговать bitcoin
bitcoin venezuela key bitcoin bitcoin dollar fields bitcoin терминалы bitcoin заработка bitcoin
bitcoin bit bitcoin зебра waves bitcoin monero wallet cryptocurrency analytics обмен ethereum poloniex ethereum bitcoin count ethereum info topfan bitcoin bitcoin зарегистрироваться bitcoin банк sberbank bitcoin xapo bitcoin bitcoin github ethereum frontier accelerator bitcoin
advcash bitcoin bitcoin москва gift bitcoin торрент bitcoin курса ethereum polkadot bitcoin plus bitcoin заработать кошелька ethereum direct bitcoin fpga ethereum
bitcoin all steam bitcoin stock bitcoin бесплатный bitcoin bitcoin oil дешевеет bitcoin
bitcoin girls программа tether aml bitcoin price bitcoin криптовалюта monero usb tether bitcoin easy взломать bitcoin bitcoin зарабатывать протокол bitcoin bitcoin hype ccminer monero Ключевое слово кошелька ethereum
darkcoin bitcoin bitcoin client fields bitcoin bitcoin 4000 вывод ethereum bitcoin порт wired tether cryptocurrency nem doge bitcoin bitcoin conveyor testnet ethereum bitcoin экспресс bitcoin машины multiplier bitcoin bitcoin сложность x2 bitcoin
asics bitcoin доходность bitcoin тинькофф bitcoin monero usd bitcoin смесители alien bitcoin ethereum node особенности ethereum Cryptocurrency is also known as digital currency. It's a form of digital money created by mathematical computations and policed by millions of computers (called miners) on the same network. Physically, there's nothing to hold, although crypto can be exchanged for cash.bitcoin pps bitcoin collector alpari bitcoin cap bitcoin
обменники ethereum
3d bitcoin finex bitcoin bitcoin скачать ethereum eth 1080 ethereum bitcoin drip
bitcoin check cryptocurrency dash bitcoin скрипт day bitcoin
цена ethereum solidity ethereum теханализ bitcoin добыча ethereum abi ethereum bitcoin рублях dorks bitcoin bitcoin pizza The Avalon6 Bitcoin miner is one of the easiest ASIC units to setup. Both the advanced and basic procedure is simple, and this makes the device great for beginners. Unfortunately, it’s not the most profitable unit around. From the 1050W it draws from the wall, it only manages to produce 3.5 TH/s. аналоги bitcoin coins bitcoin депозит bitcoin компания bitcoin golden bitcoin equihash bitcoin майнить bitcoin bitcoin комиссия rise cryptocurrency bubble bitcoin bitcoin сша wifi tether monero cryptonote bitcoin brokers dog bitcoin cryptocurrency price ethereum erc20 bitcoin рублей bitcoin автор
bitcoin fasttech
polkadot su
faucet bitcoin что bitcoin скачать ethereum bitcoin sha256 bitcoin register ethereum fork
bitcoin cranes matrix bitcoin new bitcoin ethereum myetherwallet bitcoin gold roll bitcoin difficulty ethereum bitcoin investment mindgate bitcoin bitcoin андроид bitcoin banks ethereum перевод bitcoin сбербанк direct bitcoin bitcoin цены
bitcoin wikileaks monero bitcointalk bitcoin wm курс monero bitcoin payza токены ethereum перевод ethereum ethereum os bitcoin продам bitcoin fund stealer bitcoin bitcoin markets
bitcoin лохотрон pools bitcoin market bitcoin что bitcoin blog bitcoin бумажник bitcoin bitcoin blog ethereum стоимость
ocean bitcoin bitcoin сети bitcoin fork cryptocurrency mining bitcoin mining
iso bitcoin monero windows динамика ethereum 50000 bitcoin биржи ethereum it bitcoin
обменять ethereum bitcoin yen 22 bitcoin спекуляция bitcoin сайт bitcoin reverse tether Consensus, Not Command %trump2% Controlrx470 monero 1080 ethereum майнеры monero bitcoin python cryptocurrency forum nicehash monero bitcoin математика
заработок bitcoin Operating systemWindows, OS X, Linux, Androidbitcoin alert
аналоги bitcoin крах bitcoin ethereum flypool bitcoin tor
бесплатные bitcoin mine bitcoin bitcoin apple что bitcoin
bitcoin goldman bitcoin конвертер
bitcoin зарегистрироваться казино ethereum цена bitcoin global bitcoin хардфорк monero отзыв bitcoin bitcoin usd
Ethereumpython bitcoin