From 574be074153fe7be29237881ecee56bd81e67c8e Mon Sep 17 00:00:00 2001
From: e-danko <89912851+e-danko@users.noreply.github.com>
Date: Sat, 16 Oct 2021 13:12:57 +0300
Subject: [PATCH] Updated Fermion genesis extraData  (#2830)

* updated Fermion extradata + fixed bug with PublicKey

* Update Fermion extradata: fix genesis hash
---
 cmd/utils/flags.go | 4 +++-
 core/genesis.go    | 2 +-
 params/config.go   | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 000b3b8552..3400b60cd5 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -828,7 +828,9 @@ func setEtherbase(ctx *cli.Context, cfg *ethconfig.Config) {
 			panic(fmt.Sprintf("Flag --%s is required in %s chain with --%s flag", MinerSigningKeyFileFlag.Name, params.FermionChainName, MiningEnabledFlag.Name))
 		}
 		setSigKey(ctx, cfg)
-		cfg.Miner.Etherbase = crypto.PubkeyToAddress(cfg.Miner.SigKey.PublicKey)
+		if cfg.Miner.SigKey != nil {
+			cfg.Miner.Etherbase = crypto.PubkeyToAddress(cfg.Miner.SigKey.PublicKey)
+		}
 	}
 }
 
diff --git a/core/genesis.go b/core/genesis.go
index 11e5f23c79..1b72d29970 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -627,7 +627,7 @@ func DefaultFermionGenesisBlock() *Genesis {
 	return &Genesis{
 		Config:     params.FermionChainConfig,
 		Timestamp:  0x0,
-		ExtraData:  hexutil.MustDecode("0x000000000000000000000000000000000000000000000000000000000000000042d5d120ad9c1692c5fa72dca20657254bbaa08d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+		ExtraData:  hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000003a03f6d88437328ce8623ef5e80c67383704ebc13ec60da1858ec7fa8edd0dc736611dba9ab4399942d5d120ad9c1692c5fa72dca20657254bbaa08d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
 		GasLimit:   0x5B8D80,
 		Difficulty: big.NewInt(0x20000),
 		Alloc:      readPrealloc("allocs/fermion.json"),
diff --git a/params/config.go b/params/config.go
index e842277797..01c4802d3b 100644
--- a/params/config.go
+++ b/params/config.go
@@ -54,7 +54,7 @@ var (
 	ErigonGenesisHash  = common.HexToHash("0xfecd5c85712e36f30f09ba3a42386b42c46b5ba5395a4246b952e655f9aa0f58")
 	SokolGenesisHash   = common.HexToHash("0x5b28c1bfd3a15230c9a46b399cd0f9a6920d432e85381cc6a140b06e8410112f")
 	KovanGenesisHash   = common.HexToHash("0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9")
-	FermionGenesisHash = common.HexToHash("0x45b0d99ebd35baf0af742ef543bb6b74f8c46f41d79b1b84c7718a882a779582")
+	FermionGenesisHash = common.HexToHash("0x0658360d8680ead416900a552b67b84e6d575c7f0ecab3dbe42406f9f8c34c35")
 )
 
 var (
-- 
GitLab