]> git.ardis.lu - block-hash-calculator/commitdiff
Clarify which EIPs added block header fields
authorArdis Lu <ardisglu@gmail.com>
Mon, 20 May 2024 06:18:23 +0000 (23:18 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 20 May 2024 06:18:23 +0000 (23:18 -0700)
The logic is unchanged, but more accurate EIPs are commented for future reference.

index.html

index 9e9651e1cfa76472c29cf1ac5b85d5e5c455632e..68d2455a51fa82366280aa324c1042234131d375 100644 (file)
       }
 
       // Shapella hard fork
-      // https://eips.ethereum.org/EIPS/eip-6465#execution-block-header-changes
+      // https://eips.ethereum.org/EIPS/eip-4895#new-field-in-the-execution-payload-header-withdrawals-root
       if (block?.withdrawalsRoot) {
         header.push(block.withdrawalsRoot);
       }
       if (block?.blobGasUsed) {
         header.push(
           BigInt(block.blobGasUsed),
-          BigInt(block.excessBlobGas),
-          block.parentBeaconBlockRoot
+          BigInt(block.excessBlobGas)
         );
       }
 
+      // Dencun hard fork
+      // https://eips.ethereum.org/EIPS/eip-4788#block-structure-and-validity
+      if (block?.parentBeaconBlockRoot) {
+        header.push(block.parentBeaconBlockRoot);
+      }
+
       const rlp = RLP.encode(header);
       const hash = keccak256(rlp);
 
This page took 0.041053 seconds and 4 git commands to generate.