Skip to content

Commit

Permalink
packages: integrate suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Oct 25, 2024
1 parent b1a5c91 commit 7bb57aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
BIGINT_1,
BIGINT_8,
KECCAK256_RLP,
KECCAK256_RLP_RH,
SHA256_EMPTY_RH,
Lock,
MapDB,
bigIntToHex,
Expand Down Expand Up @@ -1314,7 +1314,7 @@ export class Blockchain implements BlockchainInterface {
number: 0,
stateRoot,
withdrawalsRoot: common.isActivatedEIP(4895) ? KECCAK256_RLP : undefined,
requestsHash: common.isActivatedEIP(7685) ? KECCAK256_RLP_RH : undefined,
requestsHash: common.isActivatedEIP(7685) ? SHA256_EMPTY_RH : undefined,
}
if (common.consensusType() === 'poa') {
if (common.genesis().extraData) {
Expand Down
9 changes: 2 additions & 7 deletions packages/util/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { secp256k1 } from 'ethereum-cryptography/secp256k1.js'
import { sha256 } from 'ethereum-cryptography/sha256'

import { hexToBytes } from './bytes.js'

Expand Down Expand Up @@ -67,13 +68,7 @@ export const KECCAK256_RLP = hexToBytes(KECCAK256_RLP_S)
/**
* Keccak-256 hash of the RLP of an empty requests hash
*/
export const KECCAK256_RLP_RH_S =
export const SHA256_EMPTY_RH_S = sha256(new Uint8Array([0, 1, 2]))

/**
* Keccak-256 hash of the RLP of an empty requests hash
*/
export const SHA256_EMPTY_RH = hexToBytes(SHA256_EMPTY_RH_S)
export const SHA256_EMPTY_RH = sha256(new Uint8Array([0, 1, 2]))

/**
* RLP encoded empty string
Expand Down

0 comments on commit 7bb57aa

Please sign in to comment.