EVM Tracing | go-ethereum (2024)

Tracing allows users to examine precisely what was executed by the EVM during some specific transaction or set of transactions. There are two different types of transactions in Ethereum: value transfers and contract executions. A value transfer just moves ETH from one account to another. A contract interaction executes some code stored at a contract address which can include altering stored data and transacting multiple times with other contracts and externally-owned accounts. A contract execution transaction can therefore be a complicated web of interactions that can be difficult to unpick. The transaction receipt contains a status code that shows whether the transaction succeeded or failed, but more detailed information is not readily available, meaning it is very difficult to know what a contract execution actually did, what data was modified and which addresses were touched. This is the problem that EVM tracing solves. Geth traces transactions by re-running them locally and collecting data about precisely what was executed by the EVM.

Also see this Devcon 2022 talk on tracing in Geth.

State availability

In its simplest form, tracing a transaction entails requesting the Ethereum node to reexecute the desired transaction with varying degrees of data collection and have it return an aggregated summary. In order for a Geth node to reexecute a transaction, all historical state accessed by the transaction must be available. This includes:

  • Balance, nonce, bytecode and storage of both the recipient as well as allinternally invoked contracts.
  • Block metadata referenced during execution of both the outer as well as allinternally created transactions.
  • Intermediate state generated by all preceding transactions contained in thesame block as the one being traced.

This means there are limits on the transactions that can be traced imposed by the synchronization and pruning configuration of a node:

  • An archive node retains all historical data back to genesis. It can therefore trace arbitrary transactions at any point in the history of the chain. Tracing a single transaction requires reexecuting all preceding transactions in the same block.

  • A node synced from genesis node only retains the most recent 128 block states in memory. Older states are represented by a sequence of occasional checkpoints that intermediate states can be regenerated from. This means that states within the most recent 128 blocks are immediately available, older states have to be regenerated from snapshots "on-the-fly". If the distance between the requested transaction and the most recent checkpoint is large, rebuilding the state can take a long time. Tracing a single transaction requires reexecuting all preceding transactions in the same block and all preceding blocks until the previous stored snapshot.

  • A snap synced node holds the most recent 128 blocks in memory, so transactions in that range are always accessible. However, snap-sync only starts processing from a relatively recent block (as opposed to genesis for a full node). Between the initial sync block and the 128 most recent blocks, the node stores occasional checkpoints that can be used to rebuild the state on-the-fly. This means transactions can be traced back as far as the block that was used for the initial sync. Tracing a single transaction requires reexecuting all preceding transactions in the same block, and all preceding blocks until the previous stored snapshot.

  • A light synced node retrieving data on demand can in theory trace transactions for which all required historical state is readily available in the network. This is because the data required to generate the trace is requested from an les-serving full node. In practice, data availability cannot be reasonably assumed.

This image shows the state stored by each sync-mode - red indicates stored state. The full width of each line represents origin to present head

More detailed information about syncing is available on the sync modes page.

When a trace of a specific transaction is executed, the state is prepared by fetching the state of the parent block from the database. If it is not available, Geth will crawl backwards in time to find the next available state but only up to a limit defined in the reexec parameter which defaults to 128 blocks. If no state is available within the reexec window then the trace fails with Error: required historical state unavailable and the reexec parameter must be increased. If a valid state is found in the reexec window, then Geth sequentially re-executes the transactions in each block between the last available state and the target block. The greater the value of reexec the longer the tracing will take because more blocks have to be re-executed to regenerate the target state.

The debug_getAccessibleStates endpoint is a useful tool for estimating a suitable value for reexec. Passing the number of the block that contains the target transaction and a search distance to this endpoint will return the number of blocks behind the current head where the most recent available state exists. This value can be passed to the tracer as re-exec.

It is also possible to force Geth to store the state for specific sequences of block by stopping Geth, running again with --gcmode archive for some period - this prevents state pruning for blocks that arrive while Geth is running with --gcmode archive.

There are exceptions to the above rules when running batch traces of entire blocks or chain segments. Those will be detailed later.

