Skip to content

Commit

Permalink
core: copy CliqueConfig in DeveloperGenesisBlock (ethereum#23068)
Browse files Browse the repository at this point in the history
Copy the CliqueConfig instead of reusing the pointer.
This makes DeveloperGenesisBlock thread safe and prevents it from
changing params.AllCliqueProtocolChanges.Clique.Epoch.
  • Loading branch information
ggwpez authored and atif-konasl committed Oct 15, 2021
1 parent 7ff00a4 commit 3b30d49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 3b30d49

Please sign in to comment.