The NEAR development team pulled off a highly complex engineering operation: replacing the execution engine for all smart contracts under the load of the live network. Users noticed nothing, and the network not only maintained its performance but also gained a significant speed boost.
This refers to the replacement of the NearVM virtual machine — a fork of the Wasmer engine that the project had used for many years. As explained by former NEAR core developer Vadim, NearVM was a "private compiler": all updates to the Rust language, security fixes, and new features fell solely on the project team's shoulders. This created a serious "tax" on maintenance and, critically, the risk of missing a vulnerability. According to the expert, the project was once lucky — it accidentally avoided a critical flaw in the original Wasmer simply because it hadn't yet synchronized with the release.
The new foundation became Wasmtime — an industry standard supported by the Bytecode Alliance. The transition was prepared with surgical precision: network nodes simultaneously ran real traffic through both virtual machines and cross-checked every result. The test outcomes are impressive: execution results matched completely, the discrepancy in fees was less than 0.002%, and execution speed itself increased roughly fourfold.
The Main Headache: The Problem of the "Forbidden" Solution
However, the key difficulty lay not in execution itself, but in contract compilation. In the NEAR network, contract deployment is compiled directly within a 600-millisecond block. The optimizing compiler has no upper time limit, which opened the door for an attack. The team created a test contract of 128 KB, whose compilation took about 7 seconds — enough to miss the block and slow down the entire network.
The seemingly obvious solution was to set a hard time limit on compilation. But Vadim explains that this was a forbidden path. Different validators spend different amounts of time on compilation, and a borderline contract would be accepted by some nodes and rejected by others. The result would be a network split (fork) due to a single compiler setting. Consensus requires complete predictability, even at the compilation time level.
Elegant Solution: Winch and Offloading Compilation
Instead of a risky limitation, the team found another way out. They implemented Winch — a single-pass backend for Wasmtime — and added the missing functions to it. This drastically reduced the "worst-case compilation" from 7.6 seconds to just 36 milliseconds. Moreover, Wasmtime's architecture allows compilation to be offloaded to a separate type of processors not tied to execution nodes. As Vadim noted, "working outside the blockchain provides a luxury unavailable to the protocol."
The release of Nearcore 2.12, announced by developer Anton, transitioned NEAR's execution environment from NearVM to Wasmtime. This is work that doesn't make headlines but is of immense importance for the network's long-term sustainability. The team closed a critical technical debt without breaking anything or changing the user experience.
Expert Opinion: This upgrade is a brilliant example of mature engineering culture in the crypto space. NEAR didn't just speed up the network and enhance its security by moving to a supported standard. More importantly, the team solved a complex consensus problem elegantly, without compromises. Offloading compilation outside the critical execution path is an architectural decision that reduces the load on validators and increases the network's resilience to attacks. For token holders and developers, this is a signal: the protocol is seriously investing in its infrastructure while remaining invisible to the end user. It is precisely these kinds of "invisible" updates that lay the foundation for mass adoption.