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 расшифровка why cryptocurrency polkadot cadaver доходность ethereum bitcoin me cryptocurrency mining ethereum contracts ethereum claymore flappy bitcoin ethereum алгоритм bitcoin фильм Only the computer that correctly guesses the hash can add the block to the chain. Proof-of-work requires computational power and the process is neither quick or cheap. To cheat the network would require so much of an investment that it is not financially viable for someone to try and amend the blockchain. This is the main security feature of the Bitcoin (and other cryptocurrency) networks.Miners need to install an Ethereum client to connect to the wider Ethereum network. An internet connection is vital for miners. Without an internet connection, the node won’t be able to do much of anything.bitcoin генератор secp256k1 ethereum ethereum пулы claymore ethereum bitcoin miner ethereum markets bitcoin мерчант bitcoin dogecoin xpub bitcoin
bitcoin расшифровка
новости monero bitcoin get config bitcoin decred ethereum bitcoin payoneer ethereum форум lootool bitcoin bitcoin fpga bestchange bitcoin
bitcoin primedice reverse tether flash bitcoin bitcoin millionaire bitcoin hardfork
daily bitcoin bitcoin официальный fields bitcoin bitcoin links bitcoin trust asics bitcoin ethereum картинки куплю ethereum ethereum сложность ethereum обменять bitcoin etherium chaindata ethereum bitcoin frog monero криптовалюта ethereum картинки bitcoin 20 bitcoin конвертер bitcoin usb
bitcoin buy
value markets indirectly. Consider, for example, people who hold fiat currencies with erodingWhile litecoin requires more sophisticated technology to mine than bitcoin, blocks are actually generated up to four times faster. Litecoin also processes financial transactions a lot quicker, and can also process a higher number of them over the same time period.metropolis ethereum bitcoin wallpaper
рубли bitcoin создатель bitcoin
транзакции bitcoin joker bitcoin
сети bitcoin bitcoin alliance bitcoin bcc monero hashrate bitcoin wallpaper bloomberg bitcoin андроид bitcoin zcash bitcoin conference bitcoin bitcoin шахты bitcoin compare bitcoin best bitcoin продать download tether хешрейт ethereum games bitcoin
cpuminer monero token ethereum matrix bitcoin golden bitcoin wechat bitcoin logo ethereum ethereum обменники kinolix bitcoin ethereum mist facebook bitcoin bitcoin сети bitcoin status
bitcoin eu ethereum mine bitcoin войти loan bitcoin bitcoin кран tether обменник майнить ethereum bitcoin course tether apk суть bitcoin bitcoin x2
video bitcoin
16 bitcoin ethereum 4pda bitcoin gif currency bitcoin ethereum markets bitcoin koshelek bitcoin форк p2pool bitcoin bitcoin зебра торрент bitcoin bitcoin ru уязвимости bitcoin avto bitcoin банкомат bitcoin 99 bitcoin bitcoin database программа bitcoin ru bitcoin bitcoin блокчейн платформе ethereum ethereum homestead bitcoin youtube bitcoin sweeper gambling bitcoin bitcoin чат unconfirmed bitcoin 4000 bitcoin bitcoin карты bitcoin настройка
bitcoin nedir
l bitcoin кошелек ethereum mac bitcoin ethereum addresses registration bitcoin bitcoin mt4 xmr monero bitcoin video stats ethereum abi ethereum
bitcoin crash отзыв bitcoin matrix bitcoin bitcoin ваучер bitcoin приват24 bitcoin save полевые bitcoin калькулятор bitcoin
machines bitcoin
machine bitcoin checker bitcoin инструкция bitcoin buying bitcoin bitcoin plugin bitcoin доллар bitcoin завести портал bitcoin bitcoin shops ethereum телеграмм кошелек monero bitcoin instaforex список bitcoin tether транскрипция wifi tether index bitcoin bazar bitcoin monero стоимость bitcoin cny курс monero bitcoin capitalization tether ico оборудование bitcoin datadir bitcoin trust bitcoin bitcoin journal poloniex ethereum bitcoin green bitcoin flapper fast bitcoin bitcoin vpn nicehash monero bitcoin freebitcoin create bitcoin bitcoin монета japan bitcoin xpub bitcoin bitcoin магазин ethereum course bitcoin 2010 bitcoin all 1000 bitcoin carding bitcoin bitcoin loan bitcoin fpga json bitcoin ico cryptocurrency china bitcoin bitcoin обменники bitcoin pps bitcoin metal q bitcoin bitcoin scam
новости bitcoin multi bitcoin bitcoin development опционы bitcoin
ethereum rig bitcoin программа cryptocurrency trading ethereum монета bitcoin school bitcoin tracker проекта ethereum bitcoin spinner de bitcoin котировки ethereum
bitcoin pizza bitcoin links monero криптовалюта cryptocurrency converter
bitcoin token bitcoin 2 boxbit bitcoin bitcoin майнер символ bitcoin reddit bitcoin chart bitcoin finney ethereum мавроди bitcoin q bitcoin
p2pool monero tether транскрипция бесплатный bitcoin bitcoin start bitcoin de
баланс bitcoin
bitcoin darkcoin bitcoin analysis Best Bitcoin Cloud Mining Contracts and Comparisonsxmr monero ethereum обменять ethereum geth bitcoin значок
bitcoin map
bitcoin футболка Ключевое слово tether 2 polkadot
bitcoin carding bitcoin markets криптовалюта tether bitcoin xl
bitcoin block ethereum хардфорк bitcoin onecoin bitcoin cryptocurrency blockchain-benefitsethereum 1070 шифрование bitcoin
bitcoin бонусы
сети ethereum bitcoin протокол ethereum api bitcoin wmz bitcoin direct bitcoin play lealana bitcoin card bitcoin bitcoin python ethereum pow
bitcoin mt4 bitcoin analysis bitcoin перевод bitcoin софт bitcoin global bitcoin шахта monero nicehash security bitcoin bitcoin торговля service bitcoin заработать monero bitcoin nodes japan bitcoin bitcoin electrum bitcoin nodes ethereum цена ethereum geth jpmorgan bitcoin bitcoin лайткоин криптовалюту monero
bitcoin q робот bitcoin tether верификация майнер bitcoin x2 bitcoin bitcoin x tether майнинг ферма ethereum bitcoin расчет криптовалюта tether blocks bitcoin withdraw bitcoin
ethereum пулы bitcoin cli bitcoin japan wifi tether bitcoin игры
bitcoin protocol
github bitcoin moto bitcoin ethereum gas bitcoin telegram технология bitcoin ethereum com mac bitcoin bitcoin fire bitcointalk bitcoin electrum bitcoin monero пул bitcoin de bitcoin это bitcoin monero
bitcoin fan purchase bitcoin bitcoin legal
bitcoin pdf bitcoin department Bitcoin is a new currency that was created in 2009 by an unknown person using the alias Satoshi Nakamoto. Transactions are made with no middle men – meaning, no banks! Bitcoin can be used to book hotels on Expedia, shop for furniture on Overstock and buy Xbox games. But much of the hype is about getting rich by trading it. The price of bitcoin skyrocketed into the thousands in 2017.100 bitcoin Trust is a risk judgement between different parties, and in the digital world, determining trust often boils down to proving identity (authentication) and proving permissions (authorization). Put more simply, we want to know, 'Are you who you say you are?' and 'Should you be able to do what you are trying to do?'coingecko bitcoin луна bitcoin bitcoin даром lite bitcoin ad bitcoin monero сложность
homestead ethereum bitcoin buying
bitcoin кредит vk bitcoin bitcoin airbit bitcoin spinner bitcoin plus500 bitcoin пул bitcoin checker ethereum farm bitcoin yen bitcoin робот ethereum twitter putin bitcoin cryptocurrency chart
bitcoin lite bux bitcoin bitcoin video ethereum доходность cpa bitcoin
robot bitcoin расширение bitcoin bitcoin poloniex loan bitcoin ethereum tokens xpub bitcoin us bitcoin bitcoin список iso bitcoin reddit ethereum tether обзор bitcoin scan bitcoin программа talk bitcoin казино ethereum ethereum bitcointalk
fox bitcoin
bitcoin mining bitcoin tradingview wired tether server bitcoin bitcoin passphrase
bitcoin scrypt tether bootstrap client ethereum laundering bitcoin monero сложность bitcoin fpga
хабрахабр bitcoin bitcoin рейтинг bitcoin mine bitcoin кошелька Blockchain and Miningtrinity bitcoin bitcoin лотереи bitcoin darkcoin ethereum видеокарты coingecko ethereum скачать bitcoin strategy bitcoin пожертвование bitcoin matrix bitcoin tether clockworkmod armory bitcoin
bitcoin utopia goldmine bitcoin
ethereum raiden surf bitcoin 22 bitcoin инструкция bitcoin ico cryptocurrency the ethereum миксер bitcoin io tether сложность ethereum бесплатно bitcoin time bitcoin зарабатываем bitcoin bitcoin genesis bitcoin исходники
bitcoin фарминг
обменники ethereum bitcoin аккаунт bitcoin теория верификация tether bitcoin x2 bitcoin bat bitcoin captcha проекты bitcoin новости monero bitcoin расчет bitcoin genesis monero ann bitcoin phoenix dao ethereum протокол bitcoin
group bitcoin group bitcoin delphi bitcoin reklama bitcoin cranes bitcoin space bitcoin tera bitcoin купить ethereum ethereum контракты bitcoin официальный tether tools bitcoin trading bitcoin alliance amazon bitcoin bitcoin book китай bitcoin bitcoin информация The faster block time of litecoin reduces the risk of double spending attacks – this is theoretical in the case of both networks having the same hashing power.monero rub bitcoin chains bitcoin tm bitcoin видео bitcoin eu bitcoin payment пополнить bitcoin bitcoin algorithm
отзывы ethereum bitcoin sphere minergate bitcoin monero logo транзакции ethereum bitcoin bounty ethereum mine динамика ethereum The bitcoin blockchain is a public ledger that records bitcoin transactions. It is implemented as a chain of blocks, each block containing a hash of the previous block up to the genesis block of the chain. A network of communicating nodes running bitcoin software maintains the blockchain.:215–219 Transactions of the form payer X sends Y bitcoins to payee Z are broadcast to this network using readily available software applications.bear bitcoin monero ann roulette bitcoin
развод bitcoin v, r, s: used to generate the signature that identifies the sender of the transaction.rx580 monero bitcoin магазины bitcoin форки ethereum статистика андроид bitcoin eobot bitcoin bitcoin nyse segwit bitcoin bitcoin 999 cryptocurrency mining bitcoin payza bitcoin видеокарты neo bitcoin bitcoin billionaire bitcoin blockstream payeer bitcoin difficulty ethereum bitcoin компания bitcoin instagram tether android monero coin bitcoin приложения cubits bitcoin майнер bitcoin ethereum обмен bitcoin investment уязвимости bitcoin ютуб bitcoin bistler bitcoin майнить bitcoin
ledger bitcoin кошелек ethereum daemon bitcoin pay bitcoin the ethereum ethereum rub master bitcoin bitcoin habrahabr platinum bitcoin алгоритм bitcoin monero обменять bitcoin habr bitcoin avalon importprivkey bitcoin bitcoin сеть ethereum wallet bitcoin лайткоин пополнить bitcoin bitcoin обналичить bitcoin funding отзывы ethereum project ethereum ethereum gas ethereum эфир bounty bitcoin пулы bitcoin monero btc
bitcoin перевод double bitcoin bitcoin rub cryptocurrency market bitcoin alien шрифт bitcoin bitcoin landing bitcoin surf капитализация ethereum рынок bitcoin биткоин bitcoin bitcoin gift bitcoin explorer bitcoin dogecoin captcha bitcoin purse bitcoin
bitcoin обменники bitcoin стратегия bitcoin 4000 шрифт bitcoin blake bitcoin gif bitcoin bitcoin курс ethereum contract fake bitcoin ann ethereum bitcoin wordpress bitcoin миллионер telegram bitcoin карты bitcoin pay bitcoin bio bitcoin ethereum plasma bitcoin vpn bitcoin easy курсы bitcoin ethereum network
стоимость ethereum bitcoin jp withdraw bitcoin cryptocurrency ethereum
ethereum windows robot bitcoin bitcoin кредит основатель bitcoin