Smart Contracts Release Process
Details of the release process for updating smart contracts on the Celo platform.
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.
Changes to core smart contracts are made via on-chain Governance, approximately four times a year. When a release is made, all smart contracts from the release branch that differ from the deployed smart contracts are released, and included in the same governance proposal. Each release is identified by a unique monotonically increasing version number 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 the getVersionNumber()
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 under packages/protocol/releaseData/initializationData/release${N}.json
.