Doubling The Limit

Doubling The Limit

How Sonic is expanding smart contract size limits with V2.2.


A developer is building an application on Sonic. As the product grows, its smart contracts need to support more features, more complex logic and more ways for users to interact.

Eventually, the developer reaches the maximum contract size. They must then remove functionality, spend time reducing the code or divide the application across multiple contracts.

Sonic V2.2 gives developers more room. The upgrade doubles the maximum size of smart contracts and the code used to deploy them.

Why Contract Size Matters

Smart contracts are programs deployed onchain. Like any program, they contain code that defines what an application can do.

Ethereum introduced limits on the size of this code to protect the network from excessive processing and hardware requirements. Sonic has followed the same limits, allowing deployed contracts of up to 24 KiB and contract initialization code of up to 48 KiB.

These limits are sufficient for many applications, but they can become restrictive as contracts grow more sophisticated. Developers can work around the limit by separating an application into multiple contracts. In some cases, this is the right architectural choice. In others, it introduces additional complexity purely to stay under the limit: restructuring working code, coordinating interactions across more contracts or removing features they would otherwise include.

What Changes

V2.2 doubles both limits:

  • Deployed contract code increases from 24 KiB to 48 KiB
  • Contract initialization code increases from 48 KiB to 96 KiB

Initialization code is the temporary code used when creating and deploying a contract, including the instructions needed to configure it before its final code is stored onchain.

The higher limits do not introduce additional fee penalties beyond Sonic's existing charges for code and data size. Larger contracts naturally require more data to be processed and stored, so existing costs continue to scale with size. There is no new pricing tier for contracts that exceed the previous 24 KiB limit.

Developers gain more capacity without having to account for a new fee system.

What Made This Possible

Supporting larger contracts required more than changing a configuration value.

Sonic's previous virtual machine used an instruction format that relied on references limited to 64 KiB of code. That was not a problem under the old limits, but with initialization code increasing to 96 KiB, the virtual machine needed a new approach.

V2.2 introduces the Simple Format Virtual Machine (SFVM). Instead of converting contract code into a longer internal format before execution, SFVM keeps the original instructions and creates a compact map of valid jump destinations. The result is a simpler execution engine that removes the previous size restriction.

SFVM was tested against the first 25 million blocks of Sonic mainnet activity. Across the designs evaluated, performance differences were negligible. Sonic was able to adopt the simpler architecture without a meaningful tradeoff for normal network activity.

What Changes For Developers

Applications can include more contract logic without being forced to split it across multiple deployments. Complex protocols have more room for features, and development teams can spend less time restructuring code solely to fit within the previous limits.

This does not mean every application should use larger contracts. Smaller and simpler contracts can still be easier to review, test and maintain. The change gives developers more freedom to choose the structure that best fits their application.

What Changes For Users

Nothing noticeable. Users will continue to sign transactions, interact with applications and pay network fees in the same way. Existing contracts do not need to be rewritten.

The difference is in what developers can build. Applications that previously required workarounds to fit under the contract size limit can now be deployed as intended, with richer functionality and simpler architecture.

A Larger Foundation

Increasing contract limits is not about making every smart contract larger. It is about removing a constraint when additional capacity is genuinely useful.

With V2.2, Sonic doubles the room available for deployed contracts and initialization code, backed by a simpler execution engine designed for the next stage of the network's growth.