Close Menu
Altcoin ObserverAltcoin Observer
  • Regulation
  • Bitcoin
  • Altcoins
  • Market
  • Analysis
  • DeFi
  • Security
  • Ethereum
Categories
  • Altcoins (1,195)
  • Analysis (1,395)
  • Bitcoin (1,970)
  • Blockchain (1,140)
  • DeFi (1,352)
  • Ethereum (1,355)
  • Event (50)
  • Exclusive Deep Dive (1)
  • Landscape Ads (2)
  • Market (1,396)
  • Reddit (621)
  • Regulation (1,298)
  • Security (1,864)
  • Thought Leadership (1)
  • Uncategorized (3)
  • Videos (39)
Hand picked
  • Strategy’s Infinite Money Glitch Is The Corporate Cheat Code of the Decade
  • The former CEO of Coinbase in Germany joins Lukso, aims to break the grip of Big Tech on the autonomy of the creator
  • Synthetix offers a $ 27 million chip exchange to acquire the derive option platform
  • Chaincin in the mist – an overthrow of $ 15.85 can erase the path
  • The former CEO of Coinbase Germany joins Lukso as a COO to accelerate traditional web3 adoption
We are social
  • Facebook
  • Twitter
  • Instagram
  • YouTube
Facebook X (Twitter) Instagram
  • About us
  • Disclaimer
  • Terms of service
  • Privacy policy
  • Contact us
Facebook X (Twitter) Instagram YouTube LinkedIn
Altcoin ObserverAltcoin Observer
  • Regulation
  • Bitcoin
  • Altcoins
  • Market
  • Analysis
  • DeFi
  • Security
  • Ethereum
Events
Altcoin ObserverAltcoin Observer
Home»Ethereum»Go Jit-Evm D’Ethereum | Ethereum Foundation Blog
Ethereum

Go Jit-Evm D’Ethereum | Ethereum Foundation Blog

April 12, 2025No Comments6 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Eth org.jpeg
Share
Facebook Twitter LinkedIn Pinterest Email


The Ethereum virtual machine is a little different from most other virtual machines. In my previous post I have already explained how it is used and described some of its characteristics.

The Ethereum virtual machine (EVM) is a simple but powerful complete 256 -bit virtual machine that allows anyone to execute arbitrary EVM byte code.

The Go-Ethereum project contains two implementations of the EVM. A simple and simple VM of the byte code And a more sophisticated Jit-vm. In this article, I will explain some of the differences between the two implementations and describe some of the characteristics of the JIT EVM and why it can be so much faster than the EVM of the byte code.

Go-etreum’s virtual bytes code

The interns of the EVM are quite simple; He has a unique loop that will try to execute the instruction at present Program counter (PC in short). In this loop, the Gas is calculated for each instruction, the memory is extended if necessary and performs the instruction if the preamble succeeds. This will continue until the virtual machine ends free of charge or returns with an error by launching an exception (for example out of gas).

for op = contract(pc) {

    if !sufficientGas(op) {

        return error("insufficient gas for op:", or)

    }
    switch op {

    case ...:

        /* execute */

    case RETURN:

        return memory(stack(-1), stack(-2))

    }

    pc++

}

At the end of the execution loop, the program counter obtains the increasing to execute the following instructions and continues to do so until it is finished.

EVM has another way of change program compensation through something called leap-instructions (LEAP & JUCI). Instead of leaving the program’s increment (PC ++), the EVM can also move to arbitrary positions in the contract code. The EVM knows two jump instructions, a normal jump that can be read as “Jump in position X“And a conditional jump that has read like”jump to position X if the condition is true». When such a jump occurs, he must always land on a jump. If the program lands on an instruction other than a jumping destination, the program fails – in other words, for a jump to be valid, it must always be followed by a jump instruction if the condition has given true.

Before executing any Ethereum program, the EVM itery on the code and finds all the possible jumping distains, it then puts them on a card which can be referenced by the program counter to find them. Whenever the EVM meets jump instructions, the validity of the jump is verified.

As you can see, the execution code is relatively easy and simply interpreted by the virtual byte code machine, we can even conclude that by its simplicity, it is actually quite stupid.

Welcome Jit VM

JIT-EVM adopts a different approach to the execution of the EVM byte code and is by definition initially slower than the virtual machine of the byte code. Before the virtual machine can execute any code, it must first compile The byte code in components that can be understood by the Jit virtual machine.

The initialization and execution procedure is done in 3 steps:

  1. We check if there is a jit program ready to be executed using the hash code –H (C) is used as an identifier to identify the program;
  2. If a program was found, we execute the program and refer the result;
  3. If no program has been found, we execute the byte code And We comply a jit program in the background.

