See Virtual TestNets in action! ⚡ Replace slow public testnets in dapp development. Join our Office Hours

Case Study

How MakerDAO Replaced Public Testnets With Virtual TestNets

Organization: MakerDAO

Website: makerdao.com

Industry: DeFi

How MakerDAO replaced public testnets with Virtual TestNets for development

"Migration to Tenderly Virtual TestNets has been a huge help in MakerDAO Endgame development. It also helps with evolving away from the fragmented state of engineering and testing in Web3 toward a healthier, more dynamic, and shared process."

0xdeniz

Lead Technical Coordinator at MakerDAO

As one of the first DeFi protocols in Web3, MakerDAO’s vision and role matured over the years. With DAI becoming a true household name among stablecoins, the Maker Protocol permeates every aspect of the DeFi space. 

Currently, MakerDAO strives to ensure DAI is the most accessible stablecoin in the market, offering the best yields and rates regardless of market conditions. The yield is powered by an overcollateralized debt engine that sources its yield from crypto borrowers and real-world assets. The engine is paired with a strong risk management framework aimed at defending the DAI peg, which is top priority of the protocol and DAO.  

Through years of experimentation, MakerDAO has now arrived at 'Endgame' as a fundamental transformation of MakerDAO that improves growth, resilience, and accessibility, with the aim of scaling the Dai supply to 100 billion and beyond. Endgame aims to simplify the scope of Maker governance by outsourcing RWA management and product innovation to SubDAOs, to which exposure will be managed through risk parameters. It's conceptually similar to how Alphabet relates to Google.

Building Maker Endgame is challenging because MakerDAO’s technical efforts are distributed across various independent and remote teams called Ecosystem Actors. This decentralized structure introduces complexity to their internal testing processes, which eventually led the teams to find an alternative for public testnets – Tenderly Virtual TestNets

The testing challenges of decentralized MakerDAO contributor teams

MakerDAO has various independent technical teams contributing across the globe as contractor teams called "Ecosystem Actors", including smart contract development, frontend development, DevOps, and risk management teams. These teams work on different aspects of the Maker Protocol, including on-chain governance (called Executive Spells) and the launch of Endgame. 

However, Maker’s unique flat organizational structure introduces complexity to its internal development and testing processes. 

Siloed development

With fully decentralized teams, engineering managers have to deal with a high level of fragmentation. The teams work in closed silos, with their own set of development and testing practices, tools, and working environments. In return, such siloed development causes significant differences between teams, a fragmented process, and additional overhead.

Until recently, the teams didn’t have a shared process for new deployments to staging environments, so in the days leading up to a big product launch like Endgame, the teams needed to ensure complete alignment on staging environments and testing procedures, which requires further coordination and effort.

For a cross-team project such as Endgame development & launch, frontend, smart contracts, communications, and everything else need to work in tandem, which you cannot do without a common infrastructure. – 0xdeniz, lead technical coordinator at MakerDAO

The limitations of public testnets

The Maker Protocol is deployed on Ethereum, so the engineering teams primarily used Goerli as the staging environment until it was deprecated. However, using Goerli as the primary staging environment introduced a lot of challenges as it required maintaining a second deployment of the protocol and keeping it somewhat synced with the mainnet deployment, including on-chain governance and realistic state for testing. 

As the Goerli testnet got deprecated, the MakerDAO engineering teams had to consider migrating to Sepolia or using a new approach with Tenderly Virtual TestNets, which some of the teams were already using internally. 

MakerDAO considerations that helped them choose between public testnets and Virtual TestNets

Moving away from fragmented engineering with Virtual TestNets

Given the challenges of public testnets and the unique requirements of the MakerDAO engineering teams, they decided to integrate Tenderly Virtual TestNets, zero-setup virtual networks synced with the most recent state of a parent EVM chain.

Virtual TestNets opened new possibilities for the Maker engineering teams, including:

  • Team-specific environment instances that enable collaborative testing and incremental improvements.
  • Saved resources by eliminating the time-consuming ongoing maintenance of public testing infrastructure.
  • Syncing with the most recent state of Ethereum Mainnet so the teams can test new code and its integrations against up-to-date production data.
  • Complete privacy and confidentiality during the early stages of development in contrast to public testnet deployments, whilst empowering development teams and integration partners. 
  • Seamless onboarding of new stakeholders thanks to an unlimited faucet for fast and easy token minting and account funding.
  • Built-in debugging and development tooling with a list of deployed contracts in an accessible dashboard overview.

The integration process went smoothly for the MakerDAO contributor teams, with the Tenderly support team providing ongoing assistance as needed. In just a couple of weeks, the MakerDAO engineers were already familiar with Virtual TestNets and were able to use them as their primary testing infrastructure.

How Virtual TestNets enable incremental improvements

Now, MakerDAO contributor teams use Virtual TestNets across the organization, including smart contract engineering, frontend, and data analytics teams. With Virtual TestNets, the teams have control over their environments, along with built-in debugging tools, custom configurations, and complete observability with a dashboard overview.

The MakerDAO contributor teams have full flexibility when using Virtual TestNets to replicate the exact state of Ethereum Mainnet. They can fork the parent chain, as well as any individual Virtual TestNet instances. This way, each team can iterate over their version of Virtual TestNets, making independent progress and running internal experiments. 

The process starts with the smart contract developers who deploy Maker contracts to a Virtual TestNet with a fresh network state. Once they have an increment that’s useful for other teams, they can pass it on to the frontend or data infrastructure teams. The other teams can then use it as a reference and integrate that instance of a Virtual TestNet or fork it to continue with their internal experiments.

How MakerDAO use Virtual TestNets across teams

These smaller increments are useful in their own way, with the process becoming more dynamic for the Maker teams. This way, the Maker engineering organization can avoid the Goerli scenario where one or multiple teams stop contributing to the public testnet, and it becomes still and loses its value over time.

“The process is very similar to how developers work on GitHub, constantly forking and merging branches. I think this process is very healthy because it’s dynamic, up-to-date, and relevant. For instance, when building a new frontend, you have all these little branches on Virtual TestNets, and they eventually result in a single outcome. This dynamic and more incremental nature of staging deployments with Virtual TestNets is really powerful.” – 0xdeniz, lead technical coordinator at MakerDAO

Turning Web3 development into a shared, collaborative process

The incremental and collaborative nature of Virtual TestNets has greatly facilitated protocol development and testing for the MakerDAO contributor teams. Instead of relying on a canonical infrastructure solution such as a public testnet, the teams can experiment and iterate on protocol upgrades quickly and independently. 

Additionally, since the Endgame Plan builds on the existing protocol, including all the integrations and liquidity, the teams need to create new components that build on top of the existing system. Such a system requires rigorous testing against up-to-date data as the teams need to preview on-chain operations that handle high loads and perform a lot of calls within a single block. 

Therefore, as the MakerDAO contributor teams continue working on the Endgame Plan, they intend to refactor and redeploy the contracts to new Virtual TestNets and start a new testing cycle. They can then perform automated and load testing to see how smart contracts and frontends operate under heavy load. 

“Migration to Tenderly Virtual TestNets has been a huge help in MakerDAO Endgame development. It also helps with evolving away from the fragmented state of engineering and testing in Web3 toward a healthier, more dynamic, and shared process.” – 0xdeniz, lead technical coordinator at MakerDAO

Want to try Virtual TestNets for free? Spin up your own right now!