Arbitrum Governance Smart Contract Upgrade Technical Details

Earlier this year, DAO voters passed a proposal which allocated funds to a proposal—submitted by @Frisson—which included funding for ScopeLift to upgrade the DAOs Governor contracts. This post is aimed at sharing the technical details of this process. We share it after a technical deep dive pursued by ScopeLift, in collaboration with Tally and other Arbitrum stakeholders.

No specific action is required by community members at this time. Instead, we share this post for transparency purposes, and welcome any feedback or questions the community might have.

Technical Summary

ScopeLift will upgrade the Arbitrum Core Governor and the Arbitrum Treasury Governor. The new Governors will have the same feature set as the current Governors with the following additional features:

  • Proposal Cancellation: During the proposal delay phase, before the voting period has started, the delegate who put the proposal onchain will have the right to cancel it. This means voting on the proposal will not proceed. This feature comes in handy in many scenarios, notably in the instance that a malformed proposal is submitted in error. In such a case, the situation can be rectified without a mass effort to notify delegates to vote against it.
  • Flexible Voting: We will add ScopeLift’s extension to the Governor which allows delegates to cast rolling, fractional votes. This is most useful when smart contract delegates are used to roll up the votes of many pooled token holders. Use cases this extension will enable include voting with tokens in DeFi, shielded voting, voting from Orbit chains, and more. Note that this extension has been audited and will soon be part of the OZ standard Governor.

ScopeLift will not upgrade the Governors using the proxy upgradeable contract pattern. The contracts will not be upgraded in place by pointing the proxies to a new implementation. Upgrades via proxy are less flexible, more time consuming, and more error prone. In the case of the Governors, a superior upgrade path is available, as described below.

ScopeLift will first assemble and extensively test new Governor contracts. The contracts will be audited, then deployed on Arbitrum One. ScopeLift will then coordinate with Frisson as the delegate who will submit proposals to each existing Governor which will transfer the proposer role on the Timelock contracts to the new Governors.

If the proposals pass and execute, the new Governors will become the entry point for Arbitrum Governance moving forward. The old Governors will continue to exist onchain, but will be vestigial, with no ability to actually execute proposals.

FAQ

This approach might raise a number of questions. We will attempt to anticipate and answer them below.

Question: How will delegates know to propose and vote through the new Governors after the upgrade?

Answer: Upgrading Governors by transferring Timelock ownership is a common pattern, and Tally is set up to handle it. Immediately after the upgrade executes, Tally will be updated to use the new Governor contracts, while all historical vote data sourced from the old Governors will still be visible in the client.

Question: Won’t upgrading the Governors require moving the treasury and assigning protocol permissions to the new contracts?

Answer: No. The Timelock contracts hold the Treasury ETH and protocol permissions, because the Timelock is the contract that ultimately executes Governance proposals. This allows us to upgrade the Governors (where virtually all the logic related to governance lives) without needing to move funds or reassign protocol permissions.

Question: How will other Governance proposals be impacted by the upgrade?

Answer: Any proposal that executes before the upgrade proposal will not be impacted, even if voting on the upgrade proposal has already begun. Any proposal that is either queued or being voted on when the upgrade proposal executes could be left in limbo1. For this reason, we suggest the DAO plan to avoid non-critical proposals during the upgrade voting window.

Question: Will the new contracts be proxy upgradeable?

Answer: Yes. Although using proxy upgradeability is not preferred in general, there are scenarios where it might be the right tool for the job. For example, adding a simple view method to the Governor might best be accomplished through a small proxy upgrade. Leaving this tool in the DAO’s toolbox is helpful. Thus, the new Governor contracts will be deployed as Transparent Proxies, using the same Proxy Admin as the existing contracts.

Question: Will customizations made by Arbitrum to the Governor contracts be carried forward to the new Governors?

Answer: Yes. Namely, the new Governor will have all the features provided by the extension from which it inherits. It will also have the custom onlyOwner relay functionality, and the fractional quorum which excludes specific tokens from the quorum calculation.

Question: Is upgrading the Governors risky?

Answer: If done carelessly, a botched upgrade could certainly cause problems. This is why ScopeLift will exercise great care in performing the upgrade.

In particular, ScopeLift will assemble the new Governor using the latest version the OpenZeppelin contracts upgradeable library, along with ScopeLift’s fully audited Flexible Voting extension. We will then write a large suite of tests and simulations to ensure the upgrade will be successful, and that all DAO operations will be able to proceed normally after it is completed.

Based on our previous experience with Gitcoin, PoolTogether, Radworks, and others, we expect this test suite will include hundreds of tests and thousands of lines of code.

These tests simulate the upgrade to the new Governor, from deployment, proposal, Governance vote, and future votes by the DAO. The tests run on a “forked” state from Arbitrum One to simulate the closest possible production state. They exercise all scenarios before and after the upgrade, and ensure governance will still function properly after it is completed.

We will also write scripts for deploying the new Governor and for submitting a proposal for the upgrade to the existing Governor. The scripts will be exercised by the tests.

All tests and simulations are specific to Arbitrum. They exercise the actual code that is live on the network in a simulated environment. They will ensure the upgraded Governor can manage the DAO treasury and execute its role within the protocol.

These tests will be written as fuzz tests and invariant tests, meaning they will take random arbitrary inputs rather than hardcoded parameters. We will execute millions of scenarios through these tests before proceeding.

The entire codebase will be carefully audited by the OpenZeppelin team before being deployed. Finally, the tests will also be updated to run with the actual, deployed bytecode, and with the proposal calldata, once both are live onchain.

ScopeLift has executed on this process for other DAOs. With these safeguards in place, we are confident the upgrade can be completed with minimal risk and without disruption to the DAO.

Timeline

ScopeLift has already begun preliminary work on this process, and will be accelerating on it in the weeks ahead. We are aiming to complete the work by the end of June, such that the contracts can be audited in early July. The DAO should expect a proposal for the upgrade to be submitted in mid-July at the earliest.


1 It is, in fact, possible to graft old proposal state onto the new governor so that even mid-flight proposals stay valid. This approach would increase complexity and risk, and on balance, we don’t find it worthwhile vs. the alternative, i.e. a short window during which no new proposals should be created.

4 Likes

Are you confident in this approach?
The whole of the Arbitrum Governance system works through proxies and upgrading them in-place.

This would be a big deviation.

This will lead to a loss of history. Offchain systems attempting to index and surface governance information will need to integrate the old and new governors.

1 Like

Hey @fred, good questions. In short: yes. We are confident in this approach. We’ve already sanity checked it with OpenZeppelin and some other stakeholders who are familiar with the system.

Importantly, we are only upgrading the Governor contracts. There are many other contracts in the Arbitrum governance system that we are not touching and which would likely be best updated via proxies if they ever needed to be upgraded. Governor contracts are typically updated using the method we are applying.

2 Likes

OpenZeppelin reviewed the new governor contracts developed by ScopeLift. You may read our full review here:

2 Likes

Hey all, wildmolasses from ScopeLift here. Now that the new contracts are developed (repo) and audited (see post from openzeppelin above), here’s what the proposal rollout could like like:

ScopeLift todos:

After the above is done, a delegate todo:

  • create the proposal on chain. (script)

A couple notes:

  • We recommend that once this proposal is onchain, no new proposals are created until after it passes and executes (or fails, of course). If a proposal were to be created during this time, it would likely get stuck and have to be resubmitted to the corresponding new Governor.
  • we can PR these contracts (and an updated L2AddressRegistry) into the main arbitrum governance repo if it’s useful.

Happy to answer any questions, just let us know!

3 Likes

OpenZeppelin, as the Security Member of the ARDC, is proposing a Rollout Plan of the Arbitrum Governance Upgrade, based on the recommendations of ScopeLift, to prevent new proposal submissions during key stages of the Upgrade.

We propose a moratorium for proposal submissions up until the end of voting for the Upgrade (Sept 2nd to Sept 19th) along with a preliminary submission period when proposals may be submitted prior to the execution of the Upgrade (Sept 19th to Oct 4th). It’s important that all delegates review and adhere to the given timeline to avoid their proposals from being disrupted during the Upgrade and requiring resubmission.

You can see more details on the timeline in our full post:

As discussed on the call, a change in contract address will require a proactive awareness campaign to ensure all downstream consumers affirm they are ready to consume the changes. I generally disagree with deploying new contracts and would rather upgrade the current implementation, but if we are upgrading the proxy itself because it’s using an outdated pattern, this better future proofs the protocol, and the negative impact is minimal then I am supportive as long as downstream consumers are notified (esp the Dune Community as their dashboards will likely silently fail).

4 Likes

@wildmolasses when can we know the new contract addresses? when will they be deployed?

1 Like

They were already deployed.

Quoting from Arbitrum Governance Upgrade Rollout & Timeline

4 Likes