Types of trace

Basic traces

The simplest type of transaction trace that Geth can generate are raw EVM opcode traces. For every EVM instruction the transaction executes, a structured log entry is emitted, containing all contextual metadata deemed useful. This includes the program counter, opcode name, opcode cost, remaining gas, execution depth and any occurred error. The structured logs can optionally also contain the content of the execution stack, execution memory and contract storage.

Read more about Geth's basic traces on the basic traces page.

Built-in tracers

The tracing API accepts an optional tracer parameter that defines how the data returned to the API call should be processed. If this parameter is omitted the default tracer is used. The default is the struct (or 'opcode') logger. These raw opcode traces are sometimes useful, but the returned data is very low level and can be too extensive and awkward to read for many use cases. A full opcode trace can easily go into the hundreds of megabytes, making them very resource intensive to get out of the node and process externally. For these reasons, there are a set of non-default built-in tracers that can be named in the API call to return different data from the method. Under the hood, these tracers are Go or Javascriptfunctions that do some specific preprocessing on the trace data before it is returned.

More information about Geth's built-in tracers is available on the built-in tracers page.

Custom tracers

In addition to built-in tracers, it is possible to provide custom code that hooks to events in the EVM to process and return data in a consumable format. Custom tracers can be written either in Javascript or Go. JS tracers are good for quick prototyping and experimentation as well as for less intensive applications. Go tracers are performant but require the tracer to be compiled together with the Geth source code. This means developers only have to gather the data they actually need, and do any processing at the source.

More information about custom tracers is available on the custom tracers page.

Summary

This page gave an introduction to the concept of tracing and explained issues around state availability. More detailed information on Geth's built-in and custom tracers can be found on their dedicated pages.

EVM Tracing | go-ethereum (2024)

FAQs

What are EVM traces? ›

Tracing allows users to examine precisely what was executed by the EVM during some specific transaction or set of transactions. There are two different types of transactions in Ethereum: value transfers and contract executions. A value transfer just moves ETH from one account to another.

What is EVM in Blockchain? ›

The Ethereum Virtual Machine (EVM) is the computation engine for Ethereum that manages the state of the blockchain and enables smart contract functionality. The EVM is contained within the client software (e.g., Geth, Nethermind, and more) that you need in order to run a node on Ethereum.

Can Ethereum wallet be traced? ›

Yes, Ethereum transactions are traceable, but they are not that easy to trace. Transactions in Ether are categorized as pseudo-anonymous since tracing the identity of an Ethereum wallet owner or receiver of funds requires extensive chain analysis and data mining.

How does the EVM store data? ›

EVM provides the following four data structures for storing variables: Storage: This is global memory available to all functions within the contract. This storage is a permanent storage that Ethereum stores on every node within its environment. Memory: This is local memory available to every function within a contract.

What is a simple example of EVM? ›

Basic Elements of EVM

For example, if the total scope of work is to install 1000 transmission towers, and 600 of them are installed, the progress of the work is 60% complete. If the total budgeted cost of this work is $3 M, the EV is $3 M x 0,6 = $ 1,8 M.

What is EVM commonly used for? ›

Earned Value Management (EVM) is a project performance management methodology that integrates cost, schedule, technical scope, and risk to assess progress against a baseline, use that information to identify problems, and forecast cost (and, to a certain extent, schedule) at completion.

Is Cardano an EVM? ›

The project has been in constant work since mid-2021 and introduces Cardano's EVM layer, allowing any ADA user to use EVM contracts directly from any Cardano wallet. Claim the JACKPOT with 55 FREE SPINS. Signup today to redeem your bonus.

Which blockchain uses EVM? ›

EVM (or the 'Ethereum Virtual Machine') is a software environment that executes smart contracts on the Ethereum blockchain. It is the backbone of the Ethereum network, responsible for executing all operations and transactions on the blockchain.

Can a crypto wallet be traced to a person? ›

Because someone's wallet address does not have to be anonymous but can be hard to find, a Bitcoin wallet address is called a pseudonym, an alias, which is different from someone's actual name. The data is not linked to an identity, but it is still possible to trace someone's identity or a pseudonym.

