Skip to content

Commit

Permalink
enables cancun at EUpgrade (ava-labs#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush authored and oxbee committed Nov 6, 2024
1 parent f2d2d1e commit 8500000
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions params/config_extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ func getUpgradeTime(networkID uint32, upgradeTimes map[uint32]time.Time) *uint64
// genesis.
return utils.NewUint64(0)
}

// SetEVMUpgrades sets the mapped upgrades (Avalanche > EVM upgrades) for the chain config.
func (c *ChainConfig) SetEVMUpgrades() {
if c.EUpgradeTime != nil {
c.CancunTime = utils.NewUint64(*c.EUpgradeTime)
}
}
2 changes: 2 additions & 0 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ func (vm *VM) Initialize(

vm.chainID = g.Config.ChainID

g.Config.SetEVMUpgrades()

vm.ethConfig = ethconfig.NewDefaultConfig()
vm.ethConfig.Genesis = g
vm.ethConfig.NetworkId = vm.chainID.Uint64()
Expand Down

0 comments on commit 8500000

Please # to comment.