Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): use VM ID for symlinks to VM binary #109

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

Nuttymoon
Copy link
Contributor

@Nuttymoon Nuttymoon commented Dec 14, 2023

Linked issues

Breaking changes

  • avalanche.node role
    • Remove the usage of VM aliases and use the VM ID as the name for the symlink to the VM binary
    • Decorrelate the VM name (in the collection conf) and the binary filename (to be downloaded + extracted). This allows installing the same VM multiple times with different VM IDs.

Additional comments

You can test this by installing the Subnet EVM with the default ID + the Subnet VM with a different ID and creating a Subnet using the 2 VMs for 2 blockchains.

In ansible-avalanche-getting-started:

# inventory/local/group_vars/avalanche_node.yml
avalanchego_vms_list:
  dexalot-subnet-evm:
    download_url: https://github.com/ava-labs/subnet-evm/releases/download
    id: mDVSxzeWHpEU3eSqMwwGQsD787xGp7hv9Qgoe3R9SdjPapte8
    # Used in Ash CLI
    ash_vm_type: SubnetEVM
    # The binary filename to look for in the archive
    binary_filename: subnet-evm
    versions_comp:
      # Protocol version: 30
      0.5.9:
        ge: 1.10.15
        le: 1.10.17
      0.5.10:
        ge: 1.10.15
        le: 1.10.17

avalanchego_vms_install:
  - subnet-evm=0.5.10
  - dexalot-subnet-evm=0.5.10
# inventory/local/group_vars/subnet_txs_host.yml
subnet_blockchains_list:
  - name: AshLocalEVM
    vm: subnet-evm
    genesis_data:
      config:
        chainId: 66666
        homesteadBlock: 0
        eip150Block: 0
        eip150Hash: "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"
        eip155Block: 0
        eip158Block: 0
        byzantiumBlock: 0
        constantinopleBlock: 0
        petersburgBlock: 0
        istanbulBlock: 0
        muirGlacierBlock: 0
        subnetEVMTimestamp: 0
        feeConfig:
          gasLimit: 8000000
          minBaseFee: 25000000000
          targetGas: 15000000
          baseFeeChangeDenominator: 36
          minBlockGasCost: 0
          maxBlockGasCost: 1000000
          targetBlockRate: 2
          blockGasCostStep: 200000
      alloc:
        8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC:
          balance: "0x295BE96E64066972000000"
      nonce: "0x0"
      timestamp: "0x0"
      extraData: "0x00"
      gasLimit: "0x7A1200"
      difficulty: "0x0"
      mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000"
      coinbase: "0x0000000000000000000000000000000000000000"
      number: "0x0"
      gasUsed: "0x0"
      parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000"
  - name: DexalotLocalEVM
    vm: dexalot-subnet-evm
    genesis_data:
      config:
        chainId: 66667
        homesteadBlock: 0
        eip150Block: 0
        eip150Hash: "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"
        eip155Block: 0
        eip158Block: 0
        byzantiumBlock: 0
        constantinopleBlock: 0
        petersburgBlock: 0
        istanbulBlock: 0
        muirGlacierBlock: 0
        subnetEVMTimestamp: 0
        feeConfig:
          gasLimit: 8000000
          minBaseFee: 25000000000
          targetGas: 15000000
          baseFeeChangeDenominator: 36
          minBlockGasCost: 0
          maxBlockGasCost: 1000000
          targetBlockRate: 2
          blockGasCostStep: 200000
      alloc:
        8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC:
          balance: "0x295BE96E64066972000000"
      nonce: "0x0"
      timestamp: "0x0"
      extraData: "0x00"
      gasLimit: "0x7A1200"
      difficulty: "0x0"
      mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000"
      coinbase: "0x0000000000000000000000000000000000000000"
      number: "0x0"
      gasUsed: "0x0"
      parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000"

The 2 blockchains both use the Subnet EVM under different VM IDs.

@Nuttymoon Nuttymoon changed the title feat(node): use VM ID for symlinks to binary feat(node): use VM ID for symlinks to VM binary Dec 14, 2023
@Nuttymoon Nuttymoon merged commit 9379737 into main Dec 15, 2023
@Nuttymoon Nuttymoon deleted the 106-vm-binary-ids-mapping branch December 15, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for multiple subnets with same subnet binary with different VM IDs
2 participants