As of block height 31,056,500 (March 26, 2025, 3:00 AM UTC), Celo is no longer a standalone Layer 1 blockchaināit is now an Ethereum Layer 2!
Some documentation may be outdated as updates are in progress. If you encounter issues, please file a bug report.For the most up-to-date information, refer to our Celo L2 documentation.
This release process is a work in progress. Many infrastructure components required to execute it are not in place, and the process itself is subject to change.
Versioning
Each deployed Celo core smart contract is versioned independently, according to semantic versioning, as described at semver.org, with the following modifications:- STORAGE version when you make incompatible storage layout changes
- MAJOR version when you make incompatible ABI changes
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
N
, with 1
being the first release.
Core Contracts
Every deployed Celo core contract has its current version number as a constant which is publicly accessible via thegetVersionNumber()
function, which returns the storage, major, minor, and patch versions. The version number is encoded in the Solidity source and updated as part of code changes.
Celo Core Contracts deployed to a live network without the getVersionNumber()
function, such as the original set of core contracts, are to be considered version 1.1.0.0
.
Mixins and libraries
Mixin contracts and libraries are considered part of the contracts that consume them. When a mixin or library has changed, all contracts that consume them should be considered to have changed as well, and thus the contracts should have their version numbers incremented and should be re-deployed as part of the next smart contract release.Initialize Data
Whenever Celo Core Contracts need to be re-initialized, their initialization arguments should be checked into version control underpackages/what-is-celo/about-celo-l1/protocol/releaseData/initializationData/release${N}.json
.
Release management in Git/Github
Github branches/tags and Github releases are used to coordinate past and ongoing releases. Ongoing smart contract development is done on themaster
branch (even after release branches are cut). Every smart contract release has a designated release branch, e.g. release/core-contracts/${N}
in the celo-monorepo.
When a new release branch is cut:
- A new release branch is created
release/core-contracts/${N}
with the contracts to be audited. - The latest commit on the release branch is tagged with
core-contracts.v${N}.pre-audit
. - On Github, a pre-release Github release should be created pointing at the latest tag on the release branch.
- On master branch,
.circleci/config.yml
should be edited so that the variableRELEASE_TAG
points to the tagcelo-core-contracts-v${N}.pre-audit
so that all future changes to master are versioned against the new release. - Ongoing audit responses/fixes should continue to go into
release/celo-core-contracts/${N}
.
After a completed release process:
- The release branch should be merged into
master
with a merge commit (instead of the usual squash merge strategy). - On master branch,
.circleci/config.yml
should be edited so that the variableRELEASE_TAG
points to the tagcore-contracts.v${N}
Release Process
There are several scripts provided (underpackages/protocol
in celo-org/celo-monorepo and via celocli) for use in the release process and with contract upgrade governance proposals to give participating stakeholders increased confidence.
For these to run, you may need to follow the setup instructions. These steps include installing Node and setting
nvm
to use the correct version of Node. Successful yarn install
and yarn build
in the protocol package signal a completed setup.- By default, the scripts expect a celo-blockchain RPC at port 8545 locally. With
-f
you can specify the scripts to use a hosted forno node - By default, scripts will output verbose logs under
/tmp/celo-${script-name}.log
. You can change the location of the log output with-l file.log
View the tagged releases for each network
Verify the previous Release on the Network
release:verify-deployed
is a script that allows you to assess whether the bytecode on the given network matches the source code of a particular commit. It will run through the Celo Core Contracts and verify that the contractsā bytecodes as specified in the Registry
match. Here, we will want to sanity-check that our network is running the previous releaseās audited commit.
libraries.json
file is written to disk only necessary for release:make
that describes linked library addresses.
Check Backward Compatibility
This script performs some automatic checks to ensure that the smart contract versions in the source code have been set correctly with respect to the latest release. It is run as part of CI and helps ensure that backwards incompatibilities are not accidentally introduced by requiring that devs manually update version numbers whenever smart contract changes are made. Specifically, it compiles the latest and candidate releases and compares smart contracts:- Storage layout, to detect storage version changes
- ABI, to detect major and minor version changes
- Bytecode, to detect patch version changes
- If the STORAGE version has changed, it does not perform backward compatibility checks
- If the MAJOR version has changed, it checks storage layout compatibility but not ABI compatibility
release:verify-deployed -b $PREVIOUS_RELEASE -n $NETWORK
to ensure the compatibility checks compare the release candidate to what is actually active on the network.
Deploy the release candidate
Use the following script to build and deploy a candidate release. This takes as input the corresponding backward compatibility report and canonical library address mapping to deploy changed contracts to the specified network. (Use-d
to dry-run the deploy).
STORAGE updates are adopted by deploying a new proxy/implementation pair. This script outputs a JSON contract upgrade governance proposal.
Submit Upgrade Proposal
Submit the autogenerated upgrade proposal to the Governance contract for review by voters, outputting a unique identifier.Fetch Upgrade Proposal
Fetch the upgrade proposal and output the JSON encoded proposal contents.Verify Proposed Release Candidate
This script serves the same purpose asrelease:verify-deployed
but for a not-yet
accepted contract upgrade (in the form of the proposal.json you fetched in the step prior). It gives you the confidence that the branch specified in the -b
flag in (same as release:check-versions
) will be the resulting network state of the proposal if executed. It does so by going over all Celo Core Contracts and determining updates to the Registry pointers, proxy or implementation contracts and verifying their implied bytecode against the compiled source code.
Additionally, include initialization_data.json
from the CGP if any of the contracts have to be initialized.
Verify Executed Release
After a release executes via Governance, you can userelease:verify-deployed
again to check that the resulting network state does indeed reflect the tagged release candidate:
Testing
All releases should be evaluated according to the following tests.Unit tests
All changes since the last release should be covered by unit tests. Unit test coverage should be enforced by automated checks run on every commit.Manual Checklist
After a successful release execution on a testnet, the resulting network state should be spot-checked to ensure that no regressions have been caused by the release. Flows to test include:- Do a cUSD and CELO transfer
- Register a Celo account
- Report an Oracle rate
- Do a CP-DOTO exchange
- Complete a round of attestation
- Redeem from Escrow
- Register a Vaildator
- Vote for a Validator
- Run a mock election
- Get a valildator slashed for downtime and ejected from the validator set
- Propose a governance proposal and get it executed
Automated environment tests
Stakeholders can use theenv-tests
package in celo-monorepo
to run an automated test suite against the network
Verify smart contracts
Verification of smart contracts should be done both on https://celoscan.io/ and https://celo.blockscout.com/.Performance
A ceiling on the gas consumption for all common operations should be defined and enforced by automated checks run on every commit. For troubleshooting please see Readme.md of protocol package.Backwards compatibility
Automated checks should ensure that any new commit tomaster
does not introduce a breaking change to storage layout, ABI, or other common backward compatibility issues unless the STORAGE or MAJOR version numbers are incremented.
Backwards compatibility tests will also be run before every release to confirm that no breaking changes exist between the pending release and deployed smart contracts.
Audits
All changes since the last release should be audited by a reputable third party auditor.Emergency patches
If patches need to be applied before the next scheduled smart contract release, they should be cherry-picked to a new release branch, branched from the latest deployed release branch.Promotion process
Deploying a new contract release should occur with the following process. On-chain governance proposals should be submitted on Tuesdays for consistency and predictability.Date | Action |
T |
|
T+1w |
|
T+2w |
|
T+3w |
|
T+4w |
|
T+5w |
|
Communication guidelines
Communicating the upcoming governance proposal to the community is critical and may help getting it approved. Each smart contract release governance proposal should be accompanied by a Governance category forum post that contains the following information:- Name of proposer (individual contributor or organization).
- Background information.
- Link to the release on Github.
- Link to the audit report(s).
- Anticipated timings for the Baklava and Alfajores testnets and Mainnet.
#governance
channel.
Emergency patches
Work in progress
Vulnerability Disclosure
Vulnerabilities in smart contract releases should be disclosed according to the security policy.Dependencies
NoneDependents
Work in progress