From: Ardis Lu Date: Mon, 20 May 2024 06:18:23 +0000 (-0700) Subject: Clarify which EIPs added block header fields X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=fea011ab263b8272fe1251f38ed0f23356090835;p=block-hash-calculator Clarify which EIPs added block header fields The logic is unchanged, but more accurate EIPs are commented for future reference. --- diff --git a/index.html b/index.html index 9e9651e..68d2455 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,7 @@ } // 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); } @@ -170,11 +170,16 @@ 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);