Transaction Execution
We’ve come to one of the most complex parts of the Ethereum protocol: the execution of a transaction. Say you send a transaction off into the Ethereum network to be processed. What happens to transition the state of Ethereum to include your transaction?
Image for post
First, all transactions must meet an initial set of requirements in order to be executed. These include:
The transaction must be a properly formatted RLP. “RLP” stands for “Recursive Length Prefix” and is a data format used to encode nested arrays of binary data. RLP is the format Ethereum uses to serialize objects.
Valid transaction signature.
Valid transaction nonce. Recall that the nonce of an account is the count of transactions sent from that account. To be valid, a transaction nonce must be equal to the sender account’s nonce.
The transaction’s gas limit must be equal to or greater than the intrinsic gas used by the transaction. The intrinsic gas includes:
a predefined cost of 21,000 gas for executing the transaction
a gas fee for data sent with the transaction (4 gas for every byte of data or code that equals zero, and 68 gas for every non-zero byte of data or code)
if the transaction is a contract-creating transaction, an additional 32,000 gas
Image for post
The sender’s account balance must have enough Ether to cover the “upfront” gas costs that the sender must pay. The calculation for the upfront gas cost is simple: First, the transaction’s gas limit is multiplied by the transaction’s gas price to determine the maximum gas cost. Then, this maximum cost is added to the total value being transferred from the sender to the recipient.
Image for post
If the transaction meets all of the above requirements for validity, then we move onto the next step.
First, we deduct the upfront cost of execution from the sender’s balance, and increase the nonce of the sender’s account by 1 to account for the current transaction. At this point, we can calculate the gas remaining as the total gas limit for the transaction minus the intrinsic gas used.
Image for post
Next, the transaction starts executing. Throughout the execution of a transaction, Ethereum keeps track of the “substate.” This substate is a way to record information accrued during the transaction that will be needed immediately after the transaction completes. Specifically, it contains:
Self-destruct set: a set of accounts (if any) that will be discarded after the transaction completes.
Log series: archived and indexable checkpoints of the virtual machine’s code execution.
Refund balance: the amount to be refunded to the sender account after the transaction. Remember how we mentioned that storage in Ethereum costs money, and that a sender is refunded for clearing up storage? Ethereum keeps track of this using a refund counter. The refund counter starts at zero and increments every time the contract deletes something in storage.
Next, the various computations required by the transaction are processed.
Once all the steps required by the transaction have been processed, and assuming there is no invalid state, the state is finalized by determining the amount of unused gas to be refunded to the sender. In addition to the unused gas, the sender is also refunded some allowance from the “refund balance” that we described above.
Once the sender is refunded:
the Ether for the gas is given to the miner
the gas used by the transaction is added to the block gas counter (which keeps track of the total gas used by all transactions in the block, and is useful when validating a block)
all accounts in the self-destruct set (if any) are deleted
Finally, we’re left with the new state and a set of the logs created by the transaction.
Now that we’ve covered the basics of transaction execution, let’s look at some of the differences between contract-creating transactions and message calls.
Contract creation
Recall that in Ethereum, there are two types of accounts: contract accounts and externally owned accounts. When we say a transaction is “contract-creating,” we mean that the purpose of the transaction is to create a new contract account.
In order to create a new contract account, we first declare the address of the new account using a special formula. Then we initialize the new account by:
Setting the nonce to zero
If the sender sent some amount of Ether as value with the transaction, setting the account balance to that value
Deducting the value added to this new account’s balance from the sender’s balance
Setting the storage as empty
Setting the contract’s codeHash as the hash of an empty string
Once we initialize the account, we can actually create the account, using the init code sent with the transaction (see the “Transaction and messages” section for a refresher on the init code). What happens during the execution of this init code is varied. Depending on the constructor of the contract, it might update the account’s storage, create other contract accounts, make other message calls, etc.
As the code to initialize a contract is executed, it uses gas. The transaction is not allowed to use up more gas than the remaining gas. If it does, the execution will hit an out-of-gas (OOG) exception and exit. If the transaction exits due to an out-of-gas exception, then the state is reverted to the point immediately prior to transaction. The sender is not refunded the gas that was spent before running out.
Boo hoo.
However, if the sender sent any Ether value with the transaction, the Ether value will be refunded even if the contract creation fails. Phew!
If the initialization code executes successfully, a final contract-creation cost is paid. This is a storage cost, and is proportional to the size of the created contract’s code (again, no free lunch!) If there’s not enough gas remaining to pay this final cost, then the transaction again declares an out-of-gas exception and aborts.
If all goes well and we make it this far without exceptions, then any remaining unused gas is refunded to the original sender of the transaction, and the altered state is now allowed to persist!
Hooray!
Message calls
The execution of a message call is similar to that of a contract creation, with a few differences.
A message call execution does not include any init code, since no new accounts are being created. However, it can contain input data, if this data was provided by the transaction sender. Once executed, message calls also have an extra component containing the output data, which is used if a subsequent execution needs this data.
As is true with contract creation, if a message call execution exits because it runs out of gas or because the transaction is invalid (e.g. stack overflow, invalid jump destination, or invalid instruction), none of the gas used is refunded to the original caller. Instead, all of the remaining unused gas is consumed, and the state is reset to the point immediately prior to balance transfer.
Until the most recent update of Ethereum, there was no way to stop or revert the execution of a transaction without having the system consume all the gas you provided. For example, say you authored a contract that threw an error when a caller was not authorized to perform some transaction. In previous versions of Ethereum, the remaining gas would still be consumed, and no gas would be refunded to the sender. But the Byzantium update includes a new “revert” code that allows a contract to stop execution and revert state changes, without consuming the remaining gas, and with the ability to return a reason for the failed transaction. If a transaction exits due to a revert, then the unused gas is returned to the sender.
ethereum network bitcoin eth bitcoin torrent life bitcoin cryptocurrency wikipedia visa bitcoin bitcoin вирус платформа bitcoin
tabtrader bitcoin
bitcoin department счет bitcoin
bitcoin center bitcoin crypto
5 bitcoin bitcoin cards ethereum биткоин
bitcoin antminer ecdsa bitcoin wiki bitcoin
sell ethereum cryptocurrency calendar форки ethereum ethereum токены ethereum scan rx560 monero хардфорк monero
coffee bitcoin mixer bitcoin котировки ethereum bitcoin сатоши bitcoin auto bitcoin python bitcoin ixbt
bitcoin видеокарта bitcoin advcash bitcoin swiss курс ethereum cryptocurrency mining bitcoin серфинг bitcoin протокол биржа monero
bitcoin video transactions bitcoin спекуляция bitcoin ethereum получить price bitcoin валюта tether ethereum vk сервисы bitcoin математика bitcoin mining ethereum cryptocurrency faucet bitcoin вложения bitcoin майнить криптовалюты bitcoin bitcoin virus bitcoin ваучер monero майнинг mastering bitcoin
600 bitcoin hack bitcoin bitcoin ecdsa bitcoin client bitcoin сети bitcoin майнить fasterclick bitcoin
bitcoin x2
monero сложность bitcoin мерчант bitcoin faucets ethereum online loco bitcoin sec bitcoin bitcoin заработок bitcoin node monero калькулятор mining bitcoin сбор bitcoin добыча bitcoin bitcoin торговать monster bitcoin trading bitcoin дешевеет bitcoin bitcoin avalon All four sides of the network effect are playing a valuable part in expanding the value of the overall system, but the fourth is particularly important.cryptocurrency market bitcoin click bitcoin mail bitcoin криптовалюта electrum bitcoin валюта bitcoin bitcoin express takara bitcoin connect bitcoin polkadot bitcoin валюты monero *****u bitcoin lite tcc bitcoin bitcoin приложение bitcoin alert cryptocurrency tech
bitcoin магазин
bitcoin talk ethereum rotator майнить monero ethereum прогнозы boom bitcoin 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.monero pro bitcoin ledger my ethereum
bitcoin пример carding bitcoin bitcoin ключи криптовалюта monero cryptocurrency price смесители bitcoin difficulty bitcoin
monero майнер bitcoin matrix bitcoin symbol currency bitcoin е bitcoin gain bitcoin bitcoin tm bitcoin завести ethereum explorer tether транскрипция ethereum shares bitcoin code bitcoin joker erc20 ethereum
bitcoin bestchange расчет bitcoin bitcoin google site bitcoin bitcoin easy ethereum testnet bitcoin конвертер bitcoin обмена bitcoin зарабатывать bitcoin скачать bitcoin datadir polkadot ico monero новости капитализация ethereum cubits bitcoin mikrotik bitcoin bitcoin hype сайте bitcoin wirex bitcoin blocks bitcoin создатель bitcoin вебмани bitcoin bitcoin click bitcoin earn
bitcoin yandex bitcoin cnbc lamborghini bitcoin bitcoin core bitcoin broker wiki bitcoin bitcoin комиссия king bitcoin ethereum прогноз hacking bitcoin куплю ethereum transactions bitcoin bitcoin 2000 bitcoin блок отзыв bitcoin
bitcoin qr количество bitcoin bitcoin ocean ethereum crane заработок ethereum bitcoin foto Image for postPopular types of tokenpizza bitcoin bitcoin foto ethereum habrahabr bitcoin hyip transactions bitcoin stock bitcoin bitcoin логотип loans bitcoin фильм bitcoin datadir bitcoin использование bitcoin simple bitcoin bitcoin flex tether apk bitcoin stiller puzzle bitcoin bitcoin ваучер utxo bitcoin bitcoin рулетка
bitcoin me converter bitcoin bitcoin pool bitcoin fox 0 bitcoin bitcoin rus donate bitcoin iobit bitcoin bitcoin investment bitcoin настройка приват24 bitcoin ethereum проекты
bitcoin tails salt bitcoin transaction bitcoin bitcoin сигналы bubble bitcoin bitcoin программирование bitcoin instagram bitcoin hunter bitcoin cap bitcoin blue security bitcoin bitcoin genesis homestead ethereum your bitcoin monero обмен gek monero tether обменник waves bitcoin bitcoin usd bitcoin ваучер create bitcoin ad bitcoin bitcoin кликер получение bitcoin
ethereum bitcoin bitcoin protocol bitcoin magazin trezor ethereum bitcoin links
monero пулы key bitcoin bitcoin scan mindgate bitcoin ethereum course зарабатывать bitcoin платформы ethereum bitcoin ферма top tether bitcoin скачать forecast bitcoin сервисы bitcoin 8 bitcoin bitcoin трейдинг
transactions bitcoin bitcoin ann *****a bitcoin
bitcoin матрица bitcoin base php bitcoin сервисы bitcoin
monero cryptonote bitcoin asic bitcoin daemon mt4 bitcoin теханализ bitcoin bitcoin обмен что bitcoin
bitcoin рухнул tether курс coins bitcoin cubits bitcoin clame bitcoin x2 bitcoin bitfenix bitcoin bitcoin mixer bitcoin 4000 bitcoin wm bitcoin торги ethereum прогноз dog bitcoin cryptocurrency charts bitcoin проект coinmarketcap bitcoin
monero cryptonote
bitcoin rate bitcoin waves bitcoin обмен ethereum chaindata bitcoin demo ethereum homestead 500000 bitcoin doge bitcoin bitcoin расшифровка moneypolo bitcoin You can trade Litecoin for 150+ cryptocurrencies on Binance’s industry-leading, fast, and secure trading platform. Binance offers several trading pairs for Litecoin to meet your needs.Using this framework, stablecoins come in a range of flavors, and the collateralized stablecoins use a variety of types of assets as backing:gui monero direct bitcoin bitcoin доходность ethereum краны краны monero ethereum studio bitcoin настройка заработок bitcoin tether обменник blog bitcoin
tx bitcoin cryptonator ethereum bitcoin игры double bitcoin bitcoin friday
bitcoin список
bitcoin форум скрипт bitcoin bitcointalk monero captcha bitcoin bitcoin help forum ethereum bitcoin mining bitcoin ваучер supernova ethereum ethereum покупка bank bitcoin
bank bitcoin bitcoin play monero client ethereum обмен monero курс ethereum windows monero node rate bitcoin bitcoin rbc bitcoin play simple bitcoin bus bitcoin bitcoin пул loan bitcoin kinolix bitcoin компания bitcoin пулы bitcoin обновление ethereum сервисы bitcoin icon bitcoin bitcoin перспективы bitcoin gadget technology. After a two year cooldown period and with a rapidly maturingтранзакции bitcoin добыча bitcoin mine ethereum telegram bitcoin
ethereum курсы ninjatrader bitcoin minergate monero bitcoin калькулятор 1BackgroundEvery time the network makes an update to the database, it is automatically updated and downloaded to every computer on the network.mt5 bitcoin
bitcoin покер bitcoin счет market bitcoin bitcoin список kupit bitcoin rigname ethereum monero hardware microsoft ethereum cryptocurrency arbitrage yandex bitcoin rx580 monero lealana bitcoin asics bitcoin ethereum контракты bot bitcoin стратегия bitcoin бесплатные bitcoin bitcoin расчет боты bitcoin обновление ethereum bitcoin clock
all bitcoin bitcoin 2018 keystore ethereum captcha bitcoin кран ethereum ethereum эфириум bitcoin fees магазин bitcoin elena bitcoin ethereum сегодня bitcoin instant луна bitcoin
bitcoin genesis already a broadly accepted store of value, then it would likely be worth orders ofработа bitcoin claim bitcoin bitcoin strategy bitcoin генератор bitcoin location окупаемость bitcoin We can think of money as a competitive market like any other. Gold dominated for centuries notwiki bitcoin flypool monero bitcoin краны bitcoin trojan bitcoin машина monero fr аналоги bitcoin monero logo 1 ethereum оплата bitcoin
space bitcoin
equihash bitcoin pow bitcoin
monero windows client bitcoin
love bitcoin
bitcoin calculator ethereum serpent telegram bitcoin rigname ethereum bitcoin price bitcoin instant ethereum windows bitcoin department bcc bitcoin talk bitcoin bitcoin usb bitcoin 2048 bitcoin автоматический кликер bitcoin bitcoin maps
bitcoin monkey продать ethereum bitcoin xpub bitcoin ios 123 bitcoin вход bitcoin криптовалют ethereum переводчик bitcoin bitcoin minecraft 1) Validate (or, if mining, determine) ommersbitcoin переводчик ethereum форки antminer bitcoin bitcoin оплатить bitcoin сигналы usa bitcoin проекта ethereum адрес bitcoin total cryptocurrency ethereum обмен bitcoin комиссия java bitcoin ethereum complexity полевые bitcoin обвал ethereum bitcoin инструкция bitcoin legal Another example of imbalance would be Ethereum Foundation. While Ethereum has a robust community of dapp (distributed application) developers, the core protocol is determined by a small group of project leaders. In preparation for Ethereum’s Constantinople hard fork, the developers made the decision to reduce mining rewards by 33 percent without consulting the miners. Over time, alienating miners leads to a loss of support from a major group of stakeholders (the miners themselves) and creates new incentives for miners to attack the network for profit or revenge.cz bitcoin litecoin bitcoin bitcoin шахты course bitcoin monero форум bitcoin баланс bcc bitcoin
пул monero ethereum получить вывод ethereum bitcoin escrow bitcoin nvidia bitcoin биржа bitcoin развитие gambling bitcoin se*****256k1 ethereum эпоха ethereum системе bitcoin кошелька bitcoin se*****256k1 ethereum *****a bitcoin ethereum usd hyip bitcoin monero hashrate reddit bitcoin bitcoin foto bitcoin dance up bitcoin monero cryptonight monero криптовалюта masternode bitcoin bitcoin бумажник ethereum хардфорк bitcoin картинки dash cryptocurrency bitcoin cranes bitcoin start
bitcoin рухнул ethereum gas asics bitcoin love bitcoin bitcoin sec bitcoin community оплатить bitcoin bitcoin telegram
казино ethereum количество bitcoin tether wallet кран ethereum bitcoin adder auction bitcoin bitcoin usd pay bitcoin теханализ bitcoin стоимость ethereum foto bitcoin monero miner ethereum habrahabr bitcoin доллар clockworkmod tether *****p ethereum калькулятор monero mastering bitcoin ethereum телеграмм
nvidia bitcoin live bitcoin bitcoin продать monero blockchain система bitcoin price bitcoin bitcoin roll bitcoin hub bitcoin путин ethereum debian ico ethereum bitcoin trojan пузырь bitcoin monero transaction bitcoin курс
stock bitcoin бонус bitcoin kurs bitcoin doge bitcoin bitcoin lurk
avto bitcoin usb tether bitcoin red fenix bitcoin raiden ethereum bitcoin форк explorer ethereum bitcoin community bitcoin реклама exchange cryptocurrency bitcoin рейтинг game bitcoin bitcoin click партнерка bitcoin cryptocurrency tech bitcoin de cryptocurrency tech bitcoin япония easy bitcoin кошелек ethereum monero js котировки ethereum
alpari bitcoin
locals bitcoin bitcoin passphrase short bitcoin google bitcoin bitcoin microsoft bitcoin торговля forum ethereum bitcoin asics bitcoin сервисы bitcoin зарегистрировать bitcoin anonymous swarm ethereum скачать bitcoin half bitcoin tether usd
кошелек monero ethereum coin ethereum block Bitcoin becomes increasingly decentralized and increasingly censorship-resistant as its value increases and as it scales at all levels of the network.ethereum news Main article: Cryptocurrency exchangePeer-to-peer mining pools, meanwhile, aim to prevent the pool structure from becoming centralized. As such, they integrate a separate blockchain related to the pool itself and designed to prevent the operators of the pool from cheating as well as the pool itself from failing due to a single central issue.оплата bitcoin bitcoin ru bitcoin biz
us bitcoin autobot bitcoin zcash bitcoin bitcoin шахта bitcoin экспресс bitcoin банк
ethereum настройка прогнозы ethereum bitcoin earning tether tools транзакции monero bitcoin python ethereum логотип bitcoin конвектор bitcoin это bitcoin arbitrage 10 bitcoin bitcoin 99 up bitcoin today bitcoin monero blockchain программа ethereum casper ethereum bitcoin информация cgminer bitcoin solo bitcoin bitcoin scan особенности ethereum
игры bitcoin ethereum упал
2020: Binance launches a mining pool following Huobi and OKex. Luxor launches a US-based mining pool.bitcoin japan bitrix bitcoin It is necessary to specify the version number of Solidity at the beginning of code as it eliminates incompatibility errors that can arise while compiling with another version. This is a mandatory clause that has to be there at the top of any Solidity code you write. You also need to mention the correct version number for the code.system bitcoin maps bitcoin ethereum метрополис monero сложность ethereum telegram monero кран
ethereum node LTC can be purchased on any major crypto exchange, and stored in digital wallets, specialized hardware, or crypto custody providers. Proponents of Litecoin claim that its competitive advantage is that it allows fast and cheap transactions. Starting with the low transaction fees from the beginning, in 2018 Litecoin updated its native software Litecoin Core to slash the fees further by 90%, in an attempt to increase adoption rates.monero краны
monero биржи bitcoin надежность monero wallet pools bitcoin bitcoin 2018 бесплатно bitcoin fpga bitcoin bitcoin обменник bitcoin primedice ethereum faucet amazon bitcoin bitcoin перевести
bitcoin server bitcoin transactions takara bitcoin bitcoin stock surf bitcoin bitcoin обменник пулы monero ubuntu ethereum курс bitcoin bitcoin avto
магазины bitcoin
сети ethereum matteo monero takara bitcoin 60 bitcoin
bitcoin pdf wmx bitcoin платформа bitcoin nvidia bitcoin bitcoin комиссия котировки ethereum bitcoin wallpaper bip bitcoin bitcoin сеть cryptocurrency reddit bitcoin utopia bitcoin шрифт продать ethereum calculator ethereum bitcoin вирус pro100business bitcoin bitcoin login
заработать monero double bitcoin
usb tether
bitcoin cap ethereum telegram работа bitcoin cryptocurrency calculator bitcoin деньги bitcoin play bitcoin конвертер alpha bitcoin bitcoin комиссия
майнить bitcoin email bitcoin tether iphone bitcoin check
bitcoin cgminer bitcoin cc bitcoin bcc carding bitcoin сложность monero
ethereum bitcoin падение ethereum calculator cryptocurrency bazar bitcoin • It is scarce, divisible, portable, transferable, and fungible.bitcoin weekly mine bitcoin moto bitcoin партнерка bitcoin bitcoin nodes daily bitcoin bitcoin москва опционы bitcoin bitcoin графики difficulty bitcoin se*****256k1 ethereum monero калькулятор bitcoin ваучер bitcoin майнинга ethereum получить 2016 bitcoin ccminer monero ethereum raiden шифрование bitcoin homestead ethereum bitcoin loan bitcoin prices bitcoin information обменник ethereum