Can the government track Ethereum transactions? ›

The IRS can track cryptocurrency transactions through several methods, including the use of subpoenas, blockchain analysis, and third-party reporting by cryptocurrency exchanges.

Can the government track Ethereum? ›

Can the IRS track anonymous wallets? Because cryptocurrency transactions are pseudo-anonymous, many investors believe that they cannot be traced. This is not true. Transactions on blockchains like Bitcoin and Ethereum are publicly visible.

Which wallet is EVM? ›

EternalWallet: EVM Wallet (BSC, ETH + more) Web3 wallet with multi-chain support (ETH, BSC, AVAX, CANTO + more)' Send funds using web3 Domain names in the wallet input section and also allow access to web3 hosted websites on IPFS using Web3 domain names created on the Binance Smart Chain (BSC).

Is MetaMask an EVM wallet? ›

MetaMask has long been the dominant player in the EVM wallet space, with over 10 million monthly active users. Its compatibility with essential ConsenSys developer tools like Truffle, Hardhat, and Infura has made it the go-to wallet for developers and users alike.

Who owns EVM? ›

Sabu Johny - Owner - E V M Motors | LinkedIn.

Why not to use EVM? ›

EVM calculations are based on detailed and accurate upfront planning that doesn't exist in agile project. EVM ignores the delivery of business benefits. EVM misuses the term “value” In reality, no value is delivered until the customer receives the working solution.

What are the three key EVM metrics? ›

EVM is built on three metrics: Planned value, earned value, and actual cost. Think of these metrics in terms of your project budget and schedule.

What are EVM tools? ›

Earned value management (EVM) software helps companies monitor the performance of complex and costly projects. This type of software defines a baseline for performance, which is then used to monitor the earned value (or the business value generated by projects).

Why is EVM widely popular in blockchain? ›

EVM compatibility has enabled many popular Layer 1 blockchains, including Avalanche, Binance Smart Chain, Polygon, Solana, Harmony and Fantom, to become highly successful by reducing the barriers to entry for application developers to deploy smart contracts on these new chains due to the code being compatible with the ...

What are the most important EVM metrics? ›

The three main and critical EVM metrics are planned value, actual cost and earned value.

Is Solana an EVM chain? ›

By being non-EVM based, this means that Solana has its own set of token standards, dev tools, infrastructure, etc., for dApp development. This also means that the majority of the Ethereum-compliant tools and standards cannot be used on the Solana network.

Is Polkadot an EVM chain? ›

Polkadot is another blockchain platform that is on the rise alongside the likes of Avalanche and Binance Smart Chain. However, it's a bit different from most of the chains we've previously discussed as it's not technically EVM-compatible.

Does Solana have an EVM? ›

Yes, the Solana blockchain network is EVM compatible using Solana EVMs like the EVM built by Neon Labs.

Is Coinbase an EVM wallet? ›

Coinbase Wallet supports Ethereum and all EVM-compatible networks in both the mobile app and browser extension.

How many EVM blockchains are there? ›

EVM-based blockchains

You might be surprised, but there are now 100s of EVM blockchains or Ethereum-like networks that support smart contracts. All these layer 1, layer 2 chains are fully compatible with EVM and are essentially forks of Ethereum.

What are the top 10 EVM chains? ›

The top 10 EVM-compatible chains are Binance Smart Chain, Oasis Network, Avalanche, Cardano, Solana, Polygon, Fantom, Harmony, HECO, and Arbitrum.

What is the largest EVM blockchain? ›

Ethereum (ETH)

Advantages: Largest and most established EVM-compatible blockchain. Robust developer community and ecosystem. High level of security due to extensive network decentralization.

What is the fastest EVM based blockchain? ›

HyperonChain is world's fastest & truly decentralized community-run EVM based blockchain technology which works on Delegated Proof of Stake (DPoS) consensus algorithm powering crypto currency HyperonChain (HPN) and platform for various decentralized applications.

Does Bitcoin have EVM? ›

