- When AvalancheGo increases its RPC chain VM protocol version, which you can also check in its
version/compatibility.json - When Subnet-EVM needs to release a new feature or bug fix.
ℹ️ you should always create a release candidate first, and only if everything is fine, you can create a release.
In this section, we create a release candidate v0.7.3-rc.0. We therefore assign these environment variables to simplify copying instructions:
export VERSION_RC=v0.7.3-rc.0
export VERSION=v0.7.3Remember to use the appropriate versioning for your release.
-
Create your branch, usually from the tip of the
masterbranch:git fetch origin master git checkout master git checkout -b "releases/$VERSION_RC" -
Update the RELEASES.md file with the new release version
$VERSION. -
Modify the plugin/evm/version.go
Versionglobal string variable and set it to the desired$VERSION. -
Ensure the AvalancheGo version used in go.mod is its last release. If not, upgrade it with, for example:
go get github.com/ava-labs/avalanchego@v1.13.0 go mod tidy
And fix any errors that may arise from the upgrade. If it requires significant changes, you may want to create a separate PR for the upgrade and wait for it to be merged before continuing with this procedure.
-
Add an entry in the object in compatibility.json, adding the target release
$VERSIONas key and the AvalancheGo RPC chain VM protocol version as value, to the"rpcChainVMProtocolVersion"JSON object. For example, we would add:"v0.7.3": 39,
💁 If you are unsure about the RPC chain VM protocol version, set the version to
0, for example"v0.7.3": 0, and then run:go test -run ^TestCompatibility$ github.com/ava-labs/subnet-evm/plugin/evmThis will fail with an error similar to:
compatibility.json has subnet-evm version v0.7.3 stated as compatible with RPC chain VM protocol version 0 but AvalancheGo protocol version is 39This message can help you figure out what the correct RPC chain VM protocol version (here
39) has to be in compatibility.json for your current release. Alternatively, you can refer to the Avalanchego repositoryversion/compatibility.jsonfile to find the RPC chain VM protocol version matching the AvalancheGo version we use here. -
Specify the AvalancheGo compatibility in the README.md relevant section. For example we would add:
... [v0.7.3] AvalancheGo@v1.12.2/1.13.0-fuji/1.13.0 (Protocol Version: 39) -
Commit your changes and push the branch
git add . git commit -S -m "chore: release $VERSION_RC" git push -u origin "releases/$VERSION_RC"
-
Create a pull request (PR) from your branch targeting master, for example using
gh:gh pr create --repo github.com/ava-labs/subnet-evm --base master --title "chore: release $VERSION_RC" -
Wait for the PR checks to pass with
gh pr checks --watch
-
Squash and merge your release branch into
master, for example:gh pr merge "releases/$VERSION_RC" --squash --subject "chore: release $VERSION_RC" --body "\n- Update AvalancheGo from v1.1X.X to v1.1X.X"
Ensure you properly label the AvalancheGo version.
-
Create and push a tag from the
masterbranch:git fetch origin master git checkout master # Double check the tip of the master branch is the expected commit # of the squashed release branch git log -1 git tag -s "$VERSION_RC" git push origin "$VERSION_RC"
Once the tag is created, you need to test it on the Fuji testnet both locally and then as canaries, using the Dispatch and Echo subnets.
💁 If your machine is too low on resources (memory, disk, CPU, network), or the subnet is quite big to bootstrap (notably dfk, shrapnel and gunzilla), you can run an AWS EC2 instance with the following steps.
-
Find the Dispatch and Echo L1s blockchain ID and subnet ID:
- Dispatch L1 details. Its subnet id is
7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5. - Echo L1 details. Its subnet id is
i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK.
- Dispatch L1 details. Its subnet id is
-
Get the blockchain ID and VM ID of the Echo and Dispatch L1s with:
-
Dispatch:
curl -X POST --silent -H 'content-type:application/json' --data '{ "jsonrpc": "2.0", "method": "platform.getBlockchains", "params": {}, "id": 1 }' https://api.avax-test.network/ext/bc/P | \ jq -r '.result.blockchains[] | select(.subnetID=="7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5") | "\(.name)\nBlockchain id: \(.id)\nVM id: \(.vmID)\n"'
Which as the time of this writing returns:
dispatch Blockchain id: 2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY VM id: mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o -
Echo:
curl -X POST --silent -H 'content-type:application/json' --data '{ "jsonrpc": "2.0", "method": "platform.getBlockchains", "params": {}, "id": 1 }' https://api.avax-test.network/ext/bc/P | \ jq -r '.result.blockchains[] | select(.subnetID=="i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK") | "\(.name)\nBlockchain id: \(.id)\nVM id: \(.vmID)\n"'
Which as the time of this writing returns:
echo Blockchain id: 98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp VM id: meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF
-
-
In the subnet-evm directory, build the VM using
./scripts/build.sh vm.bin
-
Copy the VM binary to the plugins directory, naming it with the VM ID:
mkdir -p ~/.avalanchego/plugins cp vm.bin ~/.avalanchego/plugins/mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o cp vm.bin ~/.avalanchego/plugins/meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF rm vm.bin
-
Clone AvalancheGo:
git clone git@github.com:ava-labs/avalanchego.git
-
Checkout correct AvalancheGo version, the version should match the one used in Subnet-EVM
go.modfilecd avalanchego git checkout v1.13.0 -
Get upgrades for each L1 and write them out to
~/.avalanchego/configs/chains/<blockchain-id>/upgrade.json:mkdir -p ~/.avalanchego/configs/chains/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY curl -X POST --silent --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "method": "eth_getChainConfig", "params": [], "id": 1 }' https://subnets.avax.network/dispatch/testnet/rpc | \ jq -r '.result.upgrades' > ~/.avalanchego/configs/chains/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY/upgrade.json
Note it is possible there is no upgrades so the upgrade.json might just be
{}.mkdir -p ~/.avalanchego/configs/chains/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp curl -X POST --silent --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "method": "eth_getChainConfig", "params": [], "id": 1 }' https://subnets.avax.network/echo/testnet/rpc | \ jq -r '.result.upgrades' > ~/.avalanchego/configs/chains/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp/upgrade.json
-
(Optional) You can tweak the
config.jsonfor each L1 if you want to test a particular feature for example.- Dispatch:
~/.avalanchego/configs/chains/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY/config.json - Echo:
~/.avalanchego/configs/chains/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp/config.json
- Dispatch:
-
(Optional) If you want to reboostrap completely the chain, you can remove
~/.avalanchego/chainData/<blockchain-id>/db/pebbledb, for example:- Dispatch:
rm -r ~/.avalanchego/chainData/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY/db/pebbledb - Echo:
rm -r ~/.avalanchego/chainData/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp/db/pebbledb
AvalancheGo keeps its database in
~/.avalanchego/db/fuji/v1.4.5/*.ldbwhich you should not delete. - Dispatch:
-
Build AvalancheGo:
./scripts/build.sh
-
Run AvalancheGo tracking the Dispatch and Echo Subnet IDs:
./build/avalanchego --network-id=fuji --partial-sync-primary-network --public-ip=127.0.0.1 \ --track-subnets=7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5,i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK
-
Follow the logs and wait until you see the following lines:
- line stating the health
check started passing - line containing
consensus started - line containing
bootstrapped healthy nodes
- line stating the health
-
In another terminal, check you can obtain the current block number for both chains:
-
Dispatch:
curl -X POST --silent --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' localhost:9650/ext/bc/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY/rpc
-
Echo:
curl -X POST --silent --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' localhost:9650/ext/bc/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp/rpc
-
-
Create a branch from the
mainbranch of the externals plugin builder repository.git checkout main git pull git checkout -b "echo-dispatch-$VERSION_RC" -
Modify [
configs/dispatch.yml] and [configs/echo.yml] similarly by:- changing the
app_versionto$VERSION_RC - if necessary, change the
avalanchego_version - if necessary, change the
golang_version
- changing the
-
Commit your changes and push the branch
git add . git commit -m "Bump echo and dispatch to $VERSION_RC" git push -u origin "echo-dispatch-$VERSION_RC"
-
Open a pull request targeting
main, for example usinggh:gh pr create --repo github.com/ava-labs/external-plugins-builder --base main --title "Bump echo and dispatch to $VERSION_RC" -
Once the PR checks pass, you can squash and merge it. The Subnet EVM build Github action then creates one or more pull requests in devops-argocd, for example
Auto image update for testnet/echoandAuto image update for testnet/dispatch. -
Once an automatically created pull request gets merged, it will be deployed, you can then monitor:
- For Dispatch:
- For Echo:
Note some metrics might be not showing up until a test transaction is ran.
-
Launch a test transaction:
- If you have no wallet setup, create a new one using the Core wallet
- Go to the settings and enable Testnet Mode
- You need DIS (Dispatch) and ECH (Echo) testnet tokens. If you don't have one or the other, send your C-chain AVAX address to one of the team members who can send you some DIS/ECH testnet tokens. The portfolio section of the core wallet should then show the DIS and ECH tokens available.
- For both Dispatch and Echo, in the "Command center", select Send, enter your own C-Chain AVAX address in the Send To field, set the Amount to 1 and click on Send. Finally, select a maximum network fee, usually Slow works, and click on Approve.
-
You should then see the transaction impact the logs and metrics, for example
Apr 03 10:35:00.000 i-0158b0eef8b774d39 subnets Commit new mining work Apr 03 10:34:59.599 i-0158b0eef8b774d39 subnets Resetting chain preference Apr 03 10:34:56.085 i-0aca0a4088f607b7e subnets Served eth_getBlockByNumber Apr 03 10:34:55.619 i-0ccd28afbac6d9bfc subnets built block Apr 03 10:34:55.611 i-0ccd28afbac6d9bfc subnets Commit new mining work Apr 03 10:34:55.510 gke-subnets-testnet subnets Submitted transaction
If a successful release candidate was created, you can now create a release.
Following the previous example in the Release candidate section we will create a release v0.7.3 indicated by the $VERSION variable.
-
Create and push a tag from the
masterbranch:git checkout master git pull origin # Double check the tip of the master branch is the expected commit # of the squashed release branch git log -1 git tag -s "$VERSION" git push origin "$VERSION"
-
Create a new release on Github, either using:
-
-
In the "Choose a tag" box, select the tag previously created
$VERSION(v0.7.3) -
Pick the previous tag, for example as
v0.7.2. -
Set the "Release title" to
$VERSION(v0.7.3) -
Set the description using this format:
# AvalancheGo Compatibility The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.13.0. # Breaking changes # Features # Fixes # Documentation
-
Only tick the box "Set as the latest release"
-
Click on the "Create release" button
-
-
the Github CLI
gh:PREVIOUS_VERSION=v0.7.2 NOTES="# AvalancheGo Compatibility The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.13.0. # Breaking changes # Features # Fixes # Documentation " gh release create "$VERSION" --notes-start-tag "$PREVIOUS_VERSION" --notes-from-tag "$VERSION" --title "$VERSION" --notes "$NOTES" --verify-tag
-
-
Monitor the release Github workflow to ensure the GoReleaser step succeeds and check the binaries are then published to the releases page. In case this fails, you can trigger the workflow manually:
- Go to github.com/ava-labs/subnet-evm/actions/workflows/release.yml
- Click on the "Run workflow" button
- Enter the branch name, usually with goreleaser related fixes
- Enter the tag name
$VERSION(i.e.v0.7.3)
-
Monitor the Publish Docker image workflow succeeds. Note this workflow is triggered when pushing the tag, unlike Goreleaser which triggers when publishing the release.
-
Finally, create a release for precompile-evm
After you have successfully released a new subnet-evm version, you need to bump all of the versions again in preperation for the next release. Note that the release here is not final, and will be reassessed, and possibly changer prior to release. Some releases require a major version update, but this will usually be $VERSION + 0.0.1. For example:
export P_VERSION=v0.7.4-
Create a branch, from the tip of the
masterbranch after the release PR has been merged:git fetch origin master git checkout master git checkout -b "prep-$P_VERSION-release" -
Bump the version number to the next pending release version,
$P_VERSION- Update the RELEASES.md file with
$P_VERSION, creating a space for maintainers to place their changes as they make them. - Modify the plugin/evm/version.go
Versionglobal string variable and set it to$P_VERSION. - Add an entry in the object in compatibility.json, adding the next pending release versionas key and the AvalancheGo RPC chain VM protocol version as value, to the
"rpcChainVMProtocolVersion"JSON object. For example, we would add:
"v0.7.4": 39,
💁 If you are unsure about the RPC chain VM protocol version, set the version to
0, for example"v0.7.4": 0, and then run:go test -run ^TestCompatibility$ github.com/ava-labs/subnet-evm/plugin/evmThis will fail with an error similar to:
compatibility.json has subnet-evm version v0.7.4 stated as compatible with RPC chain VM protocol version 0 but AvalancheGo protocol version is 39This message can help you figure out what the correct RPC chain VM protocol version (here
39) has to be in compatibility.json for your current release. Alternatively, you can refer to the Avalanchego repositoryversion/compatibility.jsonfile to find the RPC chain VM protocol version matching the AvalancheGo version we use here. - Update the RELEASES.md file with
-
Commit your changes and push the branch
git add . git commit -S -m "chore: prep release $P_VERSION" git push -u origin "prep-$P_VERSION-release"
-
Create a pull request (PR) from your branch targeting master, for example using
gh:gh pr create --repo github.com/ava-labs/subnet-evm --base master --title "chore: prep next release $P_VERSION" -
Wait for the PR checks to pass with
gh pr checks --watch
-
Squash and merge your branch into
master, for example:gh pr merge "prep-$P_VERSION-release" --squash --subject "chore: prep next release $P_VERSION"
-
Pat yourself on the back for a job well done.