From 3b30d4905c1da9330a113722aed843965df1b230 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi 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 19890406ef7d..dc50ff475ec7 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 = ¶ms.CliqueConfig{ + Period: period, + Epoch: config.Clique.Epoch, + } // Assemble and return the genesis with the precompiles and faucet pre-funded return &Genesis{