First things first: The short answer is that Bitcoin and Ethereum (and, by extension, EVM-compatible networks) are not interoperable.

Which crypto is not traceable? ›

Is There an Untraceable Cryptocurrency? There are several cryptocurrencies that claim to be completely anonymous and untraceable, such as Monero, Zcash and Bytecoin.

Can the FBI trace Bitcoin? ›

At the basis of cryptocurrencies like Bitcoin (BTC) stands blockchain technology. A fundamental characteristic of blockchain technology is transparency, meaning that anyone, including the government, can observe all cryptocurrency transactions conducted via that blockchain.

How do I make crypto transactions untraceable? ›

How to accept Bitcoin anonymously – 5 simple practices
  1. Best practices for anonymous Bitcoin transactions.
  2. Tip number 1: Tor – The Onion Router.
  3. Tip number 2: VPN – Virtual Private Network.
  4. Tip number 3: Generating new addresses.
  5. Tip number 4: Lightning Network for small transactions.
Oct 19, 2022

Can the IRS see my crypto wallet? ›

Yes, the IRS can track cryptocurrency, including Bitcoin, Ether and a huge variety of other cryptocurrencies. The IRS does this by collecting KYC data from centralized exchanges.

Will the IRS know if I don't report crypto? ›

If, after the deadline to report and any extensions have passed, you still have not properly reported your crypto gains on Form 8938, you can face additional fines and penalties. After an initial failure to file, the IRS will notify any taxpayer who hasn't completed their annual return or reports.

Why does the IRS ask if I bought cryptocurrency? ›

The answer is that cryptocurrency is considered property, so it's taxed by the IRS in the same way that other capital assets are taxed.

What happens if you don t report crypto gains? ›

If you don't report taxable crypto activity and face an IRS audit, you may incur interest, penalties, or even criminal charges. It may be considered tax evasion or fraud, said David Canedo, a Milwaukee-based CPA and tax specialist product manager at Accointing, a crypto tracking and tax reporting tool.

How do I cash out crypto without paying taxes USA? ›

Take out a cryptocurrency loan

Instead of cashing out your cryptocurrency, consider taking out a cryptocurrency loan. In general, loans are considered tax-free. If you need liquidity immediately, you should consider using your cryptocurrency as collateral to take a loan through a decentralized protocol.

What happens when all 21 million bitcoins are mined? ›

What Happens to Mining Fees When Bitcoin's Supply Limit Is Reached? Bitcoin mining fees will disappear when the Bitcoin supply reaches 21 million. After that, miners will likely earn income only from transaction processing fees rather than a combination of block rewards and transaction fees.

Is EVM the future? ›

The future of EVM is bright, with growing adoption and exciting developments on the horizon. For instance, with other blockchains using a common base such as EVM, interoperability is becoming easier. For instance, developers can easily create dApps compatible with multiple blockchains at once.

Is EVM an ERC20? ›

Just like other Ethereum tokens, ERC20 tokens are implemented as smart contracts and executed on the Ethereum Virtual Machine (EVM) in a decentralized manner.

How does Ethereum EVM work? ›

In short, Ethereum Virtual Machine is a program which executes scripts used to implement certain operations usually in Ethereum blockchain. The EVM requires that one has access over any network node so as to be able to execute the desired commands and create new tokens on the blockchain without any difficulties.

How do I find my EVM wallet address? ›

How do I check my Wallet's Eth/Solana/EVM address? Under 'Receive assets' the alphanumeric string is your wallet address.

Which wallet is best for Solana and EVM? ›

The best wallet for Solana
  • Best all round wallet: Backpack Wallet.
  • Best mobile wallet: Solflare Wallet offering great support for hardware wallets like Ledger on iOS + Android.
  • Best wallet for staking: Backpack Wallet amazing support for staking via xNFTs.

Does MetaMask own my wallet? ›

MetaMask allows users to connect to blockchain applications and explore the decentralized web securely. The wallet is non-custodial, giving users sole custody of their private keys.

What is the difference between Ethereum and EVM? ›

