From 7b6c8363dac3c609f01ec9ae54698581a9821048 Mon Sep 17 00:00:00 2001
From: Oliver Tale-Yazdi <oliver@perun.network>
Date: Sun, 20 Jun 2021 15:52:04 +0200
Subject: [PATCH] core: copy CliqueConfig in DeveloperGenesisBlock (#23068)

Copy the CliqueConfig instead of reusing the pointer.
This makes DeveloperGenesisBlock thread safe and prevents it from
changing params.AllCliqueProtocolChanges.Clique.Epoch.
---
 core/genesis.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/genesis.go b/core/genesis.go
index 19890406e..dc50ff475 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -415,7 +415,10 @@ func DefaultCalaverasGenesisBlock() *Genesis {
 func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
 	// Override the default period to the user requested one
 	config := *params.AllCliqueProtocolChanges
-	config.Clique.Period = period
+	config.Clique = &params.CliqueConfig{
+		Period: period,
+		Epoch:  config.Clique.Epoch,
+	}
 
 	// Assemble and return the genesis with the precompiles and faucet pre-funded
 	return &Genesis{
-- 
GitLab