};
}
-// zkSync Era ABI-encodes its block header parameters instead of RLP-encoding
+// ZKsync Era ABI-encodes its block header parameters instead of RLP-encoding
// https://docs.zksync.io/zk-stack/concepts/blocks#l2-blockhash-calculation-and-storage
function calculateZkSync(block) {
// Block number 13234791 was not documented in the upgrade spec but retrieved from manual testing
});
});
-suite('zkSync Era', { concurrency: true }, () => {
+suite('ZKsync Era', { concurrency: true }, () => {
test('Block number 0', { concurrency: true }, () => {
const { hash } = calculateZkSync({
"baseFeePerGas": "0x0",
<main>
<h1>Block Hash Calculator</h1>
<a href="https://github.com/ardislu/block-hash-calculator/">GitHub</a>
- <p>Enter a block number and a JSON-RPC provider below to recalculate the block's hash from its header fields. Known supported networks: Ethereum, Polygon PoS, BNB Chain, OP Mainnet, Base, Arbitrum One, Linea, Scroll, Blast, Mantle, and Avalanche C-Chain.</p>
+ <p>Enter a block number and a JSON-RPC provider below to recalculate the block's hash from its header fields. Known supported networks: Ethereum, Polygon PoS, BNB Chain, OP Mainnet, Base, Arbitrum One, Linea, Scroll, Blast, Mantle, Avalanche C-Chain, and ZKsync Era.</p>
<form>
<label for="num">Block number</label>
<input id="num" name="num" type="number" min="0" placeholder="12345678" required>
if (block !== undefined) {
const { header, encoded, hash } = calculate(block);
- if (hash !== block.hash) { // TODO: use a better heuristic to determine if it's zkSync
+ if (hash !== block.hash) { // TODO: use a better heuristic to determine if it's ZKsync Era
const { header, encoded, hash } = calculateZkSync(block);
document.querySelector('#out-header').textContent = `[\n ${header.join(',\n ')}\n]`;
document.querySelector('#out-encoded').textContent = encoded;