From b9dd6ae0bc7e017ffb9a90956ca7d852b3a4b62d Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 23 Jun 2025 07:48:46 -0500 Subject: [PATCH 01/19] pushing barebones structure for increasing smart contract size limit --- .../11-smart-contract-size-limit.mdx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 8e8c3e59ce..b1af225f0e 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -6,3 +6,38 @@ sme: content_type: how-to tags: ['hide-from-search'] --- + + +Arbitrum chains do support an increased smart contract size limit of 96kB. + + + + + + + + + + + +You can use our Arbitrum chain (Orbit) SDK and configure the parameters [`MaxCodeSize` and `MaxInitCodeSize`](https://docs.arbitrum.io/launch-arbitrum-chain/faq-troubleshooting/troubleshooting-building-arbitrum-chain#can-i-increase-the-maximum-contract-size-for-my-arbitrum-chain:~:text=MaxCodeSize%20and%20MaxInitCodeSize) when calling [`prepareNodeConfig`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/prepare-node-config/index.ts#L43). + + + + + + + +To be deployed onchain, the size of your uncompressed WebAssembly (WASM) file must not exceed 128Kb, while the compressed binary must not exceed 24KB. Stylus conforms with the same contract size limit as the EVM to remain fully interoperable with all smart contracts on Arbitrum chains. + +cargo-stylus, the Stylus CLI tool, automatically compresses your WASM programs, but there are additional steps that you can take to further reduce the size of your binaries. + +Your options fall into two categories: Rust compiler flags, and third-party optimization tools. \ No newline at end of file From 6371c6e0c8d407d41e41d5a5ce8bb24b9c5332c4 Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 23 Jun 2025 07:49:00 -0500 Subject: [PATCH 02/19] yarn format --- .../11-smart-contract-size-limit.mdx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index b1af225f0e..6ea5c45aa7 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -8,36 +8,35 @@ tags: ['hide-from-search'] --- -Arbitrum chains do support an increased smart contract size limit of 96kB. + +Arbitrum chains do support an increased smart contract size limit of 96kB. - - - - + You can use our Arbitrum chain (Orbit) SDK and configure the parameters [`MaxCodeSize` and `MaxInitCodeSize`](https://docs.arbitrum.io/launch-arbitrum-chain/faq-troubleshooting/troubleshooting-building-arbitrum-chain#can-i-increase-the-maximum-contract-size-for-my-arbitrum-chain:~:text=MaxCodeSize%20and%20MaxInitCodeSize) when calling [`prepareNodeConfig`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/prepare-node-config/index.ts#L43). - - + To be deployed onchain, the size of your uncompressed WebAssembly (WASM) file must not exceed 128Kb, while the compressed binary must not exceed 24KB. Stylus conforms with the same contract size limit as the EVM to remain fully interoperable with all smart contracts on Arbitrum chains. cargo-stylus, the Stylus CLI tool, automatically compresses your WASM programs, but there are additional steps that you can take to further reduce the size of your binaries. -Your options fall into two categories: Rust compiler flags, and third-party optimization tools. \ No newline at end of file +Your options fall into two categories: Rust compiler flags, and third-party optimization tools. From feb8dd72393f416b5c926ac5446334d073f4690c Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:01:14 -0500 Subject: [PATCH 03/19] adding new content --- .../11-smart-contract-size-limit.mdx | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 6ea5c45aa7..076f7aefad 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -7,36 +7,36 @@ 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. -Arbitrum chains do support an increased smart contract size limit of 96kB. +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. -You can use our Arbitrum chain (Orbit) SDK and configure the parameters [`MaxCodeSize` and `MaxInitCodeSize`](https://docs.arbitrum.io/launch-arbitrum-chain/faq-troubleshooting/troubleshooting-building-arbitrum-chain#can-i-increase-the-maximum-contract-size-for-my-arbitrum-chain:~:text=MaxCodeSize%20and%20MaxInitCodeSize) when calling [`prepareNodeConfig`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/prepare-node-config/index.ts#L43). +- **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` 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/src/prepareChainConfig.ts#L29). + +4. Note that once the chain deploys, the smart contract limits are unchangeable via upgrades—you must set them during initial configuration. - - - - -To be deployed onchain, the size of your uncompressed WebAssembly (WASM) file must not exceed 128Kb, while the compressed binary must not exceed 24KB. Stylus conforms with the same contract size limit as the EVM to remain fully interoperable with all smart contracts on Arbitrum chains. - -cargo-stylus, the Stylus CLI tool, automatically compresses your WASM programs, but there are additional steps that you can take to further reduce the size of your binaries. - -Your options fall into two categories: Rust compiler flags, and third-party optimization tools. +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. From c14ace93feac5656698809cd9c1fb303469ae322 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:01:37 -0500 Subject: [PATCH 04/19] yarn format --- .../11-smart-contract-size-limit.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 076f7aefad..b703ebd2d3 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -12,10 +12,12 @@ For standard public Arbitrum chains (such as Arbitrum One or Nova), the smart co 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: + +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. @@ -23,6 +25,7 @@ Support for More Complex and Feature-Rich Contracts: Larger contracts can incorp - **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. @@ -30,13 +33,14 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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. + 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` 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/src/prepareChainConfig.ts#L29). - + 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. From 03f425c65f64550f8c76decac4f50fe7d77a3495 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:03:12 -0500 Subject: [PATCH 05/19] styling --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index b703ebd2d3..6e300aa3ba 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -35,7 +35,7 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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 +## 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). From 43f956dd737000908047cde6bee7d1427cac7802 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:09:53 -0500 Subject: [PATCH 06/19] removed smart-contract-size-limit from excludeRoutes --- .../common-configurations/11-smart-contract-size-limit.mdx | 5 ++--- website/docusaurus.config.js | 3 +-- website/sidebars.js | 5 +++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 6e300aa3ba..413ed3cc93 100644 --- a/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/arbitrum-docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -4,7 +4,6 @@ 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. @@ -39,8 +38,8 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic 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` 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/src/prepareChainConfig.ts#L29). +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). 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. +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). diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index d15b1e77ad..5869481f39 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -145,7 +145,6 @@ const config = { 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/08-batch-posting-assertion-control', 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/09-sequencer-timing-adjustments', 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/10-per-batch-gas-cost', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit', 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/12-customizing-anytrust', 'launch-arbitrum-chain/02-start-your-journey', 'launch-arbitrum-chain/03-arbitrum-license', @@ -162,7 +161,7 @@ const config = { 'launch-arbitrum-chain/reference/arbitrum-chain-configuration-parameters', 'launch-arbitrum-chain/reference/arbitrum-chain-fast-block-times', 'launch-arbitrum-chain/reference/arbitrum-chain-sequencer-configuration', - 'launch-arbitrum-chain/reference/arbitrum-chain-smart-contract-size-limit', + 'launch-arbitrum-chain/reference/arbitrum-chain-smart-contract-size-limit' ], maxHits: 10, }, diff --git a/website/sidebars.js b/website/sidebars.js index 59d63fded8..f7243a2239 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -286,6 +286,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', From b7c393e9a584c9af8cca2850accb942f097c834a Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:10:26 -0500 Subject: [PATCH 07/19] removed smart-contract-size-limit from excludeRoutes list --- website/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 5869481f39..53189990f4 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -161,7 +161,7 @@ const config = { 'launch-arbitrum-chain/reference/arbitrum-chain-configuration-parameters', 'launch-arbitrum-chain/reference/arbitrum-chain-fast-block-times', 'launch-arbitrum-chain/reference/arbitrum-chain-sequencer-configuration', - 'launch-arbitrum-chain/reference/arbitrum-chain-smart-contract-size-limit' + 'launch-arbitrum-chain/reference/arbitrum-chain-smart-contract-size-limit', ], maxHits: 10, }, From abb874f0dd57563812127497f8fdda51c61ace53 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:18:56 -0500 Subject: [PATCH 08/19] adjusting docusaurus.config.js to latest from master --- website/docusaurus.config.js | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index e2387c6d4e..0edf673c5d 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -216,36 +216,6 @@ const config = { }, ], require.resolve('docusaurus-plugin-fathom'), - [ - 'docusaurus-lunr-search', - { - excludeRoutes: [ - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/04-stake-and-validator-configurations', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/05-arbos-configuration', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/06-gas-optimization-tools', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/08-batch-posting-assertion-control', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/09-sequencer-timing-adjustments', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/10-per-batch-gas-cost', - 'launch-arbitrum-chain/02-configure-your-chain/common-configurations/12-customizing-anytrust', - 'launch-arbitrum-chain/02-start-your-journey', - 'launch-arbitrum-chain/03-arbitrum-license', - 'launch-arbitrum-chain/04-maintain-your-chain/01-bridging', - 'launch-arbitrum-chain/04-maintain-your-chain/02-monitoring', - 'launch-arbitrum-chain/04-maintain-your-chain/04-guidance/01-decentralization-security', - 'launch-arbitrum-chain/04-maintain-your-chain/04-guidance/02-guidance-on-altda', - 'launch-arbitrum-chain/06-third-party-integrations/03-integrations', - 'launch-arbitrum-chain/07-arbitrum-node-runners/arbitrum-chain-node-providers', - 'launch-arbitrum-chain/08-ecosystem-support/01-arbitrum-chain-portal', - 'launch-arbitrum-chain/08-ecosystem-support/03-get-listed-arbitrum-chain-platforms', - 'launch-arbitrum-chain/how-tos/how-to-configure-your-chain', - 'launch-arbitrum-chain/reference/arbitrum-chain-batch-poster-configuration', - 'launch-arbitrum-chain/reference/arbitrum-chain-configuration-parameters', - 'launch-arbitrum-chain/reference/arbitrum-chain-fast-block-times', - 'launch-arbitrum-chain/reference/arbitrum-chain-sequencer-configuration', - ], - maxHits: 10, - }, - ], require.resolve('docusaurus-plugin-sass'), ], themeConfig: @@ -419,4 +389,4 @@ if (isRunningLocally && isRunningOnWindows) { config.themeConfig.prism.darkTheme = require('prism-react-renderer/themes/palenight'); } -module.exports = config; +module.exports = config; \ No newline at end of file From 3de23beaf4b0e331b4a853a27af0de79ef7d8e18 Mon Sep 17 00:00:00 2001 From: Pete Date: Wed, 16 Jul 2025 08:19:15 -0500 Subject: [PATCH 09/19] yarn --- website/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 0edf673c5d..4559bfd8d9 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -389,4 +389,4 @@ if (isRunningLocally && isRunningOnWindows) { config.themeConfig.prism.darkTheme = require('prism-react-renderer/themes/palenight'); } -module.exports = config; \ No newline at end of file +module.exports = config; From df40a7054b0df5b5b379e4d54bb49be7673ed4aa Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:58:42 -0500 Subject: [PATCH 10/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 413ed3cc93..3356e85084 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -21,7 +21,7 @@ Support for More Complex and Feature-Rich Contracts: Larger contracts can incorp - **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. +- **Enhanced customization for specific use cases**: On Arbitrum (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 From 68c2f6c0483e90466400592785518971cf2d7341 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:58:47 -0500 Subject: [PATCH 11/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 3356e85084..351488ab42 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -17,7 +17,7 @@ The limit exists because larger contracts require more resources to process and ## 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. +- **Support for more complex and feature-rich contracts**: Larger contracts can incorporate extensive logic, libraries, and functionalities without the need to split code across multiple contracts. This consolidation is helpful 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. From be84af324e4476fe7dc1aa3d2ecee3c5ee568fd1 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:59:04 -0500 Subject: [PATCH 12/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 351488ab42..d991622d5e 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -29,7 +29,7 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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. +- **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 purpose of the EIP-170 limit 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. From 7f49a9395492214836ece4bda77d5e7afdba4fb4 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:59:09 -0500 Subject: [PATCH 13/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index d991622d5e..eac41e642f 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -30,7 +30,7 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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 purpose of the EIP-170 limit 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. +- **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 Arbitrum (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. From ff3c234e39747b290f069c1bde919fee7dec5512 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:59:16 -0500 Subject: [PATCH 14/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index eac41e642f..6fe596fe7f 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -32,7 +32,7 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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 purpose of the EIP-170 limit 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 Arbitrum (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. +Overall, increasing the limit is ideal for specialized Arbitrum chains where complexity outweighs costs, but we recommend sticking to defaults unless necessary. ## How to Configure From 50d37d75738488ec4f3e3c71abe385167d86fa2e Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:59:21 -0500 Subject: [PATCH 15/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 6fe596fe7f..b3d3c60c2a 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -34,7 +34,7 @@ While beneficial for complexity, raising the limit introduces trade-offs, partic - **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, but we recommend sticking to defaults unless necessary. -## How to Configure +## 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). From cb3e0c78f54cf08b6afa75461dc3514c83fc3914 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 31 Jul 2025 13:59:28 -0500 Subject: [PATCH 16/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index b3d3c60c2a..d82eca3842 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -37,7 +37,7 @@ Overall, increasing the limit is ideal for specialized Arbitrum chains where com ## 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). +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). 4. Note that once the chain deploys, the smart contract limits are unchangeable via upgrades—you must set them during initial configuration. From 3a28d66beee59098a381d1a7737a099a11be6151 Mon Sep 17 00:00:00 2001 From: Pete Date: Fri, 1 Aug 2025 07:04:10 -0500 Subject: [PATCH 17/19] addressing feedback --- .../11-smart-contract-size-limit.mdx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index d82eca3842..77261c8863 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -1,9 +1,11 @@ --- -title: 'Smart contract size limit' -description: 'Learn how to configure smart contract size limits on your Arbitrum chain' -author: -sme: -content_type: how-to +title: 'Configure the smart contract size limit' +sidebar_label: 'Smart Contract Size Limit' +description: 'Learn more about benefits, drawbacks, and how to configure the smart contract size limit.' +user_story: 'I want to increase the smart contract size limit on my Arbitrum chain.' +content_type: 'how-to' +author: pete-vielhaber +sme: pete-vielhaber --- 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. @@ -17,6 +19,7 @@ The limit exists because larger contracts require more resources to process and ## 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 the need to split code across multiple contracts. This consolidation is helpful 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. @@ -27,12 +30,11 @@ Increasing the smart contract code size limit (from the default 24 kB up to 96 k 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 purpose of the EIP-170 limit 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 Arbitrum (Orbit) chain, reducing flexibility if you need to migrate in the future. +- **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 Arbitrum (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, but we recommend sticking to defaults unless necessary. + Overall, increasing the limit is ideal for specialized Arbitrum chains where complexity outweighs costs, but we recommend sticking to defaults unless necessary. +- **Higher contract deployment costs (users)**: 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 for users. ## How to configure From 6dc776fbe85ce4b37c79f5cf8ab55a686e73612b Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 18 Aug 2025 12:59:48 -0500 Subject: [PATCH 18/19] Update docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- .../common-configurations/11-smart-contract-size-limit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index 77261c8863..b6e054bf15 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -8,7 +8,7 @@ author: pete-vielhaber sme: pete-vielhaber --- -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. +For standard public Arbitrum chains (such as Arbitrum One or Nova), the smart contract code size limit has been set 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. From 30f918259091049cdc6b121f9cc62473457a3d4a Mon Sep 17 00:00:00 2001 From: Pete Date: Tue, 26 Aug 2025 11:57:10 -0500 Subject: [PATCH 19/19] made a comment for review --- .../common-configurations/11-smart-contract-size-limit.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx index b6e054bf15..319d71253c 100644 --- a/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx +++ b/docs/launch-arbitrum-chain/02-configure-your-chain/common-configurations/11-smart-contract-size-limit.mdx @@ -10,18 +10,19 @@ sme: pete-vielhaber For standard public Arbitrum chains (such as Arbitrum One or Nova), the smart contract code size limit has been set 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. +However, if you're launching a custom Arbitrum chain (L2/L3), 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. +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. 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 the need to split code across multiple contracts. This consolidation is helpful 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. + +- **Support for more complex and feature-rich contracts**: Larger contracts can incorporate extensive logic, libraries, and functionality without the need to split code across multiple contracts. This consolidation is helpful 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 Arbitrum (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.