Skip to content
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b9dd6ae
pushing barebones structure for increasing smart contract size limit
pete-vielhaber Jun 23, 2025
6371c6e
yarn format
pete-vielhaber Jun 23, 2025
feb8dd7
adding new content
pete-vielhaber Jul 16, 2025
c14ace9
yarn format
pete-vielhaber Jul 16, 2025
03f425c
styling
pete-vielhaber Jul 16, 2025
43f956d
removed smart-contract-size-limit from excludeRoutes
pete-vielhaber Jul 16, 2025
b7c393e
removed smart-contract-size-limit from excludeRoutes list
pete-vielhaber Jul 16, 2025
be3902d
Merge branch 'master' into smart-contract-size-limit
pete-vielhaber Jul 16, 2025
abb874f
adjusting docusaurus.config.js to latest from master
pete-vielhaber Jul 16, 2025
3de23be
yarn
pete-vielhaber Jul 16, 2025
f944295
Merge branch 'master' into smart-contract-size-limit
pete-vielhaber Jul 16, 2025
42ba300
Merge branch 'master' into smart-contract-size-limit
anegg0 Jul 29, 2025
df40a70
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
68c2f6c
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
be84af3
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
7f49a93
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
ff3c234
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
50d37d7
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
cb3e0c7
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Jul 31, 2025
3a28d66
addressing feedback
pete-vielhaber Aug 1, 2025
6dc776f
Update docs/launch-arbitrum-chain/02-configure-your-chain/common-conf…
pete-vielhaber Aug 18, 2025
0d54010
Merge branch 'master' into smart-contract-size-limit
pete-vielhaber Aug 18, 2025
30f9182
made a comment for review
pete-vielhaber Aug 26, 2025
31a4ced
Merge branch 'master' into smart-contract-size-limit
pete-vielhaber Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,42 @@ description: 'Learn how to configure smart contract size limits on your Arbitrum
author:
sme:
content_type: how-to
tags: ['hide-from-search']
---

For standard public Arbitrum chains (such as Arbitrum One or Nova), the smart contract code size limit is fixed at 24 kB, as enforced by [EIP-170](https://eips.ethereum.org/EIPS/eip-170). This limit is not configurable for end-users or developers deploying contracts on these chains.

However, if you're launching a custom Arbitrum chain (a Layer 2 or Layer 3 chain built using the Arbitrum stack), the limit can be increased up to 96 kB.

## Why the limit?

The limit exists because larger contracts require more resources to process and verify, making them potential vectors for denial-of-service (DoS) attacks if not properly constrained. The original EIP-170, which addressed the issue of smart contract size, was designed with this in mind.

## Benefits of increasing the smart contract size limit

Increasing the smart contract code size limit (from the default 24 kB up to 96 kB) enables greater flexibility in development, particularly for complex applications. Key benefits include:
Support for More Complex and Feature-Rich Contracts: Larger contracts can incorporate extensive logic, libraries, and functionalities without requiring the need to split code across multiple contracts. This consolidation is beneficial for applications such as DeFi protocols, games, or enterprise solutions that require intricate computations or integrations, thereby reducing the need for workarounds like proxy patterns.

- **Reduced gas costs for execution**: By consolidating code into a single contract, you avoid expensive inter-contract calls (e.g., via proxies or delegates), which can lower overall runtime gas consumption. Proxy patterns, often used to bypass size limits, add overhead and increase the cost of calls.
- **Simplified development and maintenance**: Developers can write cleaner, more modular code without artificial splitting, making it easier to audit, debug, and upgrade contracts. Cleaner code streamlines the development process and reduces complexity in reasoning about the codebase.
- **Enhanced customization for specific use cases**: On Orbit chains, this aligns with other customizations (e.g., gas tokens or block times), enabling tailored environments for high-throughput needs, such as gaming or AI-driven apps, where larger contracts can handle domain-specific logic efficiently.

## Drawbacks of increasing the smart contract size limit

While beneficial for complexity, raising the limit introduces trade-offs, particularly in costs, security, and performance. These are more pronounced in Rollup environments, such as Arbitrum, where transactions get posted to the Ethereum Layer 1.

- **Higher deployment costs**: Larger contracts require more bytecode in the initialization code, which increases the transaction size and, consequently, the calldata costs posted to Ethereum L1. In Rollups, this can significantly raise deployment fees, as costs scale with data size.
- **Potential security risks**: Increasing code complexity increases the surface area for vulnerabilities, making audits more challenging and raising the risk of exploits. Larger contracts may also complicate fraud-proof mechanisms in optimistic rollups, such as Arbitrum, potentially making disputes more resource-intensive and time-consuming.
- **Performance and network efficiency concerns**: Although EVM execution charges gas per opcode (not code size), large contracts could lead to slower node processing or higher resource demands on validators/sequencers. This slower processing might exacerbate DoS risks on your chain, as the original EIP-170 limit design was to mitigate such issues.
- **Compatibility and portability issues**: Contracts exceeding the standard 24 kB limit (enforced on public chains like Arbitrum One or Ethereum) cannot be deployed elsewhere without modifications. This restriction limits interoperability and could lock you into your Orbit chain, reducing flexibility if you need to migrate in the future.
- **Irreversibility**: The limit must be set during initial chain configuration and cannot be changed post-deployment, so poor choices could lead to long-term inefficiencies.
Overall, increasing the limit is ideal for specialized Arbitrum chains where complexity outweighs costs. However, we recommend sticking to defaults unless necessary.

## How to Configure

1. Use the [Arbitrum chain (Orbit) SDK](https://github.com/OffchainLabs/arbitrum-orbit-sdk) to prepare your chain's configuration.
2. When calling the `prepareNodeConfig` function, modify the relevant parameters: [`MaxCodeSize`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/9fd3d39504832f94a31d9c5773f4514bd7be6eee/src/prepareChainConfig.ts#L29) (for deployed contract code size) and [`MaxInitCodeSize`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/9fd3d39504832f94a31d9c5773f4514bd7be6eee/src/prepareChainConfig.ts#L30) (for initialization code size during deployment).
3. These parameters are defined in the SDK's [`prepareChainConfig.ts`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/src/prepareChainConfig.ts#L29) file. An example implementation is available in the SDK's [`examples/prepare-node-config/index.ts`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/prepare-node-config/index.ts).
<!-- I'm not sure this example above in #3 is correct -->
4. Note that once the chain deploys, the smart contract limits are unchangeable via upgrades—you must set them during initial configuration.

This customization applies to both EVM-compatible contracts and Stylus (WebAssembly-based) contracts on Arbitrum chains. However, Stylus contracts must also adhere to compression limits (e.g., 24 kB Brotli-compressed in some cases, with potentially higher uncompressed equivalents of ~128 kB, depending on the setup). You can learn more about [Stylus in this section](/stylus/gentle-introduction.mdx).
5 changes: 5 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ const sidebars = {
id: 'launch-arbitrum-chain/configure-your-chain/common-configurations/enable-post-4844-blobs',
label: `Enable blob transactions`,
},
{
type: 'doc',
id: 'launch-arbitrum-chain/configure-your-chain/common-configurations/smart-contract-size-limit',
label: `Configure the smart contract size limit`,
},
{
type: 'category',
label: 'Data Availability Committees',
Expand Down