ethereumjs-monorepo

@ethereumjs/vm


@ethereumjs/vm / BlockBuilder

Class: BlockBuilder

Defined in: vm/src/buildBlock.ts:56

Constructors

Constructor

new BlockBuilder(vm, opts): BlockBuilder

Defined in: vm/src/buildBlock.ts:88

Parameters

vm

VM

opts

BuildBlockOpts

Returns

BlockBuilder

Properties

blobGasUsed

blobGasUsed: bigint = BIGINT_0

Defined in: vm/src/buildBlock.ts:64

The cumulative blob gas used by the blobs in a block


gasUsed

gasUsed: bigint = BIGINT_0

Defined in: vm/src/buildBlock.ts:60

The cumulative gas used by the transactions added to the block.

Accessors

minerValue

Get Signature

get minerValue(): bigint

Defined in: vm/src/buildBlock.ts:84

Returns

bigint


transactionReceipts

Get Signature

get transactionReceipts(): TxReceipt[]

Defined in: vm/src/buildBlock.ts:80

Returns

TxReceipt[]

Methods

addTransaction()

addTransaction(tx, __namedParameters): Promise<RunTxResult>

Defined in: vm/src/buildBlock.ts:218

Run and add a transaction to the block being built. Please note that this modifies the state of the VM. Throws if the transaction’s gasLimit is greater than the remaining gas in the block.

Parameters

tx

TypedTransaction

__namedParameters
allowNoBlobs?

boolean

skipHardForkValidation?

boolean

Returns

Promise<RunTxResult>


build()

build(sealOpts?): Promise<{ block: Block; requests: undefined | CLRequest<CLRequestType>[]; }>

Defined in: vm/src/buildBlock.ts:320

This method constructs the finalized block, including withdrawals and any CLRequests. It also:

Note: we add CLRequests here because they can be generated at any time during the lifecycle of a pending block so need to be provided only when the block is finalized.

Parameters

sealOpts?

SealBlockOpts

Returns

Promise<{ block: Block; requests: undefined | CLRequest<CLRequestType>[]; }>


getStatus()

getStatus(): BlockStatus

Defined in: vm/src/buildBlock.ts:140

Returns

BlockStatus


initState()

initState(): Promise<void>

Defined in: vm/src/buildBlock.ts:404

Returns

Promise<void>


logsBloom()

logsBloom(): Uint8Array<ArrayBufferLike>

Defined in: vm/src/buildBlock.ts:157

Calculates and returns the logs bloom for the block.

Returns

Uint8Array<ArrayBufferLike>


receiptTrie()

receiptTrie(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: vm/src/buildBlock.ts:169

Calculates and returns the receiptTrie for the block.

Returns

Promise<Uint8Array<ArrayBufferLike>>


revert()

revert(): Promise<void>

Defined in: vm/src/buildBlock.ts:298

Reverts the checkpoint on the StateManager to reset the state from any transactions that have been run.

Returns

Promise<void>


transactionsTrie()

transactionsTrie(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: vm/src/buildBlock.ts:147

Calculates and returns the transactionsTrie for the block.

Returns

Promise<Uint8Array<ArrayBufferLike>>