Runtime Upgrades

The runtime upgrade system smart contract within eRon Blockchain facilitates modifications to existing bytecode for system smart contracts, while preserving the integrity of user smart contracts. To enact any alterations, users initiate proposals, and changes are implemented only upon achieving governance consensus. This approach offers a simpler alternative to hard forks, eliminating the necessity for all validators to upgrade their nodes.

This capability is made possible by eRon's introduction of EVM hooks, an innovative technology operating atop precompiled smart contracts. Technically akin to precompiled smart contracts within Solidity, EVM hooks possess the unique ability to modify the StateDB, the state database utilized by Ethereum nodes. Input for EVM hooks follows the same format as for simple smart contracts, requiring ABI encoding and a 4-byte prefix indicating the method name. This seamless integration empowers developers, providing a familiar interface akin to standard smart contracts.

Notably, EVM hooks consistently consume 0 gas price. This stands in contrast to precompiled smart contracts, which lack the capability to modify input data due to their reliance on raw memory pointers. To ensure data integrity, EVM hooks create a copy of the input data, preventing potential corruption of EVM memory or state by either the hook or associated smart contracts.