diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 0ae1eb5169d..2d4b400464e 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -669,7 +669,6 @@ export class BlockHeader { } return this.cache.hash } - return keccak256(RLP.encode(this.raw())) } diff --git a/packages/client/src/rpc/error-code.ts b/packages/client/src/rpc/error-code.ts index 179a4ad5df7..6e6ccac48fa 100644 --- a/packages/client/src/rpc/error-code.ts +++ b/packages/client/src/rpc/error-code.ts @@ -6,3 +6,4 @@ export const METHOD_NOT_FOUND = -32601 export const INVALID_PARAMS = -32602 export const INTERNAL_ERROR = -32603 export const TOO_LARGE_REQUEST = -38004 +export const UNSUPPORTED_FORK = -38005 diff --git a/packages/client/src/rpc/modules/engine.ts b/packages/client/src/rpc/modules/engine.ts index ee61ae4580c..dfd3eea0bdc 100644 --- a/packages/client/src/rpc/modules/engine.ts +++ b/packages/client/src/rpc/modules/engine.ts @@ -13,7 +13,7 @@ import { import { PendingBlock } from '../../miner' import { short } from '../../util' -import { INTERNAL_ERROR, INVALID_PARAMS, TOO_LARGE_REQUEST } from '../error-code' +import { INTERNAL_ERROR, INVALID_PARAMS, TOO_LARGE_REQUEST, UNSUPPORTED_FORK } from '../error-code' import { CLConnectionManager, middleware as cmMiddleware } from '../util/CLConnectionManager' import { middleware, validators } from '../validation' @@ -819,7 +819,7 @@ export class Engine { const ts = parseInt(params[0].timestamp) if (eip4844Timestamp === null || ts < eip4844Timestamp) { throw { - code: INVALID_PARAMS, + code: UNSUPPORTED_FORK, message: 'NewPayloadV{1|2} MUST be used before Cancun is activated', } } diff --git a/packages/client/src/rpc/modules/eth.ts b/packages/client/src/rpc/modules/eth.ts index 7a33acae30c..4b965a71aa1 100644 --- a/packages/client/src/rpc/modules/eth.ts +++ b/packages/client/src/rpc/modules/eth.ts @@ -131,6 +131,7 @@ const jsonRpcBlock = async ( ...withdrawalsAttr, blobGasUsed: header.blobGasUsed, excessBlobGas: header.excessBlobGas, + parentBeaconBlockRoot: header.parentBeaconBlockRoot, } } diff --git a/packages/client/src/service/txpool.ts b/packages/client/src/service/txpool.ts index ca1098ff24b..b254f8e3dd6 100644 --- a/packages/client/src/service/txpool.ts +++ b/packages/client/src/service/txpool.ts @@ -246,9 +246,8 @@ export class TxPool { if (addedTx instanceof BlobEIP4844Transaction && existingTx instanceof BlobEIP4844Transaction) { const minblobGasFee = - (existingTx.maxFeePerblobGas * - (existingTx.maxFeePerblobGas * BigInt(MIN_GAS_PRICE_BUMP_PERCENT))) / - BigInt(100) + existingTx.maxFeePerblobGas + + (existingTx.maxFeePerblobGas * BigInt(MIN_GAS_PRICE_BUMP_PERCENT)) / BigInt(100) if (addedTx.maxFeePerblobGas < minblobGasFee) { throw new Error('replacement blob gas too low') } diff --git a/packages/common/src/hardforks.ts b/packages/common/src/hardforks.ts index 0acae08b5fe..59583547335 100644 --- a/packages/common/src/hardforks.ts +++ b/packages/common/src/hardforks.ts @@ -837,6 +837,6 @@ export const hardforks: HardforksDict = { 'Next feature hardfork after the shanghai having proto-danksharding EIP 4844 blobs (still WIP hence not for production use), transient storage opcodes, parent beacon block root availability in EVM and selfdestruct only in same transaction', url: 'https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md', status: Status.Final, - eips: [4844, 1153, 4788, 5656, 6780], + eips: [4844, 4788, 5656, 6780], }, }