Skip to content

Latest commit

 

History

History
170 lines (104 loc) · 7.88 KB

RELEASE.rst

File metadata and controls

170 lines (104 loc) · 7.88 KB

Release Process Document

Package Deliverables

For each contract version x.y.z, deliverables are located in raiden_contracts/data_x.y.z. For the version currently under development, deliverables are located in raiden_contracts/data

Deliverables:

  • smart contracts source code from raiden_contracts/data*/source
  • compiled contracts data from raiden_contracts/data*/contracts.json
  • deployment information from raiden_contracts/data*/deployment_*.json, with Ethereum addresses, transaction data (transaction hash, block number, constructor arguments, gas cost)
  • gas costs information from raiden_contracts/data*/gas.json
  • scripts for deployment & contract verification on Etherscan from raiden_contracts/deploy
  • source code tests from raiden_contracts/tests

Package Release Process

When we want to release another version of the raiden-contracts package, we need to:

  1. Check if any source code changes have been done. If no, skip this step. If yes:
    1. Bump the version on the smart contracts
    2. Deploy smart contracts on all the supported chains and overwrite deployment_*,json files with the new deployment data.
    3. Verify the deployed smart contracts on Etherscan
    4. Measure Gas Costs
    5. Create a new data directory
  2. Update Changelog
  3. Bump the package version
  4. Release the new package version

Check Source Code Changes

First, identify the last release in the GitHub page and find the corresponding tag in Git.

For a package release, source code changes imply changes in:

Compiled Data

The compiled data for all the contracts resides in the data/contracts.json file.

Now, we do not manually need to check if the compiled data is correct, because this check is included in our Continuous Integration testing. Any source code change forces us to recompile the contracts with make compile_contracts, otherwise our CI tests will fail: https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/raiden_contracts/tests/test_contracts_compilation.py. These tests check:

  • if the contracts_version from contracts.json matches the current CONTRACTS_VERSION
  • if the contracts_checksums and overall_checksum from contracts.json matches the source code checksums, calculated in the test.

Additionally, we test whether each contract source code contracts_version matches the CONTRACTS_VERSION. E.g. https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/raiden_contracts/tests/test_token_network.py#L16-L17

Deployment Data

Deployment data is kept in the data/deployment_[CHAIN_NAME].json files.

We DO need to manually check whether source code changes have been done since the last release. We should add an automatic check here before releasing (e.g. checking that the contracts_version here matches the one from data/contracts.json)

Bump Smart Contracts Version

bumpversion --config-file ./.bumpversion_contracts.cfg [PART]

[PART] can be major, minor, patch.

Deploy Smart Contracts

Instructions for deploying the contracts can be found at https://github.com/raiden-network/raiden-contracts#deployment-on-a-testnet, using the python -m raiden_contracts.deploy script. We currently deploy on:

  • Ropsten - for all releases
  • Rinkeby - for all releases
  • Kovan - for all releases
  • Görli - for all releases
  • Mainnet - only for pre-major or major releases

Checking Validity of deployment_*.json Data

We have checks for: - contracts_version: https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/raiden_contracts/deploy/__main__.py#L503 - chain_id: https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/raiden_contracts/deploy/__main__.py#L503 - deployment addresses & transaction data for each contract, checked against the chain we are running the script on

These checks are performed at the end of the deployment script. They can also be run independently with python -m raiden_contracts.deploy verify, as described in the above link.

We also have CI tests that check whether the deployment data returned by the deployment script contains all necessary information, for all the contracts we need to deploy: https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/raiden_contracts/tests/test_deploy_script.py.

Etherscan Verification

Etherscan verification is documented here: https://github.com/raiden-network/raiden-contracts#verification-with-etherscan.

Note that we currently have some issues with the script: raiden-network#349.

Measure Gas Costs

raiden_contracts package provides data/gas.json showing the amount of gas that each operation requires. A pytest execution updates the JSON file:

pytest raiden_contracts/tests/test_print_gas.py

Create a New Data Directory

Copy data directory into data_x.y.z where x.y.z is the contract version. Also, edit data_x.y.z/contracts.json to change contracts_version from null to x.y.z.

Change the Versions of CHANGELOG.md

  • Make sure all significant changes from the last release are listed.
  • Turn the existing Unreleased section into a new release section.

Bump Package Version

Before bumping the package version, git add the deployment data at data/deployment_[CHAIN_NAME].json. Also make sure MANIFEST.in contains all the deployment JSON files. Then run

bumpversion --config-file ./.bumpversion.cfg [PART]

[PART] can be major, minor, patch.

This command triggers a commit and a local tag is created. A PR must be made with the commit changes.

Trigger Package Release

Push the newly created local tag (created at the previous step, e.g. v0.9.0) directly to the master branch. This will trigger travis to upload the pypi package automatically, as seen here: https://github.com/raiden-network/raiden-contracts/blob/9fd2124eb648a629aee886f37ade5e502431371f/.travis.yml#L36-L47.