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 Jun 20, 2021
1 parent 4695117 commit 7b6c836
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 7b6c836

Please sign in to comment.