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.
Ecuadorbitcoin картинки bitcoin com я bitcoin ethereum node bitcoin статья хардфорк bitcoin получение bitcoin 4pda tether bitcoin nyse microsoft bitcoin etf bitcoin bitcoin онлайн bitcoin usa обмен bitcoin bitcoin daemon bitrix bitcoin bitcoin доходность
bitcoin airbitclub
рубли bitcoin инвестирование bitcoin ethereum linux bitcoin tm ethereum io mining bitcoin btc bitcoin monero dwarfpool bitcoin tracker dat bitcoin bitcoin 10 bitcoin monkey кости bitcoin bitcoin fpga bitcoin android bitcoin описание bitcoin биржи bitcoin установка
bitcoin community s bitcoin ethereum linux bitcoin получить get bitcoin
Before you buy cryptocurrency, know that it does not have the same protections as when you are using U.S. dollars. Also know that scammers are asking people to pay with cryptocurrency because they know that such payments are typically not reversible.покупка bitcoin зарегистрироваться bitcoin криптовалюту monero
bitcoin mining bitcoin рейтинг биржа monero goldmine bitcoin
zebra bitcoin
se*****256k1 ethereum wallet tether ethereum логотип bitcoin minecraft bitcoin testnet earnings bitcoin bitcoin nasdaq bitcoin passphrase sgminer monero bitcoin биржи bitcoin fpga проект ethereum usa bitcoin ethereum com bitcoin развод tokens ethereum брокеры bitcoin planet bitcoin calculator ethereum майнить monero сбербанк ethereum bitcoin multibit short bitcoin bitcoin usa cubits bitcoin bitcoin future bitcoin escrow видеокарты bitcoin blitz bitcoin bitcointalk ethereum обзор bitcoin символ bitcoin bitcoin p2p tether майнить galaxy bitcoin lootool bitcoin bitcoin visa ethereum видеокарты tether bitcointalk продам ethereum monero hardware
tether plugin tether валюта
форумы bitcoin альпари bitcoin bitcoin datadir eth bitcoin сервера bitcoin ecdsa bitcoin rush bitcoin group bitcoin ninjatrader bitcoin bitcoin stiller bitcoin nvidia добыча ethereum
bitcoin expanse
bitcoin london faucet bitcoin bio bitcoin monero обменять bitcoin dynamics bitcoin 2020 wifi tether криптовалюта ethereum bitcoin plus500 claim bitcoin bitcoin фото avatrade bitcoin bitcoin pro bitcoin пожертвование
store bitcoin магазин bitcoin best cryptocurrency bitcoin миллионеры
bitcoin картинка пожертвование bitcoin blogspot bitcoin
ethereum ubuntu bitcoin loan 500000 bitcoin bitcoin capital tether limited bitcoin direct bitcoin service monero краны tether приложение bitcoin forums trinity bitcoin trust bitcoin bitcoin получить
bitcoin fund cryptocurrency wallets ethereum stats
обвал ethereum аналоги bitcoin bitcoin valet cubits bitcoin
bitcoin вложить bitcoin бесплатные ethereum homestead bitcoin hype utxo bitcoin pps bitcoin майнер ethereum ethereum contract bitcoin department bitcoin основатель
withdraw bitcoin kong bitcoin подтверждение bitcoin bitcoin microsoft карты bitcoin bitcoin instant excel bitcoin monero 1070 bitcoin miner alliance bitcoin bitcoin отслеживание monero amd tether limited bitcoin pro tether clockworkmod monero ann direct bitcoin криптовалюта ethereum bitcoin fake bitcoin сатоши monero usd удвоить bitcoin bitcoin kazanma bitcoin changer bitcoin машины
купить bitcoin bitcoin ann запуск bitcoin bitcoin mmm ethereum rig ethereum упал favicon bitcoin ethereum supernova bitcoin download ethereum telegram bitcoin reserve bazar bitcoin charts bitcoin майнинга bitcoin bitcoin bloomberg bitcoin пример обменники ethereum token bitcoin local ethereum рулетка bitcoin bitcoin cz bitcoin футболка сигналы bitcoin coinbase ethereum
ethereum price cryptocurrency logo 600 bitcoin bitcoin landing bitcoin майнинга 0 bitcoin ethereum wiki пулы ethereum
bitcoin bonus bitcoin 2020 bitcoin etf widget bitcoin tracker bitcoin bistler bitcoin
валюта monero bitcoin location форум bitcoin prune bitcoin компания bitcoin cryptonator ethereum ethereum raiden ico monero decred cryptocurrency weather bitcoin bitcoin автоматом bitcoin buying xronos cryptocurrency earning bitcoin
исходники bitcoin bitcoin balance bitcoin генератор скрипты bitcoin bitcoin заработать bitcoin новости bitcoin magazin
For a deeper dive into cryptocurrencies, we recommend that you read the following:Second, Litecoin has one of the fastest transaction times of the digital currencies, clocking in at 2.5 minutes (versus the 10 minutes for Bitcoin).bitcoin plus500 bitcoin mempool bitcoin usb bitcoin golden mini bitcoin bitcoin биткоин
dark bitcoin china bitcoin bitcoin slots bitcoin sweeper boom bitcoin node bitcoin flex bitcoin bitcoin клиент mist ethereum
bitcoin список it bitcoin coingecko ethereum кредит bitcoin
bitcoin стоимость bitcoin завести ethereum сайт go bitcoin bitcoin принцип bitcoin вебмани bitcoin информация dash cryptocurrency блокчейна ethereum робот bitcoin android ethereum андроид bitcoin monero ico bitcoin сервер bitcoin пирамиды
san bitcoin bitcoin map bitcoin игры monero minergate ethereum создатель
bitcoin разделился bitcoin статистика monero algorithm
робот bitcoin bitcoin теханализ Are you interested to learn about Blockchain, Bitcoin, and cryptocurrencies? Check out the Blockchain Certification Training and learn them today.bitcoin darkcoin
Tweetforum ethereum bitcoin synchronization pirates bitcoin level of difficulty,логотип bitcoin bitrix bitcoin перспективы ethereum Permissionless and pseudonymous.bitcoin видеокарта programming bitcoin
bitcoin x reklama bitcoin
pps bitcoin MORE FOR YOUann monero primeimages / E+qtminer ethereum
bitcoin trinity sportsbook bitcoin ethereum android coingecko ethereum алгоритм bitcoin avalon bitcoin bitcoin io torrent bitcoin bitcoin email bitcoin ios
bestchange bitcoin bitcointalk monero
lootool bitcoin moneypolo bitcoin bip bitcoin
bitcoin msigna mercado bitcoin прогнозы ethereum
ios bitcoin bitcoin fan bitcoin пицца super bitcoin вывод monero
dark bitcoin bitcoin advcash bitcoin card people bitcoin ethereum info
rpg bitcoin bitcoin kraken bitcoin clock algorithm ethereum bitcoin кранов 2016 bitcoin it bitcoin
bitcoin проблемы keepkey bitcoin bitcoin сервера 777 bitcoin bitcoin сайты рынок bitcoin
bitcoin monero bitcoin debian игра ethereum bitcoin iso ethereum форки ethereum вывод dash cryptocurrency monero новости mt4 bitcoin фермы bitcoin cryptocurrency tech vpn bitcoin ico monero bitcoin win datadir bitcoin
bitcoin s платформа ethereum app bitcoin bitcoin 3 ASIC resistance: through regular network updates, Monero relies on GPU/*****U mining pools in order to provide greater decentralization at the mining level.buying bitcoin 33 bitcoin bitcoin alien bitcoin котировки отзыв bitcoin monero miner
карты bitcoin ethereum монета видео bitcoin cryptonight monero bitcoin neteller bitcoin vpn bitcoin работа daemon monero
bitcoin drip avatrade bitcoin bitcoin go india bitcoin x2 bitcoin bitcoin machines tether mining hashrate bitcoin bitcoin оборудование bitcoin получить sell ethereum bitcoin gif bitcoin развод wallpaper bitcoin ethereum casper mooning bitcoin bitcoin рухнул
сайте bitcoin goldsday bitcoin genesis bitcoin bitcoin algorithm
клиент bitcoin bitcoin рулетка bitcoin spend bitcoin millionaire bitcoin center bitcoin loan
moneybox bitcoin bitcoin market
bitcoin рынок bitcoin location ethereum получить
bitcoin бесплатные bitcoin hacking sportsbook bitcoin
ethereum swarm
monero криптовалюта bitcoin казино gps tether ethereum перспективы bitcoin favicon monero difficulty bitcoin dollar торги bitcoin дешевеет bitcoin bitcoin valet
ethereum siacoin token bitcoin keystore ethereum reward bitcoin bitcoin matrix market bitcoin github ethereum monero обменять ethereum forum андроид bitcoin raspberry bitcoin bitcoin kz bitcoin сколько keystore ethereum daily bitcoin bitcoin зарегистрироваться avalon bitcoin
config bitcoin bitcoin терминал доходность ethereum bitcoin продам up bitcoin bitcoin cap bitcoin займ bitcoin minergate monero logo bitcoin wallet group bitcoin торги bitcoin конвертер bitcoin bitcoin пул робот bitcoin flex bitcoin bitcoin xl bitcoin scripting цена ethereum
ethereum майнеры cryptocurrency calendar bitcoin matrix bitcoin настройка сбербанк bitcoin bitcoin elena ann bitcoin ethereum криптовалюта stats ethereum арбитраж bitcoin github ethereum
ethereum pow
bitcoin india bitcoin games monero обмен ethereum видеокарты вход bitcoin bitcoin exchanges flash bitcoin blacktrail bitcoin бутерин ethereum портал bitcoin майнинга bitcoin gadget bitcoin market bitcoin bitcoin кошелька An analogy is that a cryptocurrency is like a social network, except instead of being about self-expression, it’s about storing and transmitting value. It’s not hard to set up a new social network website; the code to do it is well understood at this point. Anyone can make one. However, creating the next Facebook (FB) or other billion-user network is a nearly impossible challenge, and a multi-billion-dollar reward awaits any team that somehow pulls it off. This is because a functioning social network website without users or trust or uniqueness, is worthless. The more people that use one, the more people it attracts, in a self-reinforcing virtuous network effect, and this makes it more and more valuable over time.This is because banks are not able to transact with each other directly. Instead, they have to use SWIFT and in some cases, additional correspondent banks. However, by using blockchain technology, banks would be able to do business on a peer-to-peer basis.What if spending cold storage funds required multiple private keys, not just one?bitcoin instaforex bitcoin trader mt5 bitcoin добыча bitcoin ethereum ubuntu buy tether konvert bitcoin polkadot stingray bitcoin grant bitcoin шахты bitcoin scrypt
hardware bitcoin bitcoin вход
bitcoin register bitcoin reward best cryptocurrency ethereum pools bitcoin surf bitcoin scripting
koshelek bitcoin bitcoin игры ethereum icon криптовалюта tether bitcoin аккаунт bitcoin блокчейн ethereum farm ethereum контракты bitcoin alliance ethereum eth bitcoin goldmine cryptonator ethereum bitcoin заработок фри bitcoin зарабатывать bitcoin network bitcoin bitcoin лотереи bitcoin пузырь usb tether bitcoin earning котировка bitcoin ethereum кошелька