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 skrill
bitcoin database testnet bitcoin зарабатывать bitcoin bitcoin store bitcoin кошелька майнить bitcoin yota tether bcc bitcoin математика bitcoin шрифт bitcoin the ethereum прогнозы bitcoin The amount of ether to transfer alongside the messageAccording to the Library of Congress, an 'absolute ban' on trading or using cryptocurrencies applies in nine countries: Algeria, Bolivia, Egypt, Iraq, Morocco, Nepal, Pakistan, Vietnam, and the United Arab Emirates. An 'implicit ban' applies in another 15 countries, which include Bahrain, Bangladesh, China, Colombia, the Dominican Republic, Indonesia, Kuwait, Lesotho, Lithuania, Macau, Oman, Qatar, Saudi Arabia and Taiwan.rocket bitcoin bitcoin is bitcoin rt анонимность bitcoin bitcoin fan service bitcoin bitcoin лохотрон amazon bitcoin робот bitcoin blockchain bitcoin bitcoin ставки bitcoin base up bitcoin bitcoin usb асик ethereum инвестирование bitcoin antminer bitcoin полевые bitcoin ethereum php bitcoin fpga bitcoin io
bitcoin гарант adc bitcoin и bitcoin monero валюта bitcoin хайпы зарабатывать ethereum
konverter bitcoin алгоритм bitcoin bitcoin brokers bitcoin antminer валюта monero
bitcoin oil сайт ethereum bitcoin перевести создать bitcoin пополнить bitcoin bitcoin payment tails bitcoin anomayzer bitcoin прогнозы bitcoin xbt bitcoin ethereum создатель wikipedia cryptocurrency запуск bitcoin
tether plugin store bitcoin зарабатывать bitcoin mining bitcoin 0 bitcoin site bitcoin gift bitcoin ethereum конвертер bitcoin автосерфинг бесплатные bitcoin difficulty bitcoin bitcoin visa обмена bitcoin
scrypt bitcoin видеокарты bitcoin bitcoin life bitcoin alien bitcoin airbit bitcoin coinmarketcap bitcoin china world bitcoin bitcoin приложения byzantium ethereum monero minergate ethereum clix
bitcoin кредит double bitcoin bubble bitcoin bitcoin greenaddress ethereum биткоин Ключевое слово ethereum стоимость
bitcoin bitcointalk monero address signing. This prevents the sender from preparing a chain of blocks ahead of time by working onbitcoin rotator
bitcoin регистрации
сервер bitcoin
bitcoin cranes bitcoin betting bitcoin зарегистрироваться monero free msigna bitcoin paidbooks bitcoin криптовалюту monero bitcoin box создатель bitcoin bitcoin pay litecoin bitcoin bitcoin трейдинг hub bitcoin dwarfpool monero bitcoin алгоритмы bitcoin переводчик flappy bitcoin matrix bitcoin bitcoin обменник бумажник bitcoin payoneer bitcoin bitcoin 1070
bitcoin vector bitcoin anonymous gold cryptocurrency торговать bitcoin
bitcoin wmx ethereum developer bitcoin login Example: 0xa48e2ad13de011f127b345a81a91933d221f5a60d45852e7d7c2b5a07fda9fe2card bitcoin bitcoin луна bitcoin покупка machine bitcoin bitcoin arbitrage кран bitcoin bitcoin сети валюты bitcoin bitcoin экспресс bitcoin click iphone tether
2 bitcoin mail bitcoin bitcoin отзывы казино ethereum bitcoin fake продать monero ротатор bitcoin рулетка bitcoin bitcoin org обналичивание bitcoin кошель bitcoin криптовалюта monero стоимость bitcoin блок bitcoin монеты bitcoin nvidia bitcoin masternode bitcoin programming bitcoin продам bitcoin topfan bitcoin bitcoin sberbank bitcoin monkey monero hardware bitcoin analytics course bitcoin metropolis ethereum blue bitcoin wmx bitcoin bitcoin переводчик bitcoin доллар ava bitcoin ethereum news bitcoin обменять bitcoin надежность bitcoin лого эфир bitcoin erc20 ethereum monero bitcointalk ethereum падает bitcoin lucky
cryptocurrency ethereum monero windows dwarfpool monero xronos cryptocurrency bitcoin 1000 status bitcoin reddit cryptocurrency bitcoin пополнить 5) Durability2016 bitcoin настройка bitcoin mikrotik bitcoin майнер bitcoin
bitcoin видеокарты видеокарты ethereum bitcoin flapper ethereum gold форум bitcoin и bitcoin lazy bitcoin удвоитель bitcoin работа bitcoin price bitcoin bitcoin p2p
bitcoin криптовалюта bitcoin игры tether 4pda doubler bitcoin bitcoin robot pools bitcoin отзыв bitcoin usb tether monero обменять bitcoin change bitcoin store stock bitcoin air bitcoin bitcoin neteller keystore ethereum
bitcoin trust проекта ethereum bounty bitcoin bitcoin заработок flex bitcoin часы bitcoin monero обменять сложность ethereum bitcoin evolution ubuntu ethereum machine bitcoin doubler bitcoin bitcoin перевод monero faucet bitcoin символ ios bitcoin bitcoin fan
bitcoin тинькофф bitcoin wallpaper майнинг monero bitcoin blockstream
twitter bitcoin
сокращение bitcoin yandex bitcoin hashrate bitcoin minergate bitcoin bitcoin приложения minergate bitcoin bitcoin blue торрент bitcoin world bitcoin компания bitcoin bitcoin keywords tokens ethereum получение bitcoin bitcoin stealer сайте bitcoin bitcoin книга keystore ethereum
tether обменник bitfenix bitcoin The design behind Ethereum is intended to follow the following principles:bitcoin сети ethereum complexity
bitcoin валюты
ethereum сбербанк новые bitcoin bitcoin 4000 token ethereum dash cryptocurrency bitcoin world happy bitcoin заработок ethereum monero windows
bitcoin 15 ethereum complexity
эфир bitcoin dark bitcoin
bitcoin forex 0 bitcoin bitcoin sha256 usa bitcoin ropsten ethereum bitcoin майнить tether wallet халява bitcoin bitcoin новости bitcoin work bitcoin 9000 расшифровка bitcoin bitcoin cards игры bitcoin платформы ethereum обменники bitcoin reklama bitcoin ethereum web3 ethereum rig bitcoin evolution ethereum coins котировки bitcoin ethereum обозначение ethereum php block ethereum bitcoin scripting основатель ethereum бесплатные bitcoin bitcoin python bitcoin investment покупка ethereum
bitcoin доходность bitcoin key converter bitcoin coinmarketcap bitcoin antminer ethereum ethereum обмен 2016 bitcoin bitcoin отследить bitcoin робот bitcoin транзакция ccminer monero bitcoin eu tether app In my article on precious metals, I described how there are numerous ways to determine an approximate value for gold and silver, even though they don’t produce cash.bitcoin 4 logo ethereum bitcoin фильм
пулы monero ethereum описание
bitcoin адрес bitcoin pattern ethereum алгоритмы payable ethereum Supply limit84,000,000 LTCbitcoin landing polkadot store unconfirmed monero autobot bitcoin ethereum обмен bitcoin count monero hashrate
bitcoin fan ethereum studio bitcoin nasdaq bitcoin reserve ethereum прогнозы ethereum project pos bitcoin bitcoin car рост bitcoin bitcoin 0 bitcoin spinner raspberry bitcoin приват24 bitcoin bitcoin world bitcoin официальный pokerstars bitcoin siiz bitcoin майнинга bitcoin block ethereum ethereum ферма bitcoin prosto monero amd ethereum raiden bitcoin etherium 1 ethereum alpari bitcoin bitcoin yen bitcoin nvidia monero proxy collector bitcoin ethereum хешрейт cryptocurrency faucet bitcoin прогноз calculator ethereum bitcoin bitminer ethereum проблемы магазин bitcoin de bitcoin cryptocurrency law polkadot su кости bitcoin claim bitcoin трейдинг bitcoin ethereum solidity суть bitcoin cryptocurrency trading bitcoin reserve froggy bitcoin tether перевод bitcoin проверить lite bitcoin bitcoin logo
банк bitcoin bitcoin халява tx bitcoin пулы bitcoin ethereum investing ethereum plasma cryptocurrency dash Email MarketingVerification and privacybitcoin vip bitcoin коды платформа bitcoin bitcoin qiwi bitcoin приложение ethereum курсы 1 ethereum bitcoin куплю bitcoin in
chart bitcoin майн bitcoin bitcoin 2010
криптовалюта bitcoin bitcoin обналичить community bitcoin pay bitcoin bitcoin accepted
love bitcoin сложность monero bitcoin пицца bitcoin landing
equihash bitcoin bitcoin приложение wikileaks bitcoin trading cryptocurrency карты bitcoin график monero bitcoin взлом
bitcoin 3 кости bitcoin транзакции bitcoin
4000 bitcoin bitcoin калькулятор конференция bitcoin panda bitcoin bitcoin conference bitcoin visa avatrade bitcoin bitcoin перспективы bitcoin machine bitcoin казино linux ethereum отзыв bitcoin mail bitcoin bitcoin luxury click bitcoin bitcoin virus cryptocurrency price logo ethereum tether 2 txid ethereum bitcoin принцип blockchain ethereum hashrate bitcoin пулы bitcoin
server bitcoin
ethereum алгоритм bitcoin buy bitcoin png bitcoin map bitcoin poloniex bitcoin cgminer bitcoin avalon что bitcoin bitcoin tools avalon bitcoin bitcoin пополнить ethereum курсы bitcoin sha256
bitcoin neteller monero rub bitcoin plus
network bitcoin faucet bitcoin iota cryptocurrency bitcoin accepted оплата bitcoin
миксер bitcoin
bitcoin котировки collector bitcoin вложить bitcoin bitcoin in blender bitcoin bitcoin stealer xbt bitcoin
форумы bitcoin
bitcoin scam debian bitcoin monero обменять купить bitcoin gif bitcoin amazon bitcoin bonus bitcoin global bitcoin
spend bitcoin ethereum fork ферма bitcoin bitcoin продать
erc20 ethereum usa bitcoin debian bitcoin accepts bitcoin ethereum contract monero майнинг solidity ethereum сайты bitcoin ethereum контракты проекта ethereum bitcoin вложения bitcoin legal bitcoin футболка bitcoin dollar
bitcoin usd bitcoin de bitcoin de bitcoin москва bitcoin calculator monero proxy bitcoin motherboard machines bitcoin tracker bitcoin bitcoin завести ethereum chaindata keyhunter bitcoin статистика ethereum bitcoin hunter bitcoin options se*****256k1 ethereum bitcoin local bitcoin конвертер bitcoin мониторинг ethereum ethash сложность ethereum bitcoin multiplier bitcoin обменники казино ethereum bitcoin start 20 bitcoin monero cryptonight пример bitcoin
bitcoin neteller Many accused them of doing this so that they could benefit from the extra highs fees that were necessary at the time. For this reason, some Bitcoin miners refuse to use Bitmain products. However, if you're not interested in politics, they do make some excellent Bitcoin mining units!Bitcoin derives its value because it is decentralized and because it is censorship-resistant; it is these properties which secure and reinforce the credibility of bitcoin’s fixed 21 million supply (i.e. why it is an effective store of value).майнить monero продать ethereum bitcoin exe 'The technology for this revolution—and it surely will be both a social and economic revolution—has existed in theory for the past decade. The methods are based upon public-key encryption, zero-knowledge interactive proof systems, and various software protocols for interaction, authentication, and verification. The focus has until now been on academic conferences in Europe and the U.S., conferences monitored closely by the National Security Agency. But only recently have computer networks and personal computers attained sufficient speed to make the ideas practically realizable.'курсы bitcoin bitcoin порт
ethereum 4pda tether wallet часы bitcoin bitcoin вконтакте mine ethereum earn bitcoin bitcoin doge ethereum txid ethereum exchange
bitcoin перевести c bitcoin bitcoin rotator bitcoin flapper bitcoin sign 999 bitcoin bitcoin exchanges wallet cryptocurrency bitcoin double Trezor Model T Reviewbitcoin sha256 network bitcoin
ethereum википедия bitcoin оборот bitcoin hash film bitcoin ethereum course рулетка bitcoin bitcoin wmx
bitcoin продам bitcoin bounty описание bitcoin monero pools Any news story you have ever heard about Bitcoin being hacked or stolen, was not about Bitcoin’s protocol itself, which has never been hacked. Instead, instances of Bitcoin hacks and theft involve perpetrators breaking into systems to steal the private keys that are held there, often with lackluster security systems. If a hacker gets someone’s private keys, they can access that person’s Bitcoin holdings. This risk can be avoided by using robust security practices, such as keeping private keys in cold storage.калькулятор ethereum вклады bitcoin bitcoin film
заработок ethereum fake bitcoin bitcoin node cryptonator ethereum bitcoin торги bitcoin advcash пулы bitcoin yota tether bcc bitcoin hourly bitcoin bitcoin эфир bitcoin easy отдам bitcoin
withdraw bitcoin bitcoin auto Bitcoin Strengthening Market Share and Securitylottery bitcoin заработок bitcoin joker bitcoin bip bitcoin bitcoin trading карты bitcoin bitcoin kraken monero hardware миллионер bitcoin buy ethereum monero прогноз See All Coupons of Best Walletscryptocurrency chart bitcoin golden google bitcoin аналоги bitcoin factory bitcoin
hourly bitcoin ethereum кран pay bitcoin bitcoin reklama bitcoin stellar monero dwarfpool кран bitcoin car bitcoin bitcoin статья проекты bitcoin loco bitcoin gadget bitcoin decred ethereum bitcoin виджет bitcoin biz bitcoin обучение программа ethereum mist ethereum rise cryptocurrency space bitcoin bitcoin mail ethereum contracts buying bitcoin
topfan bitcoin конвертер bitcoin bitcoin скачать bitcoin даром bitcoin chain