Contributing to the Scalability of Base and the OP Stack: A Technical Deep Dive

Contributing to the Scalability of Base and the OP Stack A Technical Deep Dive

In February, the Base testnet was launched with the goal of bringing the next million developers and billion users onchain. Base, an Ethereum L2 powered by the OP Stack, provides a secure, low-cost, and developer-friendly platform for building decentralized apps. As Base progresses towards mainnet, safety and security remain top priorities.

This article delves into the learnings on scalability and performance that have been gathered, positioning Base for a stronger mainnet launch and contributing to the improvement of the OP Stack. The aim is to identify challenges and proactively drive solutions that benefit both Base and the broader ecosystem.

Challenges with L2 Data Management

L2 networks inherit L1 security by publishing their data on L1 in batches. This process involves taking the L2 blocks and writing them to L1. Under normal circumstances, this process works well, but issues can arise during surges in data-heavy transactions, such as contract deployments.

The Surge During Base Builder Quests

During the Base Builder Quests campaign, over 1M wallet addresses deployed a smart contract on Base testnet, causing a significant increase in new contract creations. This surge led to the batcher falling behind in processing the pending data, causing the “safe head” (L2 blocks committed to L1) to lag behind the “unsafe head” (L2 blocks not yet committed to L1).

Other OP Stack contributors, such as OP Labs, had previously identified this issue through synthetic load tests. The Base Builder Quest quickly reproduced this bottleneck, requiring short-term fixes and a longer-term solution.

Identifying and Addressing the Issue

The first indication of an issue was a surge in gas fees on Base testnet, as the Base blocks were filling up, causing the EIP-1559 mechanism to increase the L2 base fee. An experimental gas limit increase was implemented on the testnet to better understand the system’s behavior, which helped keep the base fee lower. However, this move resulted in larger L2 blocks, causing a slowdown in writing those blocks back to the Goerli L1.

To counteract this, adjustments were made:

  • Increased the expected compression ratio
  • Decreased the gas limit back to its original size
  • Reduced the number of confirmations required for writing L2 batches to the L1

Despite these adjustments, the system struggled to reach equilibrium, with over 4000 uncommitted blocks at one point. The gap was closed only after the quests slowed down.

Implementing a Long-Term Solution

The Builder Quest highlighted the need for a long-term solution to the block batch writing bottleneck. Two changes were implemented to the batcher:

  1. An improved compression implementation for better utilization of L1 transaction calldata.
  2. Submission of multiple batcher transactions per L1 block, instead of one at a time.

Load testing indicates that these changes increased the batcher throughput by up to 5x, limited only by what can fit into L1 blocks.

Long-Term Impact on Users

The implemented changes enhance the scalability of Base and the OP Stack, offering several benefits for users at mainnet:

  • Increased Block Gas Limits: These changes pave the way for increasing block gas limits, ensuring the base fee remains low and the platform accessible even as demand for blockspace increases.
  • Synchronization of Safe Tip: These changes help keep the safe tip in sync with unsafe block production, crucial for maintaining transaction speed and withdrawals on custodial exchanges relying on an up-to-date safe block.

Many team members working on Base have extensive experience scaling crypto at Coinbase. This expertise is now focused on scaling Base and the OP Stack, envisioned as the platform powering the next generation of crypto, bringing millions of developers and billions of users onchain.

Conclusion

The journey towards the Base mainnet has provided valuable insights into scalability and performance, reinforcing the commitment to a secure and efficient launch. The improvements not only benefit Base but also strengthen the OP Stack, fostering a robust ecosystem for future projects. As Base moves closer to mainnet, the community can expect continued efforts to enhance the platform’s capabilities and ensure a seamless transition.

Connect with Base

Stay updated with Base on their social channels and documentation: