diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index 031d615b1f..10c2cd60d1 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -598,9 +598,9 @@ export class Block { } const expectedExcessBlobGas = parentHeader.calcNextExcessBlobGas() - if (this.header.excessBlobGas !== expectedExcessblobGas) { + if (this.header.excessBlobGas !== expectedExcessBlobGas) { throw new Error( - `block excessblobGas mismatch: have ${this.header.excessblobGas}, want ${expectedExcessblobGas}` + `block excessBlobGas mismatch: have ${this.header.excessBlobGas}, want ${expectedExcessBlobGas}` ) } } diff --git a/packages/block/src/from-beacon-payload.ts b/packages/block/src/from-beacon-payload.ts index f0d043715c..f0cea6b412 100644 --- a/packages/block/src/from-beacon-payload.ts +++ b/packages/block/src/from-beacon-payload.ts @@ -27,8 +27,8 @@ export type BeaconPayloadJson = { block_hash: string transactions: string[] withdrawals?: BeaconWithdrawal[] - data_gas_used?: string - excess_data_gas?: string + blob_gas_used?: string + excess_blob_gas?: string parent_beacon_block_root?: string } @@ -63,11 +63,11 @@ export function executionPayloadFromBeaconPayload(payload: BeaconPayloadJson): E })) } - if (payload.data_gas_used !== undefined && payload.data_gas_used !== null) { - executionPayload.blobGasUsed = bigIntToHex(BigInt(payload.data_gas_used)) + if (payload.blob_gas_used !== undefined && payload.blob_gas_used !== null) { + executionPayload.blobGasUsed = bigIntToHex(BigInt(payload.blob_gas_used)) } - if (payload.excess_data_gas !== undefined && payload.excess_data_gas !== null) { - executionPayload.excessblobGas = bigIntToHex(BigInt(payload.excess_data_gas)) + if (payload.excess_blob_gas !== undefined && payload.excess_blob_gas !== null) { + executionPayload.excessBlobGas = bigIntToHex(BigInt(payload.excess_blob_gas)) } if (payload.parent_beacon_block_root !== undefined && payload.parent_beacon_block_root !== null) { executionPayload.parentBeaconBlockRoot = payload.parent_beacon_block_root diff --git a/packages/block/src/header-from-rpc.ts b/packages/block/src/header-from-rpc.ts index 06c843ca62..1f475efeed 100644 --- a/packages/block/src/header-from-rpc.ts +++ b/packages/block/src/header-from-rpc.ts @@ -29,7 +29,7 @@ export function blockHeaderFromRpc(blockParams: JsonRpcBlock, options?: BlockOpt baseFeePerGas, withdrawalsRoot, blobGasUsed, - excessblobGas, + excessBlobGas, } = blockParams const blockHeader = BlockHeader.fromHeaderData( @@ -52,7 +52,7 @@ export function blockHeaderFromRpc(blockParams: JsonRpcBlock, options?: BlockOpt baseFeePerGas, withdrawalsRoot, blobGasUsed, - excessblobGas, + excessBlobGas, }, options ) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index cca59606d3..27a71e4737 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -55,7 +55,7 @@ export class BlockHeader { public readonly baseFeePerGas?: bigint public readonly withdrawalsRoot?: Uint8Array public readonly blobGasUsed?: bigint - public readonly excessblobGas?: bigint + public readonly excessBlobGas?: bigint public readonly parentBeaconBlockRoot?: Uint8Array public readonly common: Common @@ -109,7 +109,7 @@ export class BlockHeader { */ public static fromValuesArray(values: BlockHeaderBytes, opts: BlockOptions = {}) { const headerData = valuesArrayToHeaderData(values) - const { number, baseFeePerGas, excessblobGas, blobGasUsed, parentBeaconBlockRoot } = headerData + const { number, baseFeePerGas, excessBlobGas, blobGasUsed, parentBeaconBlockRoot } = headerData const header = BlockHeader.fromHeaderData(headerData, opts) // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (header.common.isActivatedEIP(1559) && baseFeePerGas === undefined) { @@ -121,8 +121,8 @@ export class BlockHeader { } // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (header.common.isActivatedEIP(4844)) { - if (excessblobGas === undefined) { - throw new Error('invalid header. excessblobGas should be provided') + if (excessBlobGas === undefined) { + throw new Error('invalid header. excessBlobGas should be provided') } else if (blobGasUsed === undefined) { throw new Error('invalid header. blobGasUsed should be provided') } @@ -211,7 +211,7 @@ export class BlockHeader { : undefined, withdrawalsRoot: this.common.isActivatedEIP(4895) ? KECCAK256_RLP : undefined, blobGasUsed: this.common.isActivatedEIP(4844) ? BigInt(0) : undefined, - excessblobGas: this.common.isActivatedEIP(4844) ? BigInt(0) : undefined, + excessBlobGas: this.common.isActivatedEIP(4844) ? BigInt(0) : undefined, parentBeaconBlockRoot: this.common.isActivatedEIP(4788) ? zeros(32) : undefined, } @@ -221,8 +221,8 @@ export class BlockHeader { toType(headerData.withdrawalsRoot, TypeOutput.Uint8Array) ?? hardforkDefaults.withdrawalsRoot const blobGasUsed = toType(headerData.blobGasUsed, TypeOutput.BigInt) ?? hardforkDefaults.blobGasUsed - const excessblobGas = - toType(headerData.excessblobGas, TypeOutput.BigInt) ?? hardforkDefaults.excessblobGas + const excessBlobGas = + toType(headerData.excessBlobGas, TypeOutput.BigInt) ?? hardforkDefaults.excessBlobGas const parentBeaconBlockRoot = toType(headerData.parentBeaconBlockRoot, TypeOutput.Uint8Array) ?? hardforkDefaults.parentBeaconBlockRoot @@ -242,7 +242,7 @@ export class BlockHeader { throw new Error('blob gas used can only be provided with EIP4844 activated') } - if (headerData.excessblobGas !== undefined) { + if (headerData.excessBlobGas !== undefined) { throw new Error('excess blob gas can only be provided with EIP4844 activated') } } @@ -271,7 +271,7 @@ export class BlockHeader { this.baseFeePerGas = baseFeePerGas this.withdrawalsRoot = withdrawalsRoot this.blobGasUsed = blobGasUsed - this.excessblobGas = excessblobGas + this.excessBlobGas = excessBlobGas this.parentBeaconBlockRoot = parentBeaconBlockRoot this._genericFormatValidation() this._validateDAOExtraData() @@ -580,12 +580,12 @@ export class BlockHeader { * @returns the price in gwei per unit of blob gas spent */ getblobGasPrice(): bigint { - if (this.excessblobGas === undefined) { - throw new Error('header must have excessblobGas field populated') + if (this.excessBlobGas === undefined) { + throw new Error('header must have excessBlobGas field populated') } return fakeExponential( this.common.param('gasPrices', 'minblobGasPrice'), - this.excessblobGas, + this.excessBlobGas, this.common.param('gasConfig', 'blobGasPriceUpdateFraction') ) } @@ -607,15 +607,15 @@ export class BlockHeader { /** * Calculates the excess blob gas for next (hopefully) post EIP 4844 block. */ - public calcNextExcessblobGas(): bigint { + public calcNextExcessBlobGas(): bigint { // The validation of the fields and 4844 activation is already taken care in BlockHeader constructor - const targetGasConsumed = (this.excessblobGas ?? BigInt(0)) + (this.blobGasUsed ?? BigInt(0)) - const targetblobGasPerBlock = this.common.param('gasConfig', 'targetblobGasPerBlock') + const targetGasConsumed = (this.excessBlobGas ?? BigInt(0)) + (this.blobGasUsed ?? BigInt(0)) + const targetBlobGasPerBlock = this.common.param('gasConfig', 'targetBlobGasPerBlock') - if (targetGasConsumed <= targetblobGasPerBlock) { + if (targetGasConsumed <= targetBlobGasPerBlock) { return BigInt(0) } else { - return targetGasConsumed - targetblobGasPerBlock + return targetGasConsumed - targetBlobGasPerBlock } } @@ -650,7 +650,7 @@ export class BlockHeader { } if (this.common.isActivatedEIP(4844) === true) { rawItems.push(bigIntToUnpaddedBytes(this.blobGasUsed!)) - rawItems.push(bigIntToUnpaddedBytes(this.excessblobGas!)) + rawItems.push(bigIntToUnpaddedBytes(this.excessBlobGas!)) } if (this.common.isActivatedEIP(4788) === true) { rawItems.push(this.parentBeaconBlockRoot!) @@ -923,7 +923,7 @@ export class BlockHeader { } if (this.common.isActivatedEIP(4844) === true) { jsonDict.blobGasUsed = bigIntToHex(this.blobGasUsed!) - jsonDict.excessblobGas = bigIntToHex(this.excessblobGas!) + jsonDict.excessBlobGas = bigIntToHex(this.excessBlobGas!) } if (this.common.isActivatedEIP(4788) === true) { jsonDict.parentBeaconBlockRoot = bytesToHex(this.parentBeaconBlockRoot!) diff --git a/packages/block/src/helpers.ts b/packages/block/src/helpers.ts index edfe4b08c4..e26ebeb5d2 100644 --- a/packages/block/src/helpers.ts +++ b/packages/block/src/helpers.ts @@ -41,7 +41,7 @@ export function valuesArrayToHeaderData(values: BlockHeaderBytes): HeaderData { baseFeePerGas, withdrawalsRoot, blobGasUsed, - excessblobGas, + excessBlobGas, parentBeaconBlockRoot, ] = values @@ -71,7 +71,7 @@ export function valuesArrayToHeaderData(values: BlockHeaderBytes): HeaderData { baseFeePerGas, withdrawalsRoot, blobGasUsed, - excessblobGas, + excessBlobGas, parentBeaconBlockRoot, } } diff --git a/packages/block/src/types.ts b/packages/block/src/types.ts index 90f4e33fe3..be47d9e81a 100644 --- a/packages/block/src/types.ts +++ b/packages/block/src/types.ts @@ -93,7 +93,7 @@ export interface HeaderData { baseFeePerGas?: BigIntLike withdrawalsRoot?: BytesLike blobGasUsed?: BigIntLike - excessblobGas?: BigIntLike + excessBlobGas?: BigIntLike parentBeaconBlockRoot?: BytesLike } @@ -158,7 +158,7 @@ export interface JsonHeader { baseFeePerGas?: string withdrawalsRoot?: string blobGasUsed?: string - excessblobGas?: string + excessBlobGas?: string parentBeaconBlockRoot?: string } @@ -190,7 +190,7 @@ export interface JsonRpcBlock { withdrawals?: Array // If EIP-4895 is enabled for this block, array of withdrawals withdrawalsRoot?: string // If EIP-4895 is enabled for this block, the root of the withdrawal trie of the block. blobGasUsed?: string // If EIP-4844 is enabled for this block, returns the blob gas used for the block - excessblobGas?: string // If EIP-4844 is enabled for this block, returns the excess blob gas for the block + excessBlobGas?: string // If EIP-4844 is enabled for this block, returns the excess blob gas for the block parentBeaconBlockRoot?: string // If EIP-4788 is enabled for this block, returns parent beacon block root } @@ -220,6 +220,6 @@ export type ExecutionPayload = { transactions: PrefixedHexString[] // Array of DATA - Array of transaction rlp strings, withdrawals?: WithdrawalV1[] // Array of withdrawal objects blobGasUsed?: PrefixedHexString // QUANTITY, 64 Bits - excessblobGas?: PrefixedHexString // QUANTITY, 64 Bits + excessBlobGas?: PrefixedHexString // QUANTITY, 64 Bits parentBeaconBlockRoot?: PrefixedHexString // QUANTITY, 64 Bits } diff --git a/packages/block/test/eip4788block.spec.ts b/packages/block/test/eip4788block.spec.ts index cea881e1d0..e74d5b7fc9 100644 --- a/packages/block/test/eip4788block.spec.ts +++ b/packages/block/test/eip4788block.spec.ts @@ -44,7 +44,7 @@ describe('EIP4788 header tests', () => { assert.doesNotThrow(() => { BlockHeader.fromHeaderData( { - excessblobGas: 0n, + excessBlobGas: 0n, blobGasUsed: 0n, parentBeaconBlockRoot: zeros(32), }, @@ -64,7 +64,7 @@ describe('EIP4788 header tests', () => { assert.equal( block.toJSON().header?.parentBeaconBlockRoot, bytesToHex(zeros(32)), - 'JSON output includes excessblobGas' + 'JSON output includes excessBlobGas' ) }) }) diff --git a/packages/block/test/eip4844block.spec.ts b/packages/block/test/eip4844block.spec.ts index a63bf0159a..05ef8a054a 100644 --- a/packages/block/test/eip4844block.spec.ts +++ b/packages/block/test/eip4844block.spec.ts @@ -41,7 +41,7 @@ describe('EIP4844 header tests', () => { () => { BlockHeader.fromHeaderData( { - excessblobGas: 1n, + excessBlobGas: 1n, }, { common: earlyCommon, @@ -50,7 +50,7 @@ describe('EIP4844 header tests', () => { }, 'excess blob gas can only be provided with EIP4844 activated', undefined, - 'should throw when setting excessblobGas with EIP4844 not being activated' + 'should throw when setting excessBlobGas with EIP4844 not being activated' ) assert.throws( @@ -69,19 +69,19 @@ describe('EIP4844 header tests', () => { 'should throw when setting blobGasUsed with EIP4844 not being activated' ) - const excessblobGas = BlockHeader.fromHeaderData( + const excessBlobGas = BlockHeader.fromHeaderData( {}, { common, skipConsensusFormatValidation: true } - ).excessblobGas + ).excessBlobGas assert.equal( - excessblobGas, + excessBlobGas, 0n, 'instantiates block with reasonable default excess blob gas value when not provided' ) assert.doesNotThrow(() => { BlockHeader.fromHeaderData( { - excessblobGas: 0n, + excessBlobGas: 0n, }, { common, @@ -97,9 +97,9 @@ describe('EIP4844 header tests', () => { { common, skipConsensusFormatValidation: true } ) assert.equal( - block.toJSON().header?.excessblobGas, + block.toJSON().header?.excessBlobGas, '0x0', - 'JSON output includes excessblobGas' + 'JSON output includes excessBlobGas' ) } }) @@ -110,40 +110,40 @@ describe('blob gas tests', () => { if (isBrowser() === false) { const preShardingHeader = BlockHeader.fromHeaderData({}) - let excessblobGas = preShardingHeader.calcNextExcessblobGas() + let excessBlobGas = preShardingHeader.calcNextExcessBlobGas() assert.equal( - excessblobGas, + excessBlobGas, 0n, 'excess blob gas where 4844 is not active on header should be 0' ) assert.throws( () => preShardingHeader.calcDataFee(1), - 'header must have excessblobGas field', + 'header must have excessBlobGas field', undefined, - 'calcDataFee throws when header has no excessblobGas field' + 'calcDataFee throws when header has no excessBlobGas field' ) const lowGasHeader = BlockHeader.fromHeaderData( - { number: 1, excessblobGas: 5000 }, + { number: 1, excessBlobGas: 5000 }, { common, skipConsensusFormatValidation: true } ) - excessblobGas = lowGasHeader.calcNextExcessblobGas() - let blobGasPrice = lowGasHeader.getblobGasPrice() + excessBlobGas = lowGasHeader.calcNextExcessBlobGas() + let blobGasPrice = lowGasHeader.getBlobGasPrice() assert.equal( - excessblobGas, + excessBlobGas, 0n, 'excess blob gas should be 0 for small parent header blob gas' ) assert.equal(blobGasPrice, 1n, 'blob gas price should be 1n when low or no excess blob gas') const highGasHeader = BlockHeader.fromHeaderData( - { number: 1, excessblobGas: 6291456, blobGasUsed: BigInt(6) * blobGasPerBlob }, + { number: 1, excessBlobGas: 6291456, blobGasUsed: BigInt(6) * blobGasPerBlob }, { common, skipConsensusFormatValidation: true } ) - excessblobGas = highGasHeader.calcNextExcessblobGas() + excessBlobGas = highGasHeader.calcNextExcessBlobGas() blobGasPrice = highGasHeader.getblobGasPrice() - assert.equal(excessblobGas, 6684672n) + assert.equal(excessBlobGas, 6684672n) assert.equal(blobGasPrice, 6n, 'computed correct blob gas price') assert.equal(lowGasHeader.calcDataFee(1), 131072n, 'compute data fee correctly') @@ -184,10 +184,10 @@ describe('transaction validation tests', () => { ).sign(randomBytes(32)) const parentHeader = BlockHeader.fromHeaderData( - { number: 1n, excessblobGas: 4194304, blobGasUsed: 0 }, + { number: 1n, excessBlobGas: 4194304, blobGasUsed: 0 }, { common, skipConsensusFormatValidation: true } ) - const excessblobGas = parentHeader.calcNextExcessblobGas() + const excessBlobGas = parentHeader.calcNextExcessBlobGas() // eslint-disable-next-line no-inner-declarations function getBlock(transactions: TypedTransaction[]) { @@ -197,7 +197,7 @@ describe('transaction validation tests', () => { { number: 2n, parentHash: parentHeader.hash(), - excessblobGas, + excessBlobGas, blobGasUsed: BigInt(blobs) * blobGasPerBlob, }, { common, skipConsensusFormatValidation: true } diff --git a/packages/block/test/from-beacon-payload.spec.ts b/packages/block/test/from-beacon-payload.spec.ts index 1b65d248fb..4476585b63 100644 --- a/packages/block/test/from-beacon-payload.spec.ts +++ b/packages/block/test/from-beacon-payload.spec.ts @@ -21,7 +21,7 @@ describe('[fromExecutionPayloadJson]: 4844 devnet 5', () => { try { const block = await Block.fromBeaconPayloadJson(payload, { common }) const parentHeader = BlockHeader.fromHeaderData( - { excessblobGas: BigInt(0), blobGasUsed: block.header.excessblobGas! + BigInt(393216) }, + { excessBlobGas: BigInt(0), blobGasUsed: block.header.excessBlobGas! + BigInt(393216) }, { common } ) block.validateBlobTransactions(parentHeader) @@ -56,12 +56,12 @@ describe('[fromExecutionPayloadJson]: 4844 devnet 5', () => { }, { common } ) - const parentHeader = BlockHeader.fromHeaderData({ excessblobGas: BigInt(0) }, { common }) + const parentHeader = BlockHeader.fromHeaderData({ excessBlobGas: BigInt(0) }, { common }) block.validateBlobTransactions(parentHeader) assert.fail(`should have failed constructing the block`) } catch (e) { assert.ok(true, `correctly failed constructing block, error: ${e}`) - assert.ok(`${e}`.includes('block excessblobGas mismatch'), 'failed with correct error') + assert.ok(`${e}`.includes('block excessBlobGas mismatch'), 'failed with correct error') } }) }) diff --git a/packages/blockchain/src/blockchain.ts b/packages/blockchain/src/blockchain.ts index 967a8e98b1..0cc0c37b41 100644 --- a/packages/blockchain/src/blockchain.ts +++ b/packages/blockchain/src/blockchain.ts @@ -612,9 +612,9 @@ export class Blockchain implements BlockchainInterface { } if (header.common.isActivatedEIP(4844) === true) { - const expectedExcessblobGas = parentHeader.calcNextExcessblobGas() - if (header.excessblobGas !== expectedExcessblobGas) { - throw new Error(`expected blob gas: ${expectedExcessblobGas}, got: ${header.excessblobGas}`) + const expectedExcessBlobGas = parentHeader.calcNextExcessBlobGas() + if (header.excessBlobGas !== expectedExcessBlobGas) { + throw new Error(`expected blob gas: ${expectedExcessBlobGas}, got: ${header.excessBlobGas}`) } } } diff --git a/packages/client/src/miner/pendingBlock.ts b/packages/client/src/miner/pendingBlock.ts index 612de4a2a9..7394c3f2b1 100644 --- a/packages/client/src/miner/pendingBlock.ts +++ b/packages/client/src/miner/pendingBlock.ts @@ -141,7 +141,7 @@ export class PendingBlock { const builder = await vm.buildBlock({ parentBlock, - // excessblobGas will be correctly calculated and set in buildBlock constructor, + // excessBlobGas will be correctly calculated and set in buildBlock constructor, // unless already explicity provided in headerData headerData: { ...headerData, diff --git a/packages/client/src/rpc/modules/engine.ts b/packages/client/src/rpc/modules/engine.ts index 8ceb64f240..ee61ae4580 100644 --- a/packages/client/src/rpc/modules/engine.ts +++ b/packages/client/src/rpc/modules/engine.ts @@ -51,7 +51,7 @@ type WithdrawalV1 = Exclude[number] export type ExecutionPayloadV1 = ExecutionPayload export type ExecutionPayloadV2 = ExecutionPayloadV1 & { withdrawals: WithdrawalV1[] } // parentBeaconBlockRoot comes separate in new payloads and needs to be added to payload data -export type ExecutionPayloadV3 = ExecutionPayloadV2 & { excessblobGas: Uint64; blobGasUsed: Uint64 } +export type ExecutionPayloadV3 = ExecutionPayloadV2 & { excessBlobGas: Uint64; blobGasUsed: Uint64 } export type ForkchoiceStateV1 = { headBlockHash: Bytes32 @@ -131,7 +131,7 @@ const executionPayloadV2FieldValidators = { const executionPayloadV3FieldValidators = { ...executionPayloadV2FieldValidators, blobGasUsed: validators.uint64, - excessblobGas: validators.uint64, + excessBlobGas: validators.uint64, } const forkchoiceFieldValidators = { @@ -184,7 +184,7 @@ export const blockToExecutionPayload = (block: Block, value: bigint, bundle?: Bl extraData: header.extraData!, baseFeePerGas: header.baseFeePerGas!, blobGasUsed: header.blobGasUsed, - excessblobGas: header.excessblobGas, + excessBlobGas: header.excessBlobGas, blockHash: bytesToHex(block.hash()), prevRandao: header.mixHash!, transactions, diff --git a/packages/client/src/rpc/modules/eth.ts b/packages/client/src/rpc/modules/eth.ts index 67c3975686..7a33acae30 100644 --- a/packages/client/src/rpc/modules/eth.ts +++ b/packages/client/src/rpc/modules/eth.ts @@ -130,7 +130,7 @@ const jsonRpcBlock = async ( baseFeePerGas: header.baseFeePerGas, ...withdrawalsAttr, blobGasUsed: header.blobGasUsed, - excessblobGas: header.excessblobGas, + excessBlobGas: header.excessBlobGas, } } diff --git a/packages/client/src/rpc/util/CLConnectionManager.ts b/packages/client/src/rpc/util/CLConnectionManager.ts index 2c67cac52e..e276787af5 100644 --- a/packages/client/src/rpc/util/CLConnectionManager.ts +++ b/packages/client/src/rpc/util/CLConnectionManager.ts @@ -157,9 +157,9 @@ export class CLConnectionManager { if ('withdrawals' in payload.payload && payload.payload.withdrawals !== null) { msg += ` withdrawals=${(payload.payload as ExecutionPayloadV2).withdrawals.length}` } - if ('excessblobGas' in payload.payload && payload.payload.excessblobGas !== null) { - msg += ` blobGasUsed=${(payload.payload as ExecutionPayloadV3).blobGasUsed} excessblobGas=${ - (payload.payload as ExecutionPayloadV3).excessblobGas + if ('excessBlobGas' in payload.payload && payload.payload.excessBlobGas !== null) { + msg += ` blobGasUsed=${(payload.payload as ExecutionPayloadV3).blobGasUsed} excessBlobGas=${ + (payload.payload as ExecutionPayloadV3).excessBlobGas }` } return msg diff --git a/packages/client/test/rpc/engine/getPayloadV3.spec.ts b/packages/client/test/rpc/engine/getPayloadV3.spec.ts index 12b49752b1..a248df1a70 100644 --- a/packages/client/test/rpc/engine/getPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/getPayloadV3.spec.ts @@ -127,7 +127,7 @@ describe(method, () => { '0x0a4f946a9dac3f6d2b86d02dfa6cf221b4fe72bbaff51b50cee4c5784156dd52', 'built expected block' ) - assert.equal(executionPayload.excessblobGas, '0x0', 'correct execess blob gas') + assert.equal(executionPayload.excessBlobGas, '0x0', 'correct execess blob gas') assert.equal(executionPayload.blobGasUsed, '0x20000', 'correct blob gas used') const { commitments, proofs, blobs } = blobsBundle assert.ok( diff --git a/packages/client/test/rpc/engine/newPayloadV3.spec.ts b/packages/client/test/rpc/engine/newPayloadV3.spec.ts index 3cdc3d5c5a..ff49e763b8 100644 --- a/packages/client/test/rpc/engine/newPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/newPayloadV3.spec.ts @@ -37,7 +37,7 @@ describe(`${method}: call with executionPayloadV3`, () => { ...blockData, withdrawals: [], blobGasUsed: '0x0', - excessblobGas: '0x0', + excessBlobGas: '0x0', } const req = params(method, [validBlock, [], parentBeaconBlockRoot]) @@ -62,7 +62,7 @@ describe(`${method}: call with executionPayloadV3`, () => { timestamp: bigIntToHex(BigInt(cancunTime)), withdrawals: [], blobGasUsed: '0x0', - excessblobGas: '0x0', + excessBlobGas: '0x0', blockHash: '0x6ec6f32e6931199f8f84faf46a59bc9a1e65a23aa73ca21278b5cb48aa2d059d', stateRoot: '0x454a9db6943b17a5f88aea507d0c3f4420d533d143b4eb5194cc7589d721b024', } diff --git a/packages/client/test/rpc/engine/newPayloadV3VersionedHashes.spec.ts b/packages/client/test/rpc/engine/newPayloadV3VersionedHashes.spec.ts index c28ec56ac8..6e236ba517 100644 --- a/packages/client/test/rpc/engine/newPayloadV3VersionedHashes.spec.ts +++ b/packages/client/test/rpc/engine/newPayloadV3VersionedHashes.spec.ts @@ -12,7 +12,7 @@ import type { HttpServer } from 'jayson' const method = 'engine_newPayloadV3' -// blocks are missing excessblobGas and blobGasUsed which will be set to default 0 for 4844 blocks +// blocks are missing excessBlobGas and blobGasUsed which will be set to default 0 for 4844 blocks // however its not required to set to correct value to test for versioned hashes test cases const [blockData] = blocks @@ -41,7 +41,7 @@ describe(`${method}: Cancun validations`, () => { blockHash: '0xb8b9607bd09f0c18bccfa4dcb6fe355f07d383c902f0fc2a1671cf20792e131c', withdrawals: [], blobGasUsed: '0x0', - excessblobGas: '0x0', + excessBlobGas: '0x0', }, // versioned hashes ['0x3434', '0x2334'], @@ -73,7 +73,7 @@ describe(`${method}: Cancun validations`, () => { transactions: [txString, txString], withdrawals: [], blobGasUsed: '0x40000', - excessblobGas: '0x0', + excessBlobGas: '0x0', }, ] req = params(method, blockDataNoneHashes) @@ -89,7 +89,7 @@ describe(`${method}: Cancun validations`, () => { transactions: [txString, txString], withdrawals: [], blobGasUsed: '0x40000', - excessblobGas: '0x0', + excessBlobGas: '0x0', }, txVersionedHashesString, ] @@ -107,7 +107,7 @@ describe(`${method}: Cancun validations`, () => { blockHash: '0xeea272bb9ac158550c645a1b0666727a5fefa4a865f8d4c642a87143d2abef39', withdrawals: [], blobGasUsed: '0x40000', - excessblobGas: '0x0', + excessBlobGas: '0x0', // two blob transactions but missing versioned hash of second transactions: [txString, txString], }, @@ -131,7 +131,7 @@ describe(`${method}: Cancun validations`, () => { blockHash: '0xeea272bb9ac158550c645a1b0666727a5fefa4a865f8d4c642a87143d2abef39', withdrawals: [], blobGasUsed: '0x40000', - excessblobGas: '0x0', + excessBlobGas: '0x0', // two blob transactions but mismatching versioned hash of second transactions: [txString, txString], }, @@ -155,7 +155,7 @@ describe(`${method}: Cancun validations`, () => { blockHash: '0xeea272bb9ac158550c645a1b0666727a5fefa4a865f8d4c642a87143d2abef39', withdrawals: [], blobGasUsed: '0x40000', - excessblobGas: '0x0', + excessBlobGas: '0x0', // two blob transactions with matching versioned hashes transactions: [txString, txString], }, diff --git a/packages/client/test/sim/sharding.spec.ts b/packages/client/test/sim/sharding.spec.ts index 3094f56ab6..16259af0b3 100644 --- a/packages/client/test/sim/sharding.spec.ts +++ b/packages/client/test/sim/sharding.spec.ts @@ -136,7 +136,7 @@ describe('sharding/eip4844 hardfork tests', async () => { [txReceipt.result.blockHash, false], 2.0 ) - assert.ok(BigInt(block1.result.excessblobGas) > 0n, 'block1 has excess blob gas > 0') + assert.ok(BigInt(block1.result.excessBlobGas) > 0n, 'block1 has excess blob gas > 0') }) it('point precompile contract test', async () => { diff --git a/packages/common/src/eips.ts b/packages/common/src/eips.ts index 7d207452af..cbe2146a7f 100644 --- a/packages/common/src/eips.ts +++ b/packages/common/src/eips.ts @@ -394,7 +394,7 @@ export const EIPs: EIPsDict = { v: 131072, d: 'The base fee for blob gas per blob', }, - targetblobGasPerBlock: { + targetBlobGasPerBlock: { v: 393216, d: 'The target blob gas consumed per block', }, diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 58f1307ad3..c882be2bc4 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -46,7 +46,7 @@ export interface GenesisBlockConfig { nonce: string extraData: string baseFeePerGas?: string - excessblobGas?: string + excessBlobGas?: string } export interface HardforkTransitionConfig { diff --git a/packages/common/src/utils.ts b/packages/common/src/utils.ts index 15ed14c45c..8a6d0bcd05 100644 --- a/packages/common/src/utils.ts +++ b/packages/common/src/utils.ts @@ -37,7 +37,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge: boolean = true) { gasLimit, coinbase, baseFeePerGas, - excessblobGas, + excessBlobGas, }: { name: string config: any @@ -46,7 +46,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge: boolean = true) { gasLimit: string coinbase: string baseFeePerGas: string - excessblobGas: string + excessBlobGas: string } = json let { extraData, timestamp, nonce }: { extraData: string; timestamp: string; nonce: string } = json @@ -87,7 +87,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge: boolean = true) { mixHash, coinbase, baseFeePerGas, - excessblobGas, + excessBlobGas, }, hardfork: undefined as string | undefined, hardforks: [] as ConfigHardfork[], diff --git a/packages/vm/src/buildBlock.ts b/packages/vm/src/buildBlock.ts index 35a9ae89aa..3e8f93c2c3 100644 --- a/packages/vm/src/buildBlock.ts +++ b/packages/vm/src/buildBlock.ts @@ -90,9 +90,9 @@ export class BlockBuilder { if ( this.vm.common.isActivatedEIP(4844) === true && - typeof this.headerData.excessblobGas === 'undefined' + typeof this.headerData.excessBlobGas === 'undefined' ) { - this.headerData.excessblobGas = opts.parentBlock.header.calcNextExcessblobGas() + this.headerData.excessBlobGas = opts.parentBlock.header.calcNextExcessBlobGas() } } @@ -223,7 +223,7 @@ export class BlockBuilder { const header = { ...this.headerData, gasUsed: this.gasUsed, - // correct excessblobGas should already part of headerData used above + // correct excessBlobGas should already part of headerData used above blobGasUsed, } @@ -305,7 +305,7 @@ export class BlockBuilder { logsBloom, gasUsed, timestamp, - // correct excessblobGas should already be part of headerData used above + // correct excessBlobGas should already be part of headerData used above blobGasUsed, } @@ -353,7 +353,6 @@ export class BlockBuilder { } export async function buildBlock(this: VM, opts: BuildBlockOpts): Promise { - // let opts override excessblobGas if there is some value passed there const blockBuilder = new BlockBuilder(this, opts) await blockBuilder.initState() return blockBuilder diff --git a/packages/vm/test/api/runTx.spec.ts b/packages/vm/test/api/runTx.spec.ts index d14eec3b52..ff4631f305 100644 --- a/packages/vm/test/api/runTx.spec.ts +++ b/packages/vm/test/api/runTx.spec.ts @@ -882,7 +882,7 @@ describe('runTx tests', () => { { header: BlockHeader.fromHeaderData( { - excessblobGas: 0n, + excessBlobGas: 0n, number: 1, parentHash: blockchain.genesisBlock.hash(), }, @@ -910,7 +910,7 @@ describe('runTx tests', () => { { header: BlockHeader.fromHeaderData( { - excessblobGas: 1n, + excessBlobGas: 1n, number: 2, parentHash: (await blockchain.getBlock(1n)).hash(), // Faking parent hash with getBlock stub },