From d50803ec3c5d411ff3b308f6296b66b7fdfa66d8 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:08:44 -0400 Subject: [PATCH] check if genesis difficulty is greater than ttd (#3556) --- packages/common/src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common/src/utils.ts b/packages/common/src/utils.ts index 55796081eb..090591a69a 100644 --- a/packages/common/src/utils.ts +++ b/packages/common/src/utils.ts @@ -85,7 +85,8 @@ function parseGethParams(json: any) { // so the Merge/Paris hardfork block must be 0 if ( config.terminalTotalDifficulty !== undefined && - (config.terminalTotalDifficulty > 0 || config.terminalTotalDifficultyPassed === false) + (BigInt(difficulty) < BigInt(config.terminalTotalDifficulty) || + config.terminalTotalDifficultyPassed === false) ) { throw new Error('nonzero terminal total difficulty is not supported') }