Building Your First L2 Rollup? Here’s what can go wrong and how to fix it
Tags: rollups
Published: 2024-02-26 12:04:27

<p>The demand for Layer2 rollups is growing immensely as scalability and efficiency become more critical for web3 applications than ever. Many <a href="https://www.zeeve.io/enterprise-blockchain/">enterprises</a>, startups, and scale-ups are building their own Layer2 or Layer3 chains. While all of them adhere to the best practices of <a href="https://www.zeeve.io/rollups/">rollup</a> development, new projects might come across some mistakes that result in delayed launch, increased cost, and resources.&nbsp;</p>
<p>Through this article, we will discuss some common Layer2 rollup mistakes that developers can make, plus solutions to avoid them.&nbsp;</p>
<figure class="wp-block-image aligncenter size-large"><a href="https://www.zeeve.io/rollups/"><img src="https://www.zeeve.io/wp-content/uploads/2024/02/Artboard-2-50-1024x131.jpg" alt="" class="wp-image-60135"/></a></figure>
<h2 class="wp-block-heading">Common Layer2 Rollup Development Mistakes and solutions to fix them</h2>
<h3 class="wp-block-heading">1- Not choosing the right rollup framework:</h3>
<p>Choosing the correct <a href="https://www.zeeve.io/rollups/">rollup framework</a> as per project-specific requirements is critical for Layer2s. Let's say if you want to utilize your already deployed <a href="https://www.zeeve.io/blog/introduction-to-token-standards-erc-20-erc-721-erc-777-and-erc-1155/">ERC20 token</a> on Layer1(Ethereum) as a native token on the L2 rollup, then choose a framework that offers full <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a> compatibility. That's because some rollup frameworks might not allow you to migrate the token. However, they still allow you to port the EVM setup, codebase, or pre-built smart contract. Below are some of the parameters on which Layer2 rollup developers should evaluate their framework:</p>
<p><strong>Cost &amp; scalability- </strong>As we know,<strong> </strong><a href="https://www.zeeve.io/rollups/">rollup frameworks</a> differ in terms of offering TPS and cost per transaction (gas cost). Do an analysis, see what your project's TPS requirement is and how much gas cost it agrees to incur.</p>
<p><strong>Data availability Layer, sequencer, prover, etc- </strong>Understand your application's needs, whether your L2 chain is comfortable in publishing data on-chain on Layer1 or a separate, off-chain data availability layer is required to reduce the cost and store data in a permissionless way. Similarly, does it require the decentralization of sequencer, prover add-on, or more.</p>
<p><strong>Security aspect-</strong> Although security is paramount for Layer2 rollups, the level of security needed can vary from project to project. For example, a permissioned DeFi chain will require higher security and privacy compared to a public network.&nbsp;</p>
<h3 class="wp-block-heading">2. Inability to decide viable configurations:</h3>
<p>Not deciding on a suitable configuration is a common <a href="https://www.zeeve.io/rollups/">Layer2 rollup</a> mistake that new projects can make. General configuration, blockchain-level configurations, <a href="https://www.zeeve.io/blockchain-protocols/deploy-polygon-zkevm-node/">zkEVM</a> configurations (incase of <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">zkrollup chain</a>), and RPC configurations are the main things you need to include in the chain.&nbsp; Plus, following are the additional configurations you may need:</p>
<p><strong>Rollup or Validium mode-</strong> The rollup mode ensures the highest security as data is stored on <a href="https://www.zeeve.io/blockchain-protocols/deploy-ethereum-blockchain/">Ethereum</a> while Validium mode focuses more on reducing the transaction fee by cheaply storing the data off-chain. Choose a mode that makes sense for your project.</p>
<p><strong>Interoperability layer-</strong> If your <a href="https://www.zeeve.io/rollups/">rollup chain</a> relies heavily on cross-chain interactions, then opting for an interoperability layer is an ideal choice for you. LayerZero, Router protocol, and superbridge are some of the external solutions that you can include in the rollup chain to enable interoperability in it.</p>
<p><strong>Granular allowlist configuration:</strong> Allowlisting is a vital opt-in security feature that allows only pre-approved addresses to get access to your rollup chain. This whitelisting approach is important for a permissioned ecosystem that deals in sensitive or confidential data. Further, open-source Layer2s does not need to focus on allowlist.&nbsp;</p>
<p>Enabling all these high–level configurations can be a complex process. That’s why <a href="https://www.zeeve.io/rollups/">rollups-as–a-service (RaaS)</a> platforms provide a default configuration setup, which is also customizable. This feature automates the whole process and removes the heavy lifting of adding configurations from scratch.</p>
<h3 class="wp-block-heading">3. Not forecasting exact infrastructure cost:</h3>
<p>When you are <a href="https://www.zeeve.io/rollups/">building a rollup chain</a> on your own, infrastructure cost allocation is important to ensure hassle-free development and further operation of your Layer2 chain. The cost will mainly include the following:</p>
<p><strong>Hosting nodes: </strong>Building a Layer2 from scratch means you have to maintain a highly reliable infrastructure on your own to host a collection of nodes, such as <a href="https://www.zeeve.io/blog/what-is-a-full-node-a-detailed-guide/">full nodes</a>, <a href="https://www.zeeve.io/validator-nodes/">validator nodes</a>, or RPC nodes.&nbsp;</p>
<p><strong>&nbsp;APIs management:</strong> If your rollup uses APIs (application programming interfaces) to retrieve blockchain data, you need dedicated infrastructure to ensure security and performance of APIs.</p>
<p><strong>Data indexers:</strong> To perform endless data queries and retrieve real-time smart contract data, you need data indexers like <a href="https://www.zeeve.io/subgraphs/">Subgraph</a> and Subquery. You need a reliable infrastructure to ensure optimal performance of these indexers.</p>
<p><strong>Cost for the high-end services:</strong> Infrastructure costs to host and run high end services are important to allocate beforehand. For example, a Prover for a <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDk-based chain</a> will need 96vCPU and 768GiB of memory.</p>
<h3 class="wp-block-heading">4. Not including a robust monitoring system:</h3>
<p>Proactive monitoring of your <a href="https://www.zeeve.io/rollups/">rollup chain</a> is essential to ensure its performance and uptime. By including a robust monitoring setup in your rollup ecosystem, you keep a sharp eye on all important aspects of the network, like transaction execution time, resource utilization, and data logs in real-time. The monitoring system essentially works in the backend and evaluates the performance of the services running in the rollup framework.&nbsp;</p>
<p>For example, if a sequencer service runs out of Layer-1 funds, it will lead to downtime in the entire rollup and dApps running on it, resulting in no batch production. During such a situation, the monitoring system will produce alerts, allowing you to query the issue and fix it. Below are some of the critical parameters on which your rollup chain should be monitored:</p>
<ul><!-- wp:list-item -->
<li><strong>System monitoring– </strong>The monitoring system should capture vital metrics like block height, CPU, memory, disk consumption, and network io to maintain performance.</li>
<!-- /wp:list-item --></ul>
<ul><!-- wp:list-item -->
<li><strong>Visibility into nodes and networks–</strong> You should see block count, transaction queue, block latency, RPC failures, and run health checks to ensure your rollup chain works as expected.&nbsp;</li>
<!-- /wp:list-item --></ul>
<ul><!-- wp:list-item -->
<li><strong>Cloud &amp; logs: </strong>This will show the cloud status, plus all the logs of your <a href="https://www.zeeve.io/rollups/">rollup network</a> in real-time.</li>
<!-- /wp:list-item --></ul>
<h3 class="wp-block-heading">5. Missing on essential 3rd Party Integrations</h3>
<p>3rd party rollup services uphold the core mechanism of modular Layer2 rollups. Missing on them is a common mistake for <a href="https://www.zeeve.io/rollups/">Layer2 rollups</a>. These services can range from account abstraction (AA) to DA layer, and cross-bridges bridges. Ensure that you do an intense analysis of your rollup's architecture and the features it intends to offer. For example, if you want to build a highly scalable and cost-efficient L2 chain, ignoring the need of an independent <a href="https://www.zeeve.io/blog/alt-da-solutions-changing-the-cost-game-for-l2-rollups-spotlight-on-key-players">DA Layer</a> can be a major issue. Likewise, let's look at some of the important integrations available for Layer2 rollups:</p>
<p><strong>Account abstraction (AA)</strong>- If your rollup framework does not have native <a href="https://www.zeeve.io/blog/erc-4337-how-account-abstraction-is-a-game-changer-for-web3-industry/">account abstraction</a> features supported on it, opt for external account abstraction services like <a href="https://www.zeeve.io/blog/zeeve-raas-partners-with-halliday-to-bring-account-abstraction-benefits-into-rollups">Halliday</a> and <a href="https://www.zeeve.io/blog/zeeve-integrates-biconomys-account-abstraction-sdk-in-its-modular-raas-stack">Biconomy</a>.</p>
<p><strong>Decentralized storage system-</strong> A powerful and dynamic decentralized storage network like Filecoin, IPFS, and Arweave will expand the storage capacity of your chain and meanwhile ensure the fastest delivery with robust security.</p>
<p><strong>Decentralized oracles-</strong> Oracles like Chainlink, Redstone, and Pyth allow your <a href="https://www.zeeve.io/rollups/">rollup chain</a> to access real-world data to leverage off-chain resources like external APIs, price feeds from exchanges, verifiable randomness, and more.</p>
<p><strong>Decentralized sequencer-</strong> Decentralized sequencers such as Espresso and Radius will tackle the challenges of centralized sequencing such as security, operational issues, <a href="https://www.zeeve.io/blog/elevate-your-rollup-security-tackle-mev-risks-in-custom-layer2-chains">MEV</a> and review risks.</p>
<p><strong>Developer tools-</strong> Having access to innovative and best-in-class developers tools is important for <a href="https://www.zeeve.io/rollups/">Rollup chains</a> that seek to expand its ecosystem with a variety of dApps and Layer3 rollups. For example, Thirdwed's comprehensive <a href="https://www.zeeve.io/blog/a-beginners-guide-to-web3-stack/">web3 stack</a> offers a range of tools from no-code wallet development stack, sign-in options-based SDKs to launch custom chains, and smart contract deployment tools.&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uoy62s3fkbk13evk0sh9.png)
<h2 class="wp-block-heading" id="h-how-can-zeeve-help">How can Zeeve help?</h2>
<p>Zeeve's reliable <a href="https://www.zeeve.io/rollups/">Rollups-as-a-service (RaaS)</a> platform is designed to tackle all the challenges and common Layer2 rollup mistakes that developers encounter while building a rollup chain from scratch on their own. Whether it's about choosing a suitable rollup framework, reducing your infrastructure cost, or streamlining 3rd party integration, <a href="https://www.zeeve.io/">Zeeve</a> RaaS platform automates each of these steps, allowing you to deploy a custom rollup chain in a few clicks. For this, Zeeve offers a one-click sandbox tool for <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a> and <a href="https://www.zeeve.io/appchains/zksync-hyperchains-zkrollups/">ZSync Hyperchains</a>, while Sandbox for <a href="https://www.zeeve.io/appchains/arbitrum-orbit-rollups/">Arbitrum Orbit</a> will be live soon.Further, <a href="https://www.zeeve.io/">Zeeve</a> has integrated support for all the leading rollup frameworks like <a href="https://www.zeeve.io/appchains/polygon-zkrollups/">Polygon CDK</a>, <a href="https://www.zeeve.io/appchains/arbitrum-orbit-rollups/">Arbitrum Orbit</a>, <a href="https://www.zeeve.io/appchains/zksync-hyperchains-zkrollups/">ZkStack</a>, and <a href="https://www.zeeve.io/appchains/optimistic-rollups/">OP Stack</a>. Also, there 30+ reliable 3rd party rollup services are enabled in Zeeve RaaS, including Celestia, <a href="https://www.zeeve.io/blog/zeeve-partners-with-avail-to-bring-zk-based-data-availability-layer">Avail</a>, Espresso, Redstone, LayerZero, <a href="https://www.zeeve.io/blog/zeeve-raas-partners-with-near-da-to-power-ethereum-rollup-builders-with-efficient-data-availability">NearDA</a>, and a lot more. For more information on <a href="https://www.zeeve.io/rollups/">Zeeve RaaS</a> or our blockchain-related services, <a href="https://www.zeeve.io/talk-to-an-expert/">connect with our experts</a>. You can drop your queries via mail on this page or schedule a one-to-one call for a detailed discussion.</p>