From b29ef50ad2f31aaf864818aff76c4f2d7b7f854e Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Wed, 7 Jun 2023 08:59:26 +0200 Subject: [PATCH] Use constant header fields in hash if present Related to https://github.com/celo-org/celo-blockchain/pull/2124 --- packages/celotool/src/e2e-tests/slashing_tests.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/celotool/src/e2e-tests/slashing_tests.ts b/packages/celotool/src/e2e-tests/slashing_tests.ts index bdf93af32ef..41048c19fba 100644 --- a/packages/celotool/src/e2e-tests/slashing_tests.ts +++ b/packages/celotool/src/e2e-tests/slashing_tests.ts @@ -33,6 +33,15 @@ function headerArray(block: any) { if (block.gasLimit) { headerHashData.push(block.gasLimit) } + if (block.nonce) { + // All these fields are set after GFork, but difficulty is already returned + // in RPC as an Eth-compatibility feature before, so we can't use it to + // check if we are after GFork + headerHashData.push(new BigNumber(block.difficulty).toNumber()) + headerHashData.push(block.nonce) + headerHashData.push(block.sha3Uncles) + headerHashData.push(block.mixHash) + } return headerHashData }