The Ethereum Virtual Machine (EVM) is the computation engine for Ethereum that manages the state of the blockchain and enables smart contract functionality. The EVM is contained within the client software (e.g., Geth, Nethermind, and more) that you need in order to run a node on Ethereum.

Is trust wallet an EVM wallet? ›

Trust Wallet App Links to All EVM Networks

Trust Wallet has opened the door to more networks than ever by adding the ability to link with any EVM-compatible network through the mobile app.

Is Binance an EVM? ›

Binance Smart Chain (BSC) is an EVM-compatible chain built by Binance, one of the largest crypto exchanges in the world.

What is an example of EVM wallet? ›

Bitpie is one of the most well-known EVM wallet types. It is a crypto wallet with multiple functions. It can help open the world of DeFi to a user through its integrated DApp browser. Secondly, the Bitcoin Lightning Network integrated into it can be used to access faster and cheaper BTC transactions.

How to read EVM data? ›

A value greater than 1 is typically good (it indicates your cost to date is less than planned) and a value less than 1 is typically bad (it indicates your cost to date is more than planned). A value of 1 indicates you are on plan. A value greater than 1 is typically good (it indicates your are ahead of schedule vs.

What does EVM stand for? ›

Electronic Voting Machine - Election Commission of India.

How do you track earned value? ›

Earned value can be computed this way : Eearned Value = Percent complete (actual) x Task Budget. For example, if the actual percent complete is 50% and the task budget is $10,000 then the earned value of the project is $5,000, 50% of the budget provided for this project.

Why is it difficult to use EVM? ›

EVM is Based on Detailed Planning Upfront. One of the biggest problems with EVM is that it is all based on having detailed plans upfront. And not having too much change which doesn't fit with agile initiatives.

What are the 3 earned value methods? ›

Unlike traditional management, in the Earned Value Method there are three data sources: Planned value – PV; Actual value – AV; the earned value of the concrete work already completed.

Is MetaMask an EVM? ›

MetaMask is a popular browser-based wallet for Ethereum and EVM-compatible blockchains that makes it easy to store and use tokens across several networks.

Top Articles
Houston Home Loan | Best Mortgage Company
Buying A House In 2024: A Step-By-Step Guide | Bankrate
Po Box 7250 Sioux Falls Sd
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Tesla Supercharger La Crosse Photos
Kokichi's Day At The Zoo
Kansas Craigslist Free Stuff
Shorthand: The Write Way to Speed Up Communication
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
Acbl Homeport
123 Movies Babylon
Mercy MyPay (Online Pay Stubs) / mercy-mypay-online-pay-stubs.pdf / PDF4PRO
Springfield Mo Craiglist
Love In The Air Ep 9 Eng Sub Dailymotion
Midlife Crisis F95Zone
065106619
Craftology East Peoria Il
Eva Mastromatteo Erie Pa
Palm Coast Permits Online
Bj Alex Mangabuddy
Best Nail Salons Open Near Me
What Is The Lineup For Nascar Race Today
Jordan Poyer Wiki
Prot Pally Wrath Pre Patch
Walmart Pharmacy Near Me Open
Beaufort 72 Hour
Bleacher Report Philadelphia Flyers
4Oxfun
JVID Rina sauce set1
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Ou Football Brainiacs
Miles City Montana Craigslist
Hrconnect Kp Login
Angel Haynes Dropbox
Publix Christmas Dinner 2022
Mini-Mental State Examination (MMSE) – Strokengine
Motor Mounts
Kamzz Llc
4083519708
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
Kutty Movie Net
6576771660
30 Years Of Adonis Eng Sub
Port Huron Newspaper
Devotion Showtimes Near Showplace Icon At Valley Fair
Headlining Hip Hopper Crossword Clue
552 Bus Schedule To Atlantic City
Germany’s intensely private and immensely wealthy Reimann family
Roller Znen ZN50QT-E
Sam's Club Fountain Valley Gas Prices
Latest Posts
Article information

Author: Carmelo Roob

Last Updated:

Views: 5634

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.