At the start, I tried to check if the JIT program had finished the compilation and move the execution to the JIT – all this occurred during the execution in the same loop using Go’s atomic Package – Unfortunately, it turned out to be slower than letting the virtual byte code machine run and use the JIT program for each sequential call once the program compilation is completed.

By compiling the byte code in the logical parts, the JIT has the capacity to analyze the code more precisely and to optimize where and whenever necessary.

For example, an incredible simple optimization that I made was to compile several push operation in a single instruction. Let’s take the CALL instruction; The call requires 7 push instructions-that is to say gas, address, value, entry, entry size, return-off, return and return-size-before running it, and what I did instead of making a loop via these 7 instructions, executing them one by one, I optimized by taking the 7 instructions and adding the 7 values ​​in a single tranche. Now, whenever the to start Of the 7 push instructions are executed, he rather performs the only optimized instruction by immediately adding the static edge to the VM battery. Now, of course, it only works for static values ​​(that is to say Push 0x10), But these are much present in the code.

I also optimized the static jump instructions. Static jumps are jumps that always jump to the same position (that is, Push 0x1, jump) And never change in any case. By determining which jumps are static, we can predict a jump is valid and is within the limits of the contract and if this is the case, we create new instructions which replace both the push And leapinstruction and is reported as valid. This prevents the virtual machine from having two instructions and prevents it from checking if the jump is valid and doing an expensive hash-map search for a valid jump position.

Following steps

A complete analysis of the battery and memory would also adapt to this model where large pieces of code could adapt to unique instructions. In addition, I would like to add Symbolic execution And transform the Jit into an appropriate jit-VM. I think this would be a next logical step once the programs will become large enough to take advantage of these optimizations.

Conclusion

OUr Jit-VM is much smarter than the virtual byte code machine, but is far from completely finished (if ever). There are many other smart tips that we could add with this structure, but are simply not realistic at the moment. The execution time is within the limits of being rapid “reasonable”. That the need arises to further optimize the virtual machine, we have the tools to do so.

More code reading

Published cross of –



Source link

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleWill a 90-day price break from Bitcoin’s longest green race?
Next Article Comtex | API Distribution and news of the press release

Related Posts

Ethereum

Ethereum seems ready to surpass bitcoin in the coming months – the incoming Altsaison?

May 18, 2025
Ethereum

Ethereum went to a crucial meeting at $ 4,000 – here is why

May 18, 2025
Ethereum

Ethereum accumulation accumulates – Smart Money accuses 450K ETH

May 17, 2025
Add A Comment
Leave A Reply Cancel Reply

Single Page Post
Share
  • Facebook
  • Twitter
  • Instagram
  • YouTube
Featured Content
Event

Super Vietnam 2025: Where Blockchain, AI, and Innovation Converge in Southeast Asia’s Rising Tech Powerhouse

May 13, 2025

Vietnam is riding a powerful wave of technological innovation, and Super Vietnam 2025 arrives at…

Event

Istanbul Blockchain Week 2025 Is Back: The Future of Web3 Unfolds in Turkey’s Innovation Hub

May 13, 2025

Leading Web3 marketing agency EAK Digital with official media partner Altcoin Observer is proud to…

1 2 3 … 45 Next
  • Facebook
  • Twitter
  • Instagram
  • YouTube

Synthetix offers a $ 27 million chip exchange to acquire the derive option platform

May 18, 2025

Paraguay Foils Crypto Mining Flight near the Itaipu dam, 3 deportees, 1 decree

May 18, 2025

Shiba Inu Burn Rate Skyrocket, Shib Price Breakout to come?

May 17, 2025
Facebook X (Twitter) Instagram LinkedIn
  • About us
  • Disclaimer
  • Terms of service
  • Privacy policy
  • Contact us
© 2025 Altcoin Observer. all rights reserved by Tech Team.

Type above and press Enter to search. Press Esc to cancel.

bitcoin
Bitcoin (BTC) $ 103,617.76
ethereum
Ethereum (ETH) $ 2,504.24
tether
Tether (USDT) $ 1.00
xrp
XRP (XRP) $ 2.39
bnb
BNB (BNB) $ 644.68
solana
Solana (SOL) $ 169.83
usd-coin
USDC (USDC) $ 1.00
dogecoin
Dogecoin (DOGE) $ 0.220414
cardano
Cardano (ADA) $ 0.756973
tron
TRON (TRX) $ 0.272927