diff --git a/RELEASES.md b/RELEASES.md index 3231ebaa44e1..4a9d2ba2f151 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2,6 +2,10 @@ ## Pending (v1.14.2) +### Breaking Changes + +- Removed `graft/subnet-evm/compatibility.json` in favor of using a single source of truth in `version/compatibility.json`. External tools (e.g., infra/avacloud) that relied on this file should now use `version/compatibility.json` from the main AvalancheGo repository. + ### Config - Removed `pull-gossip-poll-size` from the X-chain and P-chain configs. diff --git a/RELEASING_README.md b/RELEASING_README.md index 6edc3ddd2252..83ecd4ed5bac 100644 --- a/RELEASING_README.md +++ b/RELEASING_README.md @@ -1,453 +1,405 @@ -# THIS README IS WHOLLY OUT OF DATE AND WILL BE UPDATED! +# AvalancheGo Release Guide -# Releasing +This document covers the complete release process for AvalancheGo and its integrated components (Coreth and Subnet-EVM). -## When to release +## Overview -- When [AvalancheGo](https://github.com/ava-labs/avalanchego/releases) increases its RPC chain VM protocol version, which you can also check in [its `version/compatibility.json`](https://github.com/ava-labs/avalanchego/blob/master/version/compatibility.json) -- When Subnet-EVM needs to release a new feature or bug fix. +AvalancheGo is a monorepo which contains: -## Procedure +- **AvalancheGo** - The main Avalanche node implementation +- **Coreth** (in [graft/coreth/](graft/coreth/)) - C-Chain EVM implementation, compiled into AvalancheGo +- **Subnet-EVM** (in [graft/subnet-evm/](graft/subnet-evm/)) - Subnet-EVM plugin, released as a separate binary -### Release candidate +### Versioning Strategy -â„šī¸ you should always create a release candidate first, and only if everything is fine, you can create a release. +All components follow aligned versioning: -In this section, we create a release candidate `v0.7.3-rc.0`. We therefore assign these environment variables to simplify copying instructions: +- Same version number - When AvalancheGo releases v1.14.0, Subnet-EVM is also v1.14.0 +- Single tag - One git tag (e.g., `v1.14.0`) releases everything together -```bash -export VERSION_RC=v0.7.3-rc.0 -export VERSION=v0.7.3 -``` - -Remember to use the appropriate versioning for your release. - -1. Create your branch, usually from the tip of the `master` branch: - - ```bash - git fetch origin master - git checkout master - git checkout -b "releases/$VERSION_RC" - ``` - -1. Update the [RELEASES.md](../../RELEASES.md) file with the new release version `$VERSION`. -1. Modify the [plugin/evm/version.go](../../plugin/evm/version.go) `Version` global string variable and set it to the desired `$VERSION`. -1. Ensure the AvalancheGo version used in [go.mod](../../go.mod) is [its last release](https://github.com/ava-labs/avalanchego/releases). If not, upgrade it with, for example: - - ```bash - 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. - -1. Add an entry in the object in [compatibility.json](../../compatibility.json), adding the target release `$VERSION` as key and the AvalancheGo RPC chain VM protocol version as value, to the `"rpcChainVMProtocolVersion"` JSON object. For example, we would add: - - ```json - "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: - - ```bash - go test -run ^TestCompatibility$ github.com/ava-labs/subnet-evm/plugin/evm - ``` - - This will fail with an error similar to: - - ```text - compatibility.json has subnet-evm version v0.7.3 stated as compatible with RPC chain VM protocol version 0 but AvalancheGo protocol version is 39 - ``` +### Component Release Notes - This 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 repository `version/compatibility.json` file](https://github.com/ava-labs/avalanchego/blob/master/version/compatibility.json) to find the RPC chain VM protocol version matching the AvalancheGo version we use here. -1. Specify the AvalancheGo compatibility in the [README.md relevant section](../../README.md#avalanchego-compatibility). For example we would add: +| Component | Release Artifact | Notes | +|-----------|-----------------|-------| +| AvalancheGo | `avalanchego` binary | Main node binary | +| Coreth | None (compiled into AvalancheGo) | No separate release; version in `version.go` is informational only | +| Subnet-EVM | `subnet-evm` binary | Separate plugin binary for L1s | - ```text - ... - [v0.7.3] AvalancheGo@v1.12.2/1.13.0-fuji/1.13.0 (Protocol Version: 39) - ``` - -1. Commit your changes and push the branch - - ```bash - git add . - git commit -S -m "chore: release $VERSION_RC" - git push -u origin "releases/$VERSION_RC" - ``` - -1. Create a pull request (PR) from your branch targeting master, for example using [`gh`](https://cli.github.com/): +## Release Procedure - ```bash - gh pr create --repo github.com/ava-labs/subnet-evm --base master --title "chore: release $VERSION_RC" - ``` +### 1. Preparation -1. Wait for the PR checks to pass with +You should always create a release candidate first, and only if everything is fine, can you create a release. In this section we create a release candidate `v1.14.1-rc.0`. We therefore assign these environment variables to simplify copying instructions: - ```bash - gh pr checks --watch - ``` +```bash +export VERSION_RC=v1.14.1-rc.0 +export VERSION=v1.14.1 +``` -1. Squash and merge your release branch into `master`, for example: +### 2. Create Release Branch - ```bash - gh pr merge "releases/$VERSION_RC" --squash --subject "chore: release $VERSION_RC" --body "\n- Update AvalancheGo from v1.1X.X to v1.1X.X" - ``` +```bash +git fetch origin master +git checkout master +git checkout -b "releases/$VERSION_RC" +``` - Ensure you properly label the AvalancheGo version. +### 3. Update Version Files -1. Create and push a tag from the `master` branch: +1. Update [`version/constants.go`](version/constants.go): - ```bash - 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" - ``` + ```go + Current = &Application{ + Name: Client, + Major: 1, + Minor: 14, + Patch: 1, + } + ``` -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. +1. Update [`RELEASES.md`](RELEASES.md) - rename "Pending" section to the new version and create a new "Pending" section. -#### Local deployment +1. If RPC chain VM protocol version changed, update [`version/constants.go`](version/constants.go): -💁 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](https://github.com/ava-labs/eng-resources/blob/main/dev-node-setup.md) with the following steps. + ```go + RPCChainVMProtocol uint = 45 + ``` -1. Find the Dispatch and Echo L1s blockchain ID and subnet ID: - - [Dispatch L1 details](https://subnets-test.avax.network/dispatch/details). Its subnet id is `7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5`. - - [Echo L1 details](https://subnets-test.avax.network/echo/details). Its subnet id is `i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK`. -1. Get the blockchain ID and VM ID of the Echo and Dispatch L1s with: - - Dispatch: + And update [`version/compatibility.json`](version/compatibility.json) to add the new version. - ```bash - 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"' - ``` +**Note:** Coreth and Subnet-EVM versions are automatically derived from `version/constants.go` and do not require manual updates. - Which as the time of this writing returns: +### 4. Commit and Create PR - ```text - dispatch - Blockchain id: 2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY - VM id: mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o - ``` - - - Echo: +```bash +git add . +git commit -S -m "chore: release $VERSION_RC" +git push -u origin "releases/$VERSION_RC" +``` - ```bash - 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"' - ``` +Create PR: - Which as the time of this writing returns: +```bash +gh pr create --repo github.com/ava-labs/avalanchego --base master --title "chore: release $VERSION_RC" +``` - ```text - echo - Blockchain id: 98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp - VM id: meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF - ``` +Wait for checks: -1. In the subnet-evm directory, build the VM using +```bash +gh pr checks --watch +``` - ```bash - ./scripts/build.sh vm.bin - ``` +Merge: -1. Copy the VM binary to the plugins directory, naming it with the VM ID: +```bash +gh pr merge "releases/$VERSION_RC" --squash --subject "chore: release $VERSION_RC" +``` - ```bash - mkdir -p ~/.avalanchego/plugins - cp vm.bin ~/.avalanchego/plugins/mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o - cp vm.bin ~/.avalanchego/plugins/meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF - rm vm.bin - ``` +### 5. Create Release Candidate Tag -1. Clone [AvalancheGo](https://github.com/ava-labs/avalanchego): +```bash +git fetch origin master +git checkout master +# Double check the tip of the master branch is the expected commit +# of the squared release branch +git log -1 +git tag -s "$VERSION_RC" +git push origin "$VERSION_RC" +``` - ```bash - git clone git@github.com:ava-labs/avalanchego.git - ``` +### 6. Test the Release Candidate -1. Checkout correct AvalancheGo version, the version should match the one used in Subnet-EVM `go.mod` file +#### Local Deployment on Fuji - ```bash - cd avalanchego - git checkout v1.13.0 - ``` +If your machine is too low on resources, you can run an [AWS EC2 instance](https://github.com/ava-labs/eng-resources/blob/main/dev-node-setup.md). -1. Get upgrades for each L1 and write them out to `~/.avalanchego/configs/chains//upgrade.json`: - - ```bash - 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 - ``` +##### Find L1 Info - Note it is possible there is no upgrades so the upgrade.json might just be `{}`. - - ```bash - 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 - ``` +Get Dispatch and Echo L1 details: -1. (Optional) You can tweak the `config.json` for 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` -1. (Optional) If you want to reboostrap completely the chain, you can remove `~/.avalanchego/chainData//db/pebbledb`, for example: - - Dispatch: `rm -r ~/.avalanchego/chainData/2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY/db/pebbledb` - - Echo: `rm -r ~/.avalanchego/chainData/98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp/db/pebbledb` +- [Dispatch L1 details](https://subnets-test.avax.network/dispatch/details) - Subnet ID: `7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5` +- [Echo L1 details](https://subnets-test.avax.network/echo/details) - Subnet ID: `i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK` - AvalancheGo keeps its database in `~/.avalanchego/db/fuji/v1.4.5/*.ldb` which you should not delete. -1. Build AvalancheGo: +Get blockchain and VM IDs: - ```bash - ./scripts/build.sh - ``` +```bash +# 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"' + +# 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"' +``` -1. Run AvalancheGo tracking the Dispatch and Echo Subnet IDs: +As of this writing: + +- **Dispatch**: Blockchain `2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY`, VM `mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o` +- **Echo**: Blockchain `98qnjenm7MBd8G2cPZoRvZrgJC33JGSAAKghsQ6eojbLCeRNp`, VM `meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF` + +##### Build and Deploy + +1. Build Subnet-EVM: + + ```bash + cd graft/subnet-evm + ./scripts/build.sh vm.bin + ``` + +1. Install the VM plugin: + + ```bash + mkdir -p ~/.avalanchego/plugins + cp vm.bin ~/.avalanchego/plugins/mDtV8ES8wRL1j2m6Kvc1qRFAvnpq4kufhueAY1bwbzVhk336o + cp vm.bin ~/.avalanchego/plugins/meq3bv7qCMZZ69L8xZRLwyKnWp6chRwyscq8VPtHWignRQVVF + rm vm.bin + ``` + +1. Get chain upgrades: + + ```bash + # Dispatch + 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 + + # Echo + 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 + ``` + +1. Build and run AvalancheGo: + + ```bash + cd ../.. + ./scripts/build.sh + ./build/avalanchego --network-id=fuji --partial-sync-primary-network --public-ip=127.0.0.1 \ + --track-subnets=7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5,i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK + ``` + +1. Wait for bootstrap (look for `check started passing`, `consensus started`, `bootstrapped healthy nodes`). + +1. Verify block production: + + ```bash + # 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 + ``` + +#### Canary Deployment + +1. Clone [external-plugins-builder](https://github.com/ava-labs/external-plugins-builder): + + ```bash + git checkout main + git pull + git checkout -b "echo-dispatch-$VERSION_RC" + ``` + +1. Update `configs/dispatch.yml` and `configs/echo.yml`: + - Set `app_version` to `$VERSION_RC` + - Update `avalanchego_version` if needed + - Update `golang_version` if needed + +1. Create PR and merge: + + ```bash + git add . + git commit -m "Bump echo and dispatch to $VERSION_RC" + git push -u origin "echo-dispatch-$VERSION_RC" + gh pr create --repo github.com/ava-labs/external-plugins-builder --base main --title "Bump echo and dispatch to $VERSION_RC" + ``` + +1. Monitor deployments after merge: + - **Dispatch**: [Logs](https://app.datadoghq.com/logs?query=subnet%3Adispatch%20%40logger%3A%2A&live=true) | [Metrics](https://app.datadoghq.com/dashboard/jrv-mm2-vuc/dispatch-testnet-subnets?live=true) + - **Echo**: [Logs](https://app.datadoghq.com/logs?query=subnet:echo%20@logger:*&live=true) | [Metrics](https://app.datadoghq.com/dashboard/jrv-mm2-vuc/echo-testnet-subnets?live=true) + +1. Test transactions: + 1. If you have no wallet setup, create a new one using the [Core wallet](https://core.app/) + 1. Go to the settings and enable **Testnet Mode** + 1. 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. + 1. 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**. + +1. You should then see the transaction impact the logs and metrics, for example: + + ```log + 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 + ``` + +### 7. Create Final Release + +After successful testing: - ```bash - ./build/avalanchego --network-id=fuji --partial-sync-primary-network --public-ip=127.0.0.1 \ - --track-subnets=7WtoAMPhrmh5KosDUsFL9yTcvw7YSxiKHPpdfs4JsgW47oZT5,i9gFpZQHPLcGfZaQLiwFAStddQD7iTKBpFfurPFJsXm1CkTZK - ``` +```bash +git checkout master +git pull origin +git log -1 # Verify expected commit +git tag -s "$VERSION" +git push origin "$VERSION" +``` -1. 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` -1. In another terminal, check you can obtain the current block number for both chains: - - - Dispatch: - - ```bash - 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: - - ```bash - 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 - ``` - -#### Canary deployment - -1. Create a branch from the `main` branch of [the externals plugin builder repository](https://github.com/ava-labs/external-plugins-builder). - - ```bash - git checkout main - git pull - git checkout -b "echo-dispatch-$VERSION_RC" - ``` +### 8. Create GitHub Release -2. Modify [`configs/dispatch.yml`] and [`configs/echo.yml`] similarly by: - - changing the `app_version` to `$VERSION_RC` - - if necessary, change the `avalanchego_version` - - if necessary, change the `golang_version` -3. Commit your changes and push the branch +Create a release at [github.com/ava-labs/avalanchego/releases/new](https://github.com/ava-labs/avalanchego/releases/new): - ```bash - git add . - git commit -m "Bump echo and dispatch to $VERSION_RC" - git push -u origin "echo-dispatch-$VERSION_RC" - ``` +1. Select tag `$VERSION` +1. Set title to `$VERSION` +1. Write release notes including: + - Network upgrade information (if applicable) + - Plugin version changes + - Breaking changes + - Features + - Fixes -4. Open a pull request targeting `main`, for example using [`gh`](https://cli.github.com/): + Example: - ```bash - gh pr create --repo github.com/ava-labs/external-plugins-builder --base main --title "Bump echo and dispatch to $VERSION_RC" - ``` + ```markdown + This release schedules the activation of... -5. Once the PR checks pass, you can squash and merge it. The [Subnet EVM build Github action](https://github.com/ava-labs/external-plugins-builder/actions/workflows/subnet-evm-image-build.yaml) then creates [one or more pull requests in devops-argocd](https://github.com/ava-labs/devops-argocd/pulls), for example `Auto image update for testnet/echo` and `Auto image update for testnet/dispatch`. -6. Once an automatically created pull request gets merged, it will be deployed, you can then monitor: - - For Dispatch: - - [Deployment progress](https://app.datadoghq.com/container-images?query=short_image:dispatch) - - [Logs](https://app.datadoghq.com/logs?query=subnet%3Adispatch%20%40logger%3A%2A&live=true) - - [Metrics](https://app.datadoghq.com/dashboard/jrv-mm2-vuc/dispatch-testnet-subnets?live=true) - - For Echo: - - [Deployment progress](https://app.datadoghq.com/container-images?query=short_image:echo) - - [Logs](https://app.datadoghq.com/logs?query=subnet:echo%20@logger:*&live=true) - - [Metrics](https://app.datadoghq.com/dashboard/jrv-mm2-vuc/echo-testnet-subnets?live=true) - - Note some metrics might be not showing up until a test transaction is ran. -7. Launch a test transaction: - 1. If you have no wallet setup, create a new one using the [Core wallet](https://core.app/) - 1. Go to the settings and enable **Testnet Mode** - 1. 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. - 1. 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**. -8. You should then see the transaction impact the logs and metrics, for example - - ```log - 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 - ``` -### Release + The plugin version is updated to `45`; all plugins must update to be compatible. -If a successful release candidate was created, you can now create a release. + ### Breaking Changes -Following the previous example in the [Release candidate section](#release-candidate) we will create a release `v0.7.3` indicated by the `$VERSION` variable. + ### Features -1. Create and push a tag from the `master` branch: + ### Fixes - ```bash - 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" + **Full Changelog**: https://github.com/ava-labs/avalanchego/compare/v1.14.0...v1.14.1 ``` -1. Create a new release on Github, either using: - - the [Github web interface](https://github.com/ava-labs/subnet-evm/releases/new) - 1. In the "Choose a tag" box, select the tag previously created `$VERSION` (`v0.7.3`) - 2. Pick the previous tag, for example as `v0.7.2`. - 3. Set the "Release title" to `$VERSION` (`v0.7.3`) - 4. Set the description using this format: - - ```markdown - # AvalancheGo Compatibility - - The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.13.0. - - # Breaking changes +1. Check "Set as the latest release" +1. Publish - # Features +### 9. Automated Builds - # Fixes +The tag push triggers these workflows automatically: - # Documentation +- `build-linux-binaries.yml` - Linux amd64/arm64 tarballs +- `build-macos-release.yml` - macOS zip +- `build-ubuntu-amd64-release.yml` / `build-ubuntu-arm64-release.yml` - Debian packages +- `publish_docker_image.yml` - Docker images - ``` +Artifacts produced: - 5. Only tick the box "Set as the latest release" - 6. Click on the "Create release" button - - the Github CLI `gh`: +**Binaries:** - ```bash - PREVIOUS_VERSION=v0.7.2 - NOTES="# AvalancheGo Compatibility +- `avalanchego-linux-amd64-$VERSION.tar.gz` +- `avalanchego-linux-arm64-$VERSION.tar.gz` +- `avalanchego-macos-$VERSION.zip` +- `subnet-evm-linux-amd64-$VERSION.tar.gz` +- `subnet-evm-linux-arm64-$VERSION.tar.gz` +- `subnet-evm-macos-$VERSION.zip` + +**Docker Images:** - The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.13.0. +- `avaplatform/avalanchego:$VERSION` (multi-arch: linux/amd64, linux/arm64) +- `avaplatform/subnet-evm:$VERSION` (multi-arch: linux/amd64, linux/arm64) +- `avaplatform/bootstrap-monitor:$VERSION` (multi-arch: linux/amd64, linux/arm64) - # Breaking changes +**Antithesis Images:** - # Features +Antithesis test images are built and pushed to Google Artifact Registry on every merge to master via `publish_antithesis_images.yml`: - # Fixes +- `antithesis-avalanchego-{config,node,workload}:latest` +- `antithesis-xsvm-{config,node,workload}:latest` +- `antithesis-subnet-evm-{config,node,workload}:latest` - # Documentation +These are triggered daily for testing: - " - gh release create "$VERSION" --notes-start-tag "$PREVIOUS_VERSION" --notes-from-tag "$VERSION" --title "$VERSION" --notes "$NOTES" --verify-tag - ``` +- `trigger-antithesis-avalanchego.yml` - 10PM UTC +- `trigger-antithesis-xsvm.yml` - 6AM UTC +- `trigger-antithesis-subnet-evm.yml` - 2PM UTC -1. Monitor the [release Github workflow](https://github.com/ava-labs/subnet-evm/actions/workflows/release.yml) to ensure the GoReleaser step succeeds and check the binaries are then published to [the releases page](https://github.com/ava-labs/subnet-evm/releases). In case this fails, you can trigger the workflow manually: - 1. Go to [github.com/ava-labs/subnet-evm/actions/workflows/release.yml](https://github.com/ava-labs/subnet-evm/actions/workflows/release.yml) - 1. Click on the "Run workflow" button - 1. Enter the branch name, usually with goreleaser related fixes - 1. Enter the tag name `$VERSION` (i.e. `v0.7.3`) -1. Monitor the [Publish Docker image workflow](https://github.com/ava-labs/subnet-evm/actions/workflows/publish_docker.yml) succeeds. Note this workflow is triggered when pushing the tag, unlike Goreleaser which triggers when publishing the release. -1. Finally, [create a release for precompile-evm](https://github.com/ava-labs/precompile-evm/blob/main/docs/releasing/README.md) +### 10. Post-Release Version Bump -### Post-release - -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: +Prepare for the next release: ```bash -export P_VERSION=v0.7.4 +export NEXT_VERSION=v1.14.2 ``` -1. Create a branch, from the tip of the `master` branch after the release PR has been merged: - - ```bash - git fetch origin master - git checkout master - git checkout -b "prep-$P_VERSION-release" - ``` - -1. Bump the version number to the next pending release version, `$P_VERSION` - - Update the [RELEASES.md](../../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](../../plugin/evm/version.go) `Version` global string variable and set it to `$P_VERSION`. - - Add an entry in the object in [compatibility.json](../../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: +1. Create branch: - ```json - "v0.7.4": 39, - ``` + ```bash + git fetch origin master + git checkout master + git checkout -b "prep-$NEXT_VERSION-release" + ``` - 💁 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: +1. Update all version files (as in step 3) to the next version. - ```bash - go test -run ^TestCompatibility$ github.com/ava-labs/subnet-evm/plugin/evm - ``` +1. Create PR and merge: - This will fail with an error similar to: + ```bash + git add . + git commit -S -m "chore: prep release $NEXT_VERSION" + git push -u origin "prep-$NEXT_VERSION-release" + gh pr create --repo github.com/ava-labs/avalanchego --base master --title "chore: prep next release $NEXT_VERSION" + gh pr checks --watch + gh pr merge "prep-$NEXT_VERSION-release" --squash --subject "chore: prep next release $NEXT_VERSION" + ``` - ```text - compatibility.json has subnet-evm version v0.7.4 stated as compatible with RPC chain VM protocol version 0 but AvalancheGo protocol version is 39 - ``` +1. Pat yourself on the back for a job well done - This 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 repository `version/compatibility.json` file](https://github.com/ava-labs/avalanchego/blob/master/version/compatibility.json) to find the RPC chain VM protocol version matching the AvalancheGo version we use here. -1. Commit your changes and push the branch +## RPC Chain VM Protocol Version - ```bash - git add . - git commit -S -m "chore: prep release $P_VERSION" - git push -u origin "prep-$P_VERSION-release" - ``` +When the protocol version changes: -1. Create a pull request (PR) from your branch targeting master, for example using [`gh`](https://cli.github.com/): +1. Update [`version/constants.go`](version/constants.go): - ```bash - gh pr create --repo github.com/ava-labs/subnet-evm --base master --title "chore: prep next release $P_VERSION" - ``` + ```go + RPCChainVMProtocol uint = 45 + ``` -1. Wait for the PR checks to pass with +2. Update [`version/compatibility.json`](version/compatibility.json): - ```bash - gh pr checks --watch - ``` + ```json + "45": ["v1.14.1"] + ``` -1. Squash and merge your branch into `master`, for example: +To verify compatibility: - ```bash - gh pr merge "prep-$P_VERSION-release" --squash --subject "chore: prep next release $P_VERSION" - ``` +```bash +go test -run ^TestCompatibility$ github.com/ava-labs/avalanchego/graft/subnet-evm/plugin/evm +``` -1. Pat yourself on the back for a job well done. \ No newline at end of file diff --git a/graft/coreth/plugin/evm/version.go b/graft/coreth/plugin/evm/version.go index e08a0d64afda..8caf6b38272f 100644 --- a/graft/coreth/plugin/evm/version.go +++ b/graft/coreth/plugin/evm/version.go @@ -3,16 +3,21 @@ package evm -import "fmt" +import ( + "fmt" + + "github.com/ava-labs/avalanchego/version" +) var ( // GitCommit is set by the build script GitCommit string - // Version is the version of Coreth - Version string = "v0.15.4" + // Version is the version of Coreth, derived from AvalancheGo version + Version string ) func init() { + Version = fmt.Sprintf("v%d.%d.%d", version.Current.Major, version.Current.Minor, version.Current.Patch) if len(GitCommit) != 0 { Version = fmt.Sprintf("%s@%s", Version, GitCommit) } diff --git a/graft/subnet-evm/README.md b/graft/subnet-evm/README.md index 186f85551462..245ddca318e4 100644 --- a/graft/subnet-evm/README.md +++ b/graft/subnet-evm/README.md @@ -19,6 +19,8 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and ### AvalancheGo Compatibility +**Note:** Starting with v1.14.0, Subnet-EVM versions are automatically aligned with AvalancheGo versions. The version is derived from [`version/constants.go`](../../version/constants.go) and no longer requires manual synchronization. + ```text [v0.7.0] AvalancheGo@v1.12.0-v1.12.1 (Protocol Version: 38) [v0.7.1] AvalancheGo@v1.12.2 (Protocol Version: 39) @@ -31,6 +33,7 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and [v0.7.8] AvalancheGo@v1.13.4 (Protocol Version: 43) [v0.7.9] AvalancheGo@v1.13.5 (Protocol Version: 43) [v0.8.0] AvalancheGo@v1.14.0 (Protocol Version: 44) +[v1.14.1+] Versions aligned with AvalancheGo (automatic) ``` ## API diff --git a/graft/subnet-evm/compatibility.json b/graft/subnet-evm/compatibility.json deleted file mode 100644 index 976a4b19049b..000000000000 --- a/graft/subnet-evm/compatibility.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "rpcChainVMProtocolVersion": { - "v1.14.0": 44, - "v0.8.0": 44, - "v0.7.9": 43, - "v0.7.8": 43, - "v0.7.7": 42, - "v0.7.6": 42, - "v0.7.5": 41, - "v0.7.4": 40, - "v0.7.3": 39, - "v0.7.2": 39, - "v0.7.1": 39, - "v0.7.0": 38 - } -} \ No newline at end of file diff --git a/graft/subnet-evm/plugin/evm/version.go b/graft/subnet-evm/plugin/evm/version.go index 2759b8057bf0..36669e4a08d7 100644 --- a/graft/subnet-evm/plugin/evm/version.go +++ b/graft/subnet-evm/plugin/evm/version.go @@ -3,16 +3,21 @@ package evm -import "fmt" +import ( + "fmt" + + "github.com/ava-labs/avalanchego/version" +) var ( // GitCommit is set by the build script GitCommit string - // Version is the version of AvalancheGo/Subnet-EVM - Version string = "v1.14.0" + // Version is the version of Subnet-EVM, derived from AvalancheGo version + Version string ) func init() { + Version = fmt.Sprintf("v%d.%d.%d", version.Current.Major, version.Current.Minor, version.Current.Patch) if len(GitCommit) != 0 { Version = fmt.Sprintf("%s@%s", Version, GitCommit) } diff --git a/graft/subnet-evm/plugin/evm/version_test.go b/graft/subnet-evm/plugin/evm/version_test.go index 299048826e5b..f4c4348c39a4 100644 --- a/graft/subnet-evm/plugin/evm/version_test.go +++ b/graft/subnet-evm/plugin/evm/version_test.go @@ -4,9 +4,7 @@ package evm import ( - "encoding/json" - "os" - "path/filepath" + "fmt" "testing" "github.com/stretchr/testify/require" @@ -14,24 +12,14 @@ import ( "github.com/ava-labs/avalanchego/version" ) -type rpcChainCompatibility struct { - RPCChainVMProtocolVersion map[string]uint `json:"rpcChainVMProtocolVersion"` -} - -const compatibilityFile = "../../compatibility.json" - func TestCompatibility(t *testing.T) { - compat, err := os.ReadFile(compatibilityFile) - require.NoError(t, err, "reading compatibility file") - - var parsedCompat rpcChainCompatibility - err = json.Unmarshal(compat, &parsedCompat) - require.NoError(t, err, "json decoding compatibility file") - - rpcChainVMVersion, valueInJSON := parsedCompat.RPCChainVMProtocolVersion[Version] - require.Truef(t, valueInJSON, "%s has subnet-evm version %s missing from rpcChainVMProtocolVersion object", - filepath.Base(compatibilityFile), Version) - require.Equalf(t, version.RPCChainVMProtocol, rpcChainVMVersion, - "%s has subnet-evm version %s stated as compatible with RPC chain VM protocol version %d but AvalancheGo protocol version is %d", - filepath.Base(compatibilityFile), Version, rpcChainVMVersion, version.RPCChainVMProtocol) + // Verify that the Subnet-EVM version is properly derived from AvalancheGo version + expectedVersion := fmt.Sprintf("v%d.%d.%d", version.Current.Major, version.Current.Minor, version.Current.Patch) + require.Equal(t, expectedVersion, Version, + "Subnet-EVM version should be automatically derived from version.Current") + + // Verify that the version is compatible with current RPC chain VM protocol + // Compatibility is now maintained through version/compatibility.json in the main repo + require.NotZero(t, version.RPCChainVMProtocol, + "RPC chain VM protocol version should be set") }