Skip to content

Commit c04b8e6

Browse files
authored
cmd/utils: require TTD and difficulty to be zero at genesis for dev mode (#29579)
1 parent 69f815f commit c04b8e6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd/utils/flags.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,13 +1872,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
18721872
Fatalf("Could not read genesis from database: %v", err)
18731873
}
18741874
if !genesis.Config.TerminalTotalDifficultyPassed {
1875-
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficultyPassed must be true in developer mode")
1875+
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficultyPassed must be true")
18761876
}
18771877
if genesis.Config.TerminalTotalDifficulty == nil {
1878-
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified.")
1878+
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified")
1879+
} else if genesis.Config.TerminalTotalDifficulty.Cmp(big.NewInt(0)) != 0 {
1880+
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be 0")
18791881
}
1880-
if genesis.Difficulty.Cmp(genesis.Config.TerminalTotalDifficulty) != 1 {
1881-
Fatalf("Bad developer-mode genesis configuration: genesis block difficulty must be > terminalTotalDifficulty")
1882+
if genesis.Difficulty.Cmp(big.NewInt(0)) != 0 {
1883+
Fatalf("Bad developer-mode genesis configuration: difficulty must be 0")
18821884
}
18831885
}
18841886
chaindb.Close()

0 commit comments

Comments
 (0)