Skip to content

Comments

Subnet evm min version check#2740

Closed
sukantoraymond wants to merge 37 commits intomainfrom
subnet-evm-min-version-check
Closed

Subnet evm min version check#2740
sukantoraymond wants to merge 37 commits intomainfrom
subnet-evm-min-version-check

Conversation

@sukantoraymond
Copy link
Contributor

@sukantoraymond sukantoraymond commented Apr 14, 2025

Provides minimum version check for Subnet-EVM.

Currently Subnet EVM's version is set during blockchain create, where we get latest version of subnet-evm by default and write it to sidecar.VMVersion value.

We only use Subnet-EVM value when we try to sync local machine / a remote node to a Blockchain. At this stage, we check if subnet-evm version defined in sidecar.VMVersion is at least the minimum version of subnet-evm defined in latest.json. If sidecar.VMVersion is lower than min version, then we will return an error asking the user to update
To update the blockchain's Subnet-EVM version, call avalanche blockchain upgrade vm <blockchainName> --config --version <version>

@sukantoraymond sukantoraymond changed the base branch from main to min-version April 14, 2025 23:13
@sukantoraymond sukantoraymond marked this pull request as ready for review April 29, 2025 17:13
@sukantoraymond
Copy link
Contributor Author

As I am working through this PR, I realized that we don't even need subnet-evm version defined in sidecar.json.
Since sidecar.VMVersion is only used for local machine / remote tracking a blockchain, we should find out the avalanchego version of the blockchain that we want to sync to and just download the latest subnet-evm binary that is supported by avalanchego version. This is compared to our current approach of looking up sidecar.VMVersion to get subnet evm version to download.

The benefit to this approach is that we avoid an issue where a blockchain's Subnet EVM has been upgraded, but not reflected in local sidecar, and when we try to sync to that blockchain, we will install the incorrect version of Subnet-EVM

Signed-off-by: sukantoraymond <rsukanto@umich.edu>
Signed-off-by: sukantoraymond <rsukanto@umich.edu>
Signed-off-by: sukantoraymond <rsukanto@umich.edu>
Copy link
Collaborator

@felipemadero felipemadero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the min check to create also

)
if sc.VM == models.SubnetEvm {
if err = dependencies.CheckVersionIsOverMin(app, constants.SubnetEVMRepoName, networkModel, sc.VMVersion); err != nil {
ux.Logger.PrintToUser(dependencies.UpdateSubnetEVMInstruction)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use printFunc

Copy link
Collaborator

@felipemadero felipemadero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preapproving. please address comment

Base automatically changed from min-version to main May 19, 2025 20:35
@github-project-automation github-project-automation bot moved this from Backlog 🧊 to Done 🎉 in avalanchego Dec 19, 2025
@felipemadero felipemadero deleted the subnet-evm-min-version-check branch December 19, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants