aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/evm/vm.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 24fe98c..db1f5a9 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -38,6 +38,14 @@ import (
commonEng "github.com/ava-labs/gecko/snow/engine/common"
)
+var (
+ oldZeroAddr = common.Address{
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ }
+ zeroAddr = coreth.ZeroAddr
+)
+
const (
lastAcceptedKey = "snowman_lastAccepted"
)
@@ -138,7 +146,7 @@ func (vm *VM) Initialize(
panic(err)
}
nodecfg := node.Config{NoUSB: true}
- chain := coreth.NewETHChain(&config, &nodecfg, nil, vm.chaindb)
+ chain := coreth.NewETHChain(&config, &nodecfg, &zeroAddr, vm.chaindb)
vm.chain = chain
vm.networkID = config.NetworkId
chain.SetOnHeaderNew(func(header *types.Header) {
@@ -306,7 +314,9 @@ func (vm *VM) ParseBlock(b []byte) (snowman.Block, error) {
return nil, err
}
// Coinbase must be zero on C-Chain
- if bytes.Compare(ethBlock.Coinbase().Bytes(), coreth.ZeroAddr.Bytes()) != 0 {
+ coinbase := ethBlock.Coinbase()
+ if bytes.Compare(coinbase.Bytes(), oldZeroAddr.Bytes()) != 0 &&
+ bytes.Compare(coinbase.Bytes(), zeroAddr.Bytes()) != 0 {
return nil, errInvalidBlock
}
block